Skip to content

Commit 38707aa

Browse files
committed
fix: remove debug-probe
1 parent 53f38fa commit 38707aa

File tree

2 files changed

+0
-88
lines changed

2 files changed

+0
-88
lines changed

crates/git-remote-codecommit/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ workspace = true
1717

1818
[features]
1919
default = []
20-
debug-probe = [] ## msrv: 1.87.0
2120

2221
[dependencies]
2322
anyhow = "1.0.100"

crates/git-remote-codecommit/build.rs

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
//! very new but replaces the manually implemented `BoolExt` trait.
99
1010
use std::ffi::OsString;
11-
#[cfg(feature = "debug-probe")]
12-
use std::fmt;
13-
#[cfg(feature = "debug-probe")]
14-
use std::fmt::Write;
1511
use std::fs;
1612
use std::io::ErrorKind;
1713
use std::path::Path;
@@ -127,30 +123,11 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {
127123
}
128124
}
129125

130-
#[cfg(feature = "debug-probe")]
131-
let debug = rustc_probe_debug();
132-
#[cfg(feature = "debug-probe")]
133-
if debug {
134-
let mut msg = String::new();
135-
write_command(&mut msg, &cmd).expect("write to string does not fail");
136-
std::fs::write(out_subdir.join("probe-command"), msg)
137-
.unwrap_or_else(|err| die!("failed to write probe command: {err}"));
138-
}
139-
140126
let success = match cmd.status() {
141127
Ok(status) => status.success(),
142128
Err(_) => false,
143129
};
144130

145-
// Clean up to avoid leaving nondeterministic absolute paths in the dep-info
146-
// file in OUT_DIR, which causes nonreproducible builds in build systems
147-
// that treat the entire OUT_DIR as an artifact.
148-
#[cfg(feature = "debug-probe")]
149-
if !debug {
150-
rmrf(&out_subdir);
151-
}
152-
153-
#[cfg(not(feature = "debug-probe"))]
154131
rmrf(&out_subdir);
155132

156133
success
@@ -205,67 +182,3 @@ fn rustc_command() -> Command {
205182
Command::new(path)
206183
}
207184
}
208-
209-
#[cfg(feature = "debug-probe")]
210-
fn rustc_probe_debug() -> bool {
211-
fn is_falsy(mut s: OsString) -> bool {
212-
if s.len() <= 5 {
213-
s.make_ascii_lowercase();
214-
s.is_empty() || s == "0" || s == "false" || s == "no" || s == "off"
215-
} else {
216-
// otherwise it's too long to be a falsy value and a waste to lowercase
217-
false
218-
}
219-
}
220-
221-
println!("cargo:rerun-if-env-changed=RUSTC_PROBE_KEEP_PROBE");
222-
match std::env::var_os("RUSTC_PROBE_KEEP_PROBE") {
223-
Some(v) => !is_falsy(v),
224-
None => false,
225-
}
226-
}
227-
228-
#[cfg(feature = "debug-probe")]
229-
fn write_command(out: &mut impl Write, cmd: &Command) -> fmt::Result {
230-
writeln!(out, "Running RUSTC command:")?;
231-
if let Some(cwd) = cmd.get_current_dir() {
232-
writeln!(out, " cwd : {}", cwd.display())?;
233-
} else if let Ok(cwd) = std::env::current_dir() {
234-
writeln!(out, " cwd : {}", cwd.display())?;
235-
} else {
236-
writeln!(out, " cwd : <unknown>")?;
237-
}
238-
239-
writeln!(out, " prog: {}", cmd.get_program().display())?;
240-
241-
let mut args = cmd.get_args();
242-
if let Some(arg) = args.next() {
243-
writeln!(out, " args: - {}", arg.display())?;
244-
for arg in args {
245-
writeln!(out, " - {}", arg.display())?;
246-
}
247-
} else {
248-
writeln!(out, " args: <none>")?;
249-
}
250-
251-
let mut envs = cmd.get_envs();
252-
if let Some((env, opt)) = envs.next() {
253-
if let Some(value) = opt {
254-
writeln!(out, " env : {}={}", env.display(), value.display())?;
255-
} else {
256-
writeln!(out, " env : {}=<removed>", env.display())?;
257-
}
258-
259-
for (env, opt) in envs {
260-
if let Some(value) = opt {
261-
writeln!(out, " {}={}", env.display(), value.display())?;
262-
} else {
263-
writeln!(out, " {}=<removed>", env.display())?;
264-
}
265-
}
266-
} else {
267-
writeln!(out, " env : <none>")?;
268-
}
269-
270-
Ok(())
271-
}

0 commit comments

Comments
 (0)