-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Closed
Copy link
Labels
C-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Description
Problem
If you set rust-version = "1.77"
in Cargo.toml
and use the new cargo::
build script syntax, you will get this wonderful error:
error: the `cargo::` syntax for build script output instructions was added in Rust 1.77.0, but the minimum supported Rust version of `foo v0.1.0 (/tmp/foo)` is 1.77.
The workaround is to specify rust-version = "1.77.0"
, even though 1.77
and 1.77.0
mean exactly the same thing in semver.
Steps
cargo new foo
- paste this into
Cargo.toml
:
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
rust-version = "1.77"
[dependencies]
- create
build.rs
and paste this:
fn main() {
println!("cargo::rerun-if-changed=.");
}
cargo check
Possible Solution(s)
Maybe replace <
with !is_compatible_with
here:
cargo/src/cargo/core/compiler/custom_build.rs
Line 730 in e91b58d
if msrv < new_syntax_added_in { |
Notes
No response
Version
cargo 1.79.0-nightly (80d5b607d 2024-04-19)
release: 1.79.0-nightly
commit-hash: 80d5b607dde6ef97dfff4e23923822c01d2bb036
commit-date: 2024-04-19
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.3 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w 11 Sep 2023
weihanglo and oxalica
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.