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

Indicate correct Minimum Supported Rust Version (MSRV) #159

Open
piotr-sk opened this issue Nov 28, 2024 · 3 comments
Open

Indicate correct Minimum Supported Rust Version (MSRV) #159

piotr-sk opened this issue Nov 28, 2024 · 3 comments

Comments

@piotr-sk
Copy link

The crate in version 0.23 is released with MSRV of 1.56, but a compilation with Rust lower than 1.77 fails.

Screenshot from 2024-11-28 08-22-01

$ cargo build
...
   Compiling k8s-openapi v0.23.0
error: unsupported output in build script of `k8s-openapi v0.23.0`: `cargo::rerun-if-env-changed=K8S_OPENAPI_ENABLED_VERSION`
Found a `cargo::key=value` build directive which is reserved for future use.
Either change the directive to `cargo:key=value` syntax (note the single `:`) or upgrade your version of Rust.
See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script for more information about build script outputs.

To be consistent I recommend to either use the old directive as indicated by the compiler or to clearly state MSRV of Rust 1.77.

Background: for some embedded applications we cannot always use the latest compiler versions.

@Arnavion
Copy link
Owner

Arnavion commented Nov 28, 2024

The crate in version 0.23 is released with MSRV of 1.56, but a compilation with Rust lower than 1.77 fails.

That crates.io MSRV number is fake. crates.io just pretends that the MSRV is 1.56.0 because the crate has edition 2021 and 1.56.0 is when that edition was introduced. I've filed rust-lang/crates.io#10103 on them to not show fake values.

To be consistent I recommend to either use the old directive as indicated by the compiler

The build.rs change is just the first thing that won't compile on 1.56.0. Various things from libstd are also used that won't.

I only test for compilation with latest stable and nightly, because the main user of my crate that I know about is my dayjob, and they keep up with Rust stable releases too.

Background: for some embedded applications we cannot always use the latest compiler versions.

Sure, so then what version are you using that you want to work?

@piotr-sk
Copy link
Author

Thanks for explaining the point of getting a derived MSRV version based on the Rust edition.
I agree that it is confusing and you've created a valid issue for crates.io.

I can stay with an older version of this crate until I can update the Rust versions in the project, so this is not a problem for me.

The issue was open in case you wanted to support MSRV correctly.
As it seems you are not interested in this topic and recommend using latest Rust version, feel free to close the issue.

@Arnavion
Copy link
Owner

As it seems you are not interested in this topic and recommend using latest Rust version

If that was the case I would not have asked you what version you want supported.

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

2 participants