rust/0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch
2023-07-20 16:52:36 -07:00

61 lines
2.9 KiB
Diff

From 9204a8359201271fd7b1c625d6f29ddd095a419d Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Mon, 10 Jul 2023 13:48:49 -0700
Subject: [PATCH] Revert "Fix `x test lint-docs` when download-rustc is
enabled"
This reverts commit abf9cbcb69e485b56776112bc587f6166e7ac5c9.
---
src/tools/lint-docs/src/groups.rs | 3 +--
src/tools/lint-docs/src/lib.rs | 9 ---------
2 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/src/tools/lint-docs/src/groups.rs b/src/tools/lint-docs/src/groups.rs
index b11fb287cf4d..2a923a61b0a7 100644
--- a/src/tools/lint-docs/src/groups.rs
+++ b/src/tools/lint-docs/src/groups.rs
@@ -39,12 +39,11 @@ pub(crate) fn generate_group_docs(&self, lints: &[Lint]) -> Result<(), Box<dyn E
fn collect_groups(&self) -> Result<LintGroups, Box<dyn Error>> {
let mut result = BTreeMap::new();
let mut cmd = Command::new(self.rustc_path);
- cmd.env_remove("LD_LIBRARY_PATH");
cmd.arg("-Whelp");
let output = cmd.output().map_err(|e| format!("failed to run command {:?}\n{}", cmd, e))?;
if !output.status.success() {
return Err(format!(
- "failed to collect lint info: failed to run {cmd:?}: {:?}\n--- stderr\n{}--- stdout\n{}\n",
+ "failed to collect lint info: {:?}\n--- stderr\n{}--- stdout\n{}\n",
output.status,
std::str::from_utf8(&output.stderr).unwrap(),
std::str::from_utf8(&output.stdout).unwrap(),
diff --git a/src/tools/lint-docs/src/lib.rs b/src/tools/lint-docs/src/lib.rs
index fe29b9abda39..034c6aa0708e 100644
--- a/src/tools/lint-docs/src/lib.rs
+++ b/src/tools/lint-docs/src/lib.rs
@@ -403,12 +403,6 @@ fn generate_lint_output(
fs::write(&tempfile, source)
.map_err(|e| format!("failed to write {}: {}", tempfile.display(), e))?;
let mut cmd = Command::new(self.rustc_path);
- // NOTE: bootstrap sets `LD_LIBRARY_PATH` for building lint-docs itself.
- // Unfortunately, lint-docs is a bootstrap tool while rustc is built from source,
- // and sometimes the paths conflict. In particular, when using `download-rustc`,
- // the LLVM versions can differ between `ci-llvm` and `ci-rustc-sysroot`.
- // Unset LD_LIBRARY_PATH here so it doesn't interfere with running the compiler.
- cmd.env_remove("LD_LIBRARY_PATH");
if options.contains(&"edition2015") {
cmd.arg("--edition=2015");
} else {
@@ -421,9 +415,6 @@ fn generate_lint_output(
}
cmd.arg("lint_example.rs");
cmd.current_dir(tempdir.path());
- if self.verbose {
- eprintln!("running: {cmd:?}");
- }
let output = cmd.output().map_err(|e| format!("failed to run command {:?}\n{}", cmd, e))?;
let stderr = std::str::from_utf8(&output.stderr).unwrap();
let msgs = stderr
--
2.41.0