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

Update arrayvec #334

Merged
merged 1 commit into from
Dec 7, 2021
Merged

Update arrayvec #334

merged 1 commit into from
Dec 7, 2021

Conversation

c410-f3r
Copy link
Contributor

@c410-f3r c410-f3r commented Apr 3, 2021

Glad to wait until you feel comfortable with the new minimum Rustc version.

@paupino
Copy link
Owner

paupino commented Apr 16, 2021

Thank you for updating this! For (my) reference, this requires a minimum Rust version of 1.51.

@c410-f3r c410-f3r force-pushed the stuff branch 2 times, most recently from a7a0766 to dd1b09e Compare April 23, 2021 20:23
@paupino
Copy link
Owner

paupino commented Apr 24, 2021

Sorry - I realize the latest changes in master will break this build (again). The fix is to bump the minimum version specified in the github workflow file. I just wanted to make sure the minimum version was explicit going forward.

@c410-f3r
Copy link
Contributor Author

Sup @paupino. Don't worry!

@paupino
Copy link
Owner

paupino commented Aug 20, 2021

I've been thinking how we can keep this up to date as much as possible while still maintaining minimal compiler support.

One way, which avoids bumping the minimum version, is to move arrayvec usage into a feature - perhaps as a default feature. It'd mean that the non-arrayvec feature would need to be reimplemented (using String etc). I played around with this a little bit and got it working but it is quite a bit slower (over 4x-5x). Perhaps that's acceptable if arrayvec is enabled by default?

On the other hand: it would be nice to start thinking about how to leverage some new compiler features within the library itself. I guess the other alternative is to create an LTS branch which would commit to minor big fixes, whilst still allowing the main branch to continue moving forward.

I'm perhaps leaning towards an LTS since it'd be nice to expand support within the library, particularly with the new edition around the corner.

Thoughts?

@schungx
Copy link
Contributor

schungx commented Aug 20, 2021

I am mostly keeping bug fixes on the main line, and a vnext or dev branch for new developments. However, I find that, in practice, this may not be optimal. The main problem is with keep the dev branch updated with bug fixes.

What you suggest, i.e. to keep a bug-fixes branch and develop on the main line might actually be better. I'm going to migrate one of my projects to this style and try it out.

@c410-f3r
Copy link
Contributor Author

My initial thoughts:

Optional features

arrayvec_0_6 = { optional = true, package = "arrayvec", version = "0.6" }
arrayvec_0_7 = { optional = true, package = "arrayvec", version = "0.7" }

Does not work because:

  1. Introduces a cumbersome breaking change forcing everybody to explicitly set the desired arrayvec dependency version.
  2. Cargo features are additives so a default = [arrayvec_0_6] won't go away when setting --feature arrayvec_0_7
  3. build.rs does not set cargo features, only rust flags.

LTS

Rust does not support LTS compilers and simply ask ppl to update their toolchains when a security issue is discovered and fixed on the standard library or in the language itself. But hey, it doesn't work because a lot of ppl are relying and deploying software based on a fixed version.

Conclusion

With all that said, I really don't know the best solution for this scenario

@schungx
Copy link
Contributor

schungx commented Aug 21, 2021

IMHO, just wait a bit until compiler installations catch up. I can't see users of Rust are very reluctant to upgrade versions... maybe not immediately, but definitely once in a while to catch up.

That's like Chrome and others where you basically just update without second thoughts, even in many corporate environments.

@c410-f3r
Copy link
Contributor Author

Hum... Per the recent Minimum Rust Compiler Version comment, it seems that the ArrayVec update is now possible.

Is that right, @paupino? If so, it would be awesome because my heart cries every time I type cargo tree -d.

@c410-f3r
Copy link
Contributor Author

c410-f3r commented Sep 30, 2021

Ah, NVM. Such feature will only the possible on 2022/03/25.

@paupino
Copy link
Owner

paupino commented Dec 6, 2021

I wonder if support n - 5 versions is better than the 1 year constraint? This equates to approximately half a year. Of course, it would be only on an "as needed" basis - so the minimum would be bumped to 1.50.

I'd also love to get this wrapped up and start playing with const generics! :)

@c410-f3r
Copy link
Contributor Author

c410-f3r commented Dec 6, 2021

Re-based in case the constraint is relaxed. IMHO, constant generics is a huge milestone that is worth supporting.

@paupino paupino merged commit 152506c into paupino:master Dec 7, 2021
@c410-f3r
Copy link
Contributor Author

c410-f3r commented Dec 7, 2021

Thanks @paupino 🙃

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 this pull request may close these issues.

None yet

3 participants