-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
cargo: Use --env-set when we have nightly rustc #15148
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
Conversation
From #15138 (comment)
I don't think we need an option because it is already the user who opt-in by selecting the nightly rustc with |
c7465f7
to
4cb42f7
Compare
But developers who use nightly as a default on their machine (if only because half of rustfmt's options are nightly-only, or to run against latest clippy warnings) might not want to enable random nightly features. I don't think it's true that "most" crates fail without nightly due to In fact, the common case is OUT_DIR, which needs manual work to convert |
Fixes: #13752 |
Not random, it's now only enabled for AST generated by cargo subprojects for --set-env. Does it have other effect than allowing extra CLI arguments?
I guess it depends what set of crates you're using. I've been trying with the list from gst-plugins-rs, and OUT_DIR is a really common usage.
As long as there are no build-dependencies, the build.rs can easily be run by Meson. I have a branch doing that. For example |
There are several cases, and there are very few that both work and matter
It would be possible to add opt-in build.rs handling, with something like But I'd rather try something like a |
To be clear, I still think we should commit something like this patch. And we should be using nightly when it makes sense, e.g. for |
@bonzini what I don't understand is what downside does it have to use nightly features when available? It just make more things work out of the box. That limit the amount of projects that will require patching. I also do that to showcase that they really should stabilize Maybe it should be a global rust compiler option? i.e. |
That's exactly what I said above. :)) maybe we disagree on the default but having the option would make it a simple poll. |
4cb42f7
to
29bd01a
Compare
Ok, misunderstood, I thought you meant rust module option.
I made it auto by default, meaning it uses nightly features if available. Setting it to enabled will abort if it's a stable rustc. Setting it to disabled will prevent using --env-set, and potentially other features in the future. |
I wonder if this is the way forward with some of these changes we would like from Rust in general. The "Look, a downstream is using this successfully to solve their problems" argument is more convincing than "We think we can solve our problems with this feature". |
29bd01a
to
66f0ca4
Compare
I changed OUT_DIR to be |
66f0ca4
to
53a42c0
Compare
This is used for project to require a nightly Rust compiler, and also for Meson to enable nightly feature if available.
53a42c0
to
86ca840
Compare
No description provided.