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

v0.35.12 Not Compiling on Stable #434

Closed
rs017991 opened this issue Oct 24, 2022 · 6 comments
Closed

v0.35.12 Not Compiling on Stable #434

rs017991 opened this issue Oct 24, 2022 · 6 comments

Comments

@rs017991
Copy link

When updating some dependencies, I noticed that as of v0.35.12 (tagged yesterday with no release notes), rustix fails to build with the stable toolchain.

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> /home/rs017991/.cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.35.12/src/lib.rs:99:26
   |
99 | #![cfg_attr(rustc_attrs, feature(rustc_attrs))]
   |                          ^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
   --> /home/rs017991/.cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.35.12/src/lib.rs:116:5
    |
116 |     feature(core_intrinsics)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
   --> /home/rs017991/.cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.35.12/src/lib.rs:116:13
    |
116 |     feature(core_intrinsics)
    |             ^^^^^^^^^^^^^^^

I attempted to track down the exact change that caused the issue, but I am rather new to Rust and am clearly missing something.

(the lines mentioned in the above errors have not changed recently)

@sunfishcode
Copy link
Member

Hi! I'm not able to reproduce this, with rustc 1.64.0 (a55dd71d5 2022-09-19). Could you say what cargo features you've enabled, what Rust version you're using (eg. the output of rustc --version), and anything else that might be special about your build environment? Thanks!

@rs017991
Copy link
Author

I am using rustc 1.64.0 (a55dd71d5 2022-09-19) as well, with the stable-x86_64-unknown-linux-gnu (default) toolchain.

I am not using rustix directly, but rather am inheriting it via:

$ cargo tree -i rustix -f "{p} {f}"
rustix v0.35.12 default,io-lifetimes,libc,std,termios,use-libc-auxv
└── terminal_size v0.2.1
    ├── clap v4.0.18 color,default,derive,error-context,help,std,suggestions,usage,wrap_help

@rs017991
Copy link
Author

After messing around with it for a while trying (and failing) to reproduce the error with smaller programs, I tried building a freshly-cloned copy of the full program and it builds just fine.

So I'm guessing that there is something in the target directory that is corrupted or otherwise breaking things.

In case you think there might indeed be a rustix issue lurking about that you'd like diagnosed, I do still have a copy of the project that breaks every time. And I'm happy to run further experiments.

Or we can chalk it up to a ghost in the machine and I'll be on my way :)

Either way, sorry for the noise.

@ETKNeil
Copy link
Contributor

ETKNeil commented Oct 28, 2022

After messing around with it for a while trying (and failing) to reproduce the error with smaller programs, I tried building a freshly-cloned copy of the full program and it builds just fine.

So I'm guessing that there is something in the target directory that is corrupted or otherwise breaking things.

In case you think there might indeed be a rustix issue lurking about that you'd like diagnosed, I do still have a copy of the project that breaks every time. And I'm happy to run further experiments.

Or we can chalk it up to a ghost in the machine and I'll be on my way :)

Either way, sorry for the noise.

One of the possibility is that you ran an old rust-analyzer (either by loading it into a jetbrains product or because you didn't update it), here is the PR that fix those issues : rust-lang/rust-analyzer#13010
The issue related : rust-lang/rust-analyzer#13019

And how it affect most user through thiserror : dtolnay/thiserror#192
I could be wrong tho, but this is usually why it happens.
A simple cargo clean then rebuild does the job !

@rs017991
Copy link
Author

Thanks for the links. I do use IntelliJ, so that sounds likely. Let's call this closed.

@HU90m
Copy link

HU90m commented Feb 26, 2024

After messing around with it for a while trying (and failing) to reproduce the error with smaller programs, I tried building a freshly-cloned copy of the full program and it builds just fine.

So I'm guessing that there is something in the target directory that is corrupted or otherwise breaking things.

In case you think there might indeed be a rustix issue lurking about that you'd like diagnosed, I do still have a copy of the project that breaks every time. And I'm happy to run further experiments.

This saved me a lot of time; I had exactly the same issue and a simple rm -r target fixed it. Thanks for this!

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

No branches or pull requests

4 participants