Skip to content

Commit 80cf05c

Browse files
committed
fix: gate msrv incompat feature
1 parent 516692f commit 80cf05c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

crates/git-remote-codecommit/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ publish.workspace = true
1515
[lints]
1616
workspace = true
1717

18+
[features]
19+
default = []
20+
debug-probe = [] ## msrv: 1.87.0
21+
1822
[dependencies]
1923
anyhow = "1.0.86"
2024
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)