Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generic-array v0.14 #166

Closed
tarcieri opened this issue May 24, 2020 · 13 comments · Fixed by #189
Closed

generic-array v0.14 #166

tarcieri opened this issue May 24, 2020 · 13 comments · Fixed by #189

Comments

@tarcieri
Copy link

We just bumped all of the RustCrypto crates to generic-array v0.14, which adds some nice features:

RustCrypto/traits#95

It'd be great if heapless got updated too so we could share a single version of generic-array (which hasn't happened so far as the RustCrypto crates were previously stuck on v0.12).

We use heapless in the aead crate to provide a Vec-like buffer type on no_std. Here's an example:

https://docs.rs/aes-gcm/0.5.0/aes_gcm/#in-place-usage-eliminates-alloc-requirement

@tarcieri
Copy link
Author

tarcieri commented Jun 3, 2020

It looks like as-slice needs to get updated to make this happen: japaric/as-slice#6

@burrbull
Copy link
Member

burrbull commented Jun 4, 2020

It requires minimum Rust version of 1.41.0

@tarcieri
Copy link
Author

tarcieri commented Jun 4, 2020

Yes, it requires an MSRV bump. For what it's worth, we've bumped all of the RustCrypto crates to MSRV 1.41 for this reason.

@nickray
Copy link
Contributor

nickray commented Jun 6, 2020

We use heapless in the aead crate to provide a Vec-like buffer type on no_std. Here's an example:

You might be interested in #164, if that gets reviewed/accepted. It would be nice to have a shared interoperable byte buffer type, filling the gap below std/alloc. I'm also planning a CString type, but this could be a "minor" (patch) update.

Regarding MSRV, maybe RustCrypto/traits#43 (comment) is applicable here ("depend on range instead of specific version") and would cater to all user groups.

@tarcieri
Copy link
Author

tarcieri commented Jun 11, 2020

FYI, MSRV for generic-array v0.14 was just reduced to 1.36.0:

fizyk20/generic-array#102

That change was released in generic-array v0.14.2

@korken89
Copy link
Contributor

While I am positive to updating generic array, I am unsure if this is a breaking change in heapless.
I think we had similar discussions before in as-slice where it became a bit of a storm when we updated the generic-array dependency.

@netzdoktor
Copy link

I am facing the need to upgrading generic_array to 0.14.0, due to the following issue.

Without it, I am forced to stay on rustc 1.47.0, as 1.48. included this this and now causes a panic. Not a deal-breaker, but having to stay on an old rustc is not ideal.

I don't know about how pressing this is for others, but maybe heapless should bump it now to stay in sync with the rest of the ecosystem (rustc + generic_array)?

@korken89
Copy link
Contributor

It's a bit of a tough issue, this is a breaking change. I'm not sure how pliable heapless is to supporting both 0.13 and 0.14 of generic_array.
I was hoping we can hold out until const generics are released and make a major bump then and remove generic_array all together.
However if generic_array has UB in 0.13, I don't really see any option than to bump it.

@korken89
Copy link
Contributor

What do you think @japaric ? Should we bump to 0.14 within the current version of heapless to fix the UB?

@netzdoktor
Copy link

Is min_const_generics enough?

If yes, it is already merged and rustc 1.51. is to land on March 25th 2021. So it is something one can plan for.

Though stripping generic_array would then also take some additional time.

@korken89
Copy link
Contributor

Yes, min_const_generics is enough. We have already ported heapless to it and are just awaiting stabilization

@nickray
Copy link
Contributor

nickray commented Jan 31, 2021

@korken89 maybe it would be possible to bump heapless to 0.6 (bumping generic-array to 0.14), and then when you're ready, bump heapless to 0.7 (removing generic-array)? I know that's a few breaking change releases in a row, but it would be super helpful to not be stuck on 0.13 (+ the UB argument) when interoperating with the RustCrypto ecosystem.

@korken89
Copy link
Contributor

korken89 commented Feb 2, 2021

I agree, we could do a release to fix the UB issue, but if it is UB I'd sort of want it to be in the current version.
Not sure if this makes sense, or if we should just go to a new version...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants