-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Inventory doesn't work with Rust >= 1.54 #32
Comments
Nothing in this crate has changed since December. Can you try bisecting this to the first failing rustc nightly? https://github.com/rust-lang/cargo-bisect-rustc |
I just hit this same issue; will see if I can find the time to bisect. |
Unfortunately in my case whatever causes the failure appears to have occurred before |
I have a feeling this is not due to rustc but rather due to a bug in a dependency? I have bisected all the way back to |
Hello @sdleffler, thanks for your effort and further reporting. I've created a test project inventory-test.tar.gz that reproduces the problem. It also contains a rustc 1.53.0 (53cb7b09b 2021-06-17)
rustc 1.54.0 (a178d0322 2021-07-26)
I did several test-runs with |
I don't think we really mind that much here, Rust does sometimes have changes in nightly which accidentally make their way into stable and break things; it's more valuable to know exactly what spot in nightly broke the underlying ctor machinery. I'm going to take a stab at it with that project you've supplied myself and see what I can scrape up! |
Something is really, really strange here. I cannot fathom why the 2021-01-01 nightly, which should predate stable 1.53 by nearly half a year, is clearly showing the same problem; but, after a What could possibly be the difference between a nightly which is this early yet still shows the issue, and the 1.53 stable? Is there some kind of difference in what libc it's using?? |
@sdleffler can it be related to re-enabled incremental somehow? |
Incremental compilation is a thought!! I'll give it a try, but I can tell one thing for sure now - it's the linker. It's eliminating statics from different crates by eliminating the whole damn crate. If I pull in anything at all from one of the crates in question, all of the submitted |
Setting |
@m-ou-se thanks for the hint, I can confirm that my testcase works as expected on Rust 1.54 with |
We met this today while working on a |
Hey, I can confirm the same issue is reproducible with Rust 1.55. Is there still anything we can do here, or should I report to upstream? |
The reason for this change is, that the inventory-crate does not work with submits hold in several modules since rust 1.54. See dtolnay/inventory#32 for details.
I just ran into this as well. It doesn't seem to be related to a recent Rust version as I first encountered it on 1.51 and it behaves the same in 1.54 and 1.56. As far as I can tell the only condition needed for this bug is to have a large A real life example that I observed, below. ( // data.rs
#[my_macro]
#[derive(Serialize, Deserialize)]
enum One {
A
}
#[derive(Serialize, Deserialize)]
struct Two {
one: One
}
// mod.rs
pub fn example() -> data::Two {
data::Two { one: data::One::A }
} In this case Is there anything we can do to fix this in |
I can confirm that this issue is similar to linkme/issues#31, and might have its origin in rust-lang/rust#47384. |
This is fixed in rustc 1.62.0 / inventory 0.3.0. |
Hey there!
It seems inventory v0.1.10 does not work with Rust 1.54 as with Rust 1.53 before. I tested it with my project, when I run with
cargo +1.53 run -- "1"
it works as expected, when I try to run it with justcargo run -- "1"
on a rustc 1.54 stable toolchain, no plugins are registered anymore.Your example code from here runs as expected.
In my project in this mod.rs the for-loop at the end is never executed, as the
inventory::iter::<Builtin>
always returns None as first call to next(). I found out, that when I copy the plugins from the modules _std, string and token (first three mod lines) directly into the mod.rs, it works as expected. So inventory seems to not register plugins from other modules with Rust 1.54 anymore?Can you give me a hint?
The text was updated successfully, but these errors were encountered: