Skip to content

Commit a126993

Browse files
committed
fix: set msrv and gate incompat feature
1 parent cc0e5cb commit a126993

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ readme = "README.md"
1515
keywords = ["git", "git-remote", "codecommit"]
1616
categories = ["command-line-utilities", "development-tools"]
1717
publish = true
18+
rust-version = "1.85.0"
1819

1920
[workspace.lints.rust]
2021
let_underscore_drop = "warn"

crates/git-remote-codecommit/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ readme.workspace = true
1111
keywords.workspace = true
1212
categories.workspace = true
1313
publish.workspace = true
14+
rust-version.workspace = true
1415

1516
[lints]
1617
workspace = true
1718

19+
[features]
20+
default = []
21+
debug-probe = [] ## msrv: 1.87.0
22+
1823
[dependencies]
1924
anyhow = "1.0.86"
2025
aws-config = "1.5.3"

crates/git-remote-codecommit/build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
//! very new but replaces the manually implemented `BoolExt` trait.
99
1010
use std::ffi::OsString;
11+
#[cfg(feature = "debug-probe")]
1112
use std::fmt;
13+
#[cfg(feature = "debug-probe")]
1214
use std::fmt::Write;
1315
use std::fs;
1416
use std::io::ErrorKind;
@@ -125,7 +127,9 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {
125127
}
126128
}
127129

130+
#[cfg(feature = "debug-probe")]
128131
let debug = rustc_probe_debug();
132+
#[cfg(feature = "debug-probe")]
129133
if debug {
130134
let mut msg = String::new();
131135
write_command(&mut msg, &cmd).expect("write to string does not fail");
@@ -141,10 +145,14 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {
141145
// Clean up to avoid leaving nondeterministic absolute paths in the dep-info
142146
// file in OUT_DIR, which causes nonreproducible builds in build systems
143147
// that treat the entire OUT_DIR as an artifact.
148+
#[cfg(feature = "debug-probe")]
144149
if !debug {
145150
rmrf(&out_subdir);
146151
}
147152

153+
#[cfg(not(feature = "debug-probe"))]
154+
rmrf(&out_subdir);
155+
148156
success
149157
}
150158

@@ -198,6 +206,7 @@ fn rustc_command() -> Command {
198206
}
199207
}
200208

209+
#[cfg(feature = "debug-probe")]
201210
fn rustc_probe_debug() -> bool {
202211
fn is_falsy(mut s: OsString) -> bool {
203212
if s.len() <= 5 {
@@ -216,6 +225,7 @@ fn rustc_probe_debug() -> bool {
216225
}
217226
}
218227

228+
#[cfg(feature = "debug-probe")]
219229
fn write_command(out: &mut impl Write, cmd: &Command) -> fmt::Result {
220230
writeln!(out, "Running RUSTC command:")?;
221231
if let Some(cwd) = cmd.get_current_dir() {

0 commit comments

Comments
 (0)