-
Notifications
You must be signed in to change notification settings - Fork 293
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
Hashbrown fails to compile if 0.14.x and 0.15.x are in the same project, only one with the nightly feature #564
Comments
The problem appears to be that
Feature unification makes the requirement "When this feature is enabled your library MUST enable unstable |
I'm not sure there's anything actionable we can do on hashbrown's side... |
|
Summary: Use nightly Rust compiler and enable the `nightly` feature of `hashbrown` so that it compiles (see rust-lang/hashbrown#564) This wouldn't really be a problem if we correctly copied the internally used versions of Rust libraries, but we miss crate versions in most cases so sometimes skew causes problems like this. Disable broken sendstream test Fix #219 Test Plan: Export to PR Differential Revision: D64256300
Summary: Pull Request resolved: #264 Use nightly Rust compiler and enable the `nightly` feature of `hashbrown` so that it compiles (see rust-lang/hashbrown#564) This wouldn't really be a problem if we correctly copied the internally used versions of Rust libraries, but we miss crate versions in most cases so sometimes skew causes problems like this. Disable broken sendstream test Fix #219 Test Plan: Export to PR Differential Revision: D64256300
Summary: Pull Request resolved: #264 Use nightly Rust compiler and enable the `nightly` feature of `hashbrown` so that it compiles (see rust-lang/hashbrown#564) This wouldn't really be a problem if we correctly copied the internally used versions of Rust libraries, but we miss crate versions in most cases so sometimes skew causes problems like this. Disable broken sendstream test Fix #219 Test Plan: Export to PR Differential Revision: D64256300
Summary: Pull Request resolved: #264 Use nightly Rust compiler and enable the `nightly` feature of `hashbrown` so that it compiles (see rust-lang/hashbrown#564) This wouldn't really be a problem if we correctly copied the internally used versions of Rust libraries, but we miss crate versions in most cases so sometimes skew causes problems like this. Disable broken sendstream test Fix #219 Test Plan: Export to PR Differential Revision: D64256300
Summary: Pull Request resolved: #264 Use nightly Rust compiler and enable the `nightly` feature of `hashbrown` so that it compiles (see rust-lang/hashbrown#564) This wouldn't really be a problem if we correctly copied the internally used versions of Rust libraries, but we miss crate versions in most cases so sometimes skew causes problems like this. Disable broken sendstream test Fix #219 Test Plan: Export to PR Reviewed By: justintrudell Differential Revision: D64256300 fbshipit-source-id: 2d9965e3065dd9e8632a65b606d2b1210014777c
I just ran into this because of dependencies of my dependencies using hasbrown 14 but my code having 15. I think the best action for hashbrown here is to document this so it comes up in search easily. The error message was confusing but thankfully searching the issue tracker for "allocator_api" brought me here. |
seems to be the same or similar as #483 |
Hi, we just ran into this when updating dependencies and can't work around it because We aren't relying on the allocator api aspect of Would this proposed solution be acceptable?
Another approach that I think would work for us is if |
(I come from the same project as Imbris/Imberflur) I third the suggestion from cuviper, in the case of this specific crate it should work. However, if the Really, it is (and should be)(mostly) pointless/redundant to have both EDIT: Can confirm, in our case the fix is literally as simple as removing the diff --git a/Cargo.toml b/Cargo.toml
index 7bc1167..1d28792 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -47,7 +47,7 @@ default = ["default-hasher", "inline-more", "allocator-api2", "equivalent", "raw
# Enables use of nightly features. This is only guaranteed to work on the latest
# version of nightly Rust.
-nightly = ["allocator-api2?/nightly", "bumpalo/allocator_api"]
+nightly = ["bumpalo/allocator_api"]
# Enables the RustcEntry API used to provide the standard library's Entry API.
rustc-internal-api = [] I don't think this change should break anything, so it could be added in a patch release. |
Tried to run `cargo update`, but that broke things, see rust-lang/hashbrown#564. Updated: - itertools to 0.14 - kiddo to 5 - petgraph to 0.7 - notify to 8 - wasmtime and wasmtime-wasi to 29 Note: this causes even bigger problems if one were to try to run `cargo update` since even if one were to add certain transitive dependencies to common/Cargo.toml and enable the necessary feature flags, a transitive dependency here also depends on allocator-api2 but without exposing the proper feature flag. A fix is underway, see bytecodealliance/regalloc2#209 - axum to 0.8 - discord-sdk to 0.4 - minifb to 0.28
Yes, I think that would work. There is a small probability of breakage if someone was relying on hashbrown's Arguably the |
See rust-lang#564 for rationale. Tentatively fixes said issue and rust-lang#483, though the root cause is up to the `allocator-api2` crate to fix.
Considering how the stable part of Either way, I've started a PR for this change: #606; it turns out the direct use of |
See rust-lang#564 for rationale. Tentatively fixes said issue and rust-lang#483, though the root cause is up to the `allocator-api2` crate to fix. Direct use of `allocator-api2` in tests had to be replaced with the indirection used elsewhere in the crate.
See rust-lang#564 for rationale. Tentatively fixes said issue and rust-lang#483, though the root cause is up to the `allocator-api2` crate to fix. Direct use of `allocator-api2` in tests had to be replaced with the indirection used elsewhere in the crate.
If a project (most likely indirectly through dependencies) depends on both version 0.14.x and 0.15.x of hashbrown, and only one of the two dependencies has the
nightly
feature flag set, the project will fail to compile due to using theallocator_api
without enabling the unstable feature for it:This can be reproduced by making a clean new project and adding the following two lines to
Cargo.toml
:If it's just one of the two the project compiles fine, regardless of the
nightly
feature flag. If neither or both have thenightly
feature flag everything compiles fine as well. However if one has thenightly
feature flag and the other does not, the project doesn't compile.The text was updated successfully, but these errors were encountered: