-
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
build.rs
cargo::rustc-check-cfg
spurious error with MSRV 1.56
#14147
Comments
build.rs
cargo:rustc-check-cfg
spurious error with MSRV 1.56build.rs
cargo::rustc-check-cfg
spurious error with MSRV 1.56
It turns out that while 1.56 ignores this, it was made deprecated somewhere between that and 1.76. |
I think it makes sense being a hard error since it might be a typo hard to catch. As suggested from the error message, developers are able to just switch to the single colon version. There is also a feature release schedule mix between Anything blocking you from switching to the single colon |
See #13868. If there is any documentation improvement can be done, let us know. |
Not if it's going to be supported indefinitely. One problem I have is that I accidentally broke the MSRV of my crate. I have CI tests that test with 1.56, which didn't detect this. Normally Rust's stability guarantee would mean that if 1.56 works, so would 1.76. But that's not the case here. How many different Rust versions do I need to test with in CI. if I want to know that all versions since my MSRV will work? Which versions should I choose? ETA: my ticket forpreventing this happening again: https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/issues/104 |
That is unfortunate. For This is a useful reminder that emitting errors should follow pretty much the same compatibility practice as changes to Cargo.toml and config.toml when developing. Thank you for this bug report. I've opened #14150 for such a principle. |
This fixes build breakage in the build-repro test. derive-deftly 0.13.0 has an MSRV violation, due to a breach by cargo of the Rust stability guarantee: d-d 0.13.0 works with Rust 1.56 but not 1.76. References: https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/issues/103 rust-lang/cargo#14147 (comment)
This isn't strictly true. There were no "unknown directives" but anything that wasn't a known directive was instead a metadata With
This is actually fairly common. Say we add an unstable If you only test your MSRV and its from before we made a field unstable, then you can run into this. It would be great if we provided diagnostics to let you know when use of a feature would violate your MSRV. It looks like we are in this case, so I'm a bit confused at how this broke you. @ijackson is there something I'm missing as to how you accidentally broke your MSRV? One thing thats a little different with this build script situation compared to most In the case of As the hard error aligns with other uses hard error in build scripts and other places, I propose we close this. |
Problem
The check for the
cargo::
(double colon) syntax should apply only to directives that the MSRV would understand.Steps
Cargo.toml
:build.rs
:Expected output: it compiles.
Actual output:
Possible Solution(s)
Accept
cargo::
syntax unless the directive that follows::
is one that a compiler which only supports:
would understand.Notes
Unknown diretives are ignored, so
cargo::rustc-check-cfg
is completely fine. I htink no version of rust that would understandrustc-check-cfg
at all, doesn't understand::
.Version
The text was updated successfully, but these errors were encountered: