-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Should we vendor once_cell? #3212
Comments
cc @matklad in case there are additional thoughts on the feature problem. |
That's because Yeah, as far as I know, there's not stable way to get what you want here. 👍 from me on vendoring -- code in Though, the difference between parking_lot and std is pretty small in this case (as fast path is just acquire load in either case). There is some difference in terms of |
Also you won't have it anymore when you will switch to the std Lazy types in the future. |
We can probably do this without vendoring by using dependency renaming. # Cargo.toml
[features]
parking_lot = ["parking_lot-crate", "once_cell/parking_lot"]
[dependencies]
parking_lot-crate = { version = "...", package = "parking_lot", optional = true }
once_cell = { ... } // lib.rs
#[cfg(feature = "parking_lot")]
extern crate parking_lot_crate as parking_lot; However, unfortunately, this way always enables once_cell dependency when you enable the parking_lot feature. (until weak dependency features are stabilized.) |
Probably the best long-term solution is to help rust-lang/rust#74465 move forward. It's blocked on implementation & naming consensus, which should be fixable sinking by some hours into that (I am at the moment pretty swamped with near & rust-analyzer to so this myself :( ) |
If once_cell bumps MSRV (matklad/once_cell#198 (comment)) we may need to consider doing this to address it. The policy on how to handle MSRV bumps from dependencies is not yet decided, but rust-lang/libc#2845, rust-lang/libs-team#72, and some discussions related to it even discussed the possibility of forking libc. |
once_cell is unlikely to be more aggressive than six-months MSRV of tokio. At the moment, we are considering upgrading to 1.58, which is 11 months old. |
Yeah, it is not a problem for normal releases, but might be a problem for LTS releases: rust-lang/libc#2845 (comment) |
Fixes #3212. With the release of `v1.15`, the once_cell crate is breaking our current MSRV. Vendoring it will allow us to keep using certain APIs from that crate without compromising our MSRV.
Addressed by #5048 |
This issue has been opened to resolve the question posed in #3187 (comment), from the PR replacing
lazy_static
withonce_cell
.The text was updated successfully, but these errors were encountered: