-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
msrv below Rust 1.16 seemingly cannot be detected #408
Comments
Thanks for the report and ideas! I'll probably opt for the second option :). |
Proposed solutions for checking a wide range of toolchains where some do not support newer optionsProblem descriptionWith new Cargo releases come new Cargo subcommands and options. For example, we use These newer options may be desireable to use as cargo-msrv check command, but sometimes you may want to also support building older versions. Currently, this is only possible with backwards compatible cargo commands. For example, if you want to check Rust toolchains prior to Rust toolchain 1.16, you can't use our default check command, but you can run with a custom check command:
Usually we don't really care about the extra steps which That's currently not possible as Proposed solutionsCustom check command for a version rangeThis first solution proposes to let a user specify check commands for a version range; if a RUst version does not fall within the given ranges, we use the default instead. For example, if we may specify the range We probably can use semver's VersionReq to to parse ranges, and match versions to these ranges. Fallback checkA variation on the above would be to instead allow setting a fallback command which will be run when the primary check command fails. For example, if we specify the fallback command to be Fallback check when infering a Cargo "error: no such subcommand"Same as above, but more restrictive. Instead of always falling back to another command, we only do so when we detect certain Cargo errors. NB: This would most likely only support certain Cargo commands (normally, anything which can be run via Hardcoded subsitutionWe may also create a reference table of substitutions which take place for certain toolchain versions. E.g. if we detect This option is probably relatively simple to implement, but it has a considerable disadvantage: flags and options set on the Only override cargo-check with cargo-build when not using custom check commandsAnother variation would do nothing when a custom check command is specified, but, when the default is used substitute The advantage would be that we would supported toolchains This would also keep the door open for more complete (and complex) solutions such as the Custom check command for a version range solution above. Considerations
Remarks* Semantics may not be the correct word here: I'm trying to state that when this feature would be introduced, the different checks may not have the each an equal effect. For example, |
I recently had the occasion to try to find and verify the MSRV of libc. I noticed that
cargo msrv
told me it was Rust 1.16. What I expected it to be was Rust 1.13. Indeed, buildinglibc
with Rust 1.13 works. Buildinglibc
with Rust 1.12 fails.Anyway, here's the output I got:
From looking at the errors, my guess is that this is a result of using
cargo check
instead ofcargo build
. Sincecargo check
was introduced in Rust 1.16, it follows that this method can't be used to reliably detect an MSRV below Rust 1.16.Ideas:
wontfix
because anything before Rust 1.16 is way ancient and not worth supporting.cargo build
instead ofcargo check
to see if the build works. It's a bit more wasteful, but is likely to be rare in practice I think?The text was updated successfully, but these errors were encountered: