File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,12 @@ impl<'a> LintExtractor<'a> {
39
39
fn collect_groups ( & self ) -> Result < LintGroups , Box < dyn Error > > {
40
40
let mut result = BTreeMap :: new ( ) ;
41
41
let mut cmd = Command :: new ( self . rustc_path ) ;
42
+ cmd. env_remove ( "LD_LIBRARY_PATH" ) ;
42
43
cmd. arg ( "-Whelp" ) ;
43
44
let output = cmd. output ( ) . map_err ( |e| format ! ( "failed to run command {:?}\n {}" , cmd, e) ) ?;
44
45
if !output. status . success ( ) {
45
46
return Err ( format ! (
46
- "failed to collect lint info: {:?}\n --- stderr\n {}--- stdout\n {}\n " ,
47
+ "failed to collect lint info: failed to run {cmd:?}: {:?}\n --- stderr\n {}--- stdout\n {}\n " ,
47
48
output. status,
48
49
std:: str :: from_utf8( & output. stderr) . unwrap( ) ,
49
50
std:: str :: from_utf8( & output. stdout) . unwrap( ) ,
Original file line number Diff line number Diff line change @@ -403,6 +403,12 @@ impl<'a> LintExtractor<'a> {
403
403
fs:: write ( & tempfile, source)
404
404
. map_err ( |e| format ! ( "failed to write {}: {}" , tempfile. display( ) , e) ) ?;
405
405
let mut cmd = Command :: new ( self . rustc_path ) ;
406
+ // NOTE: bootstrap sets `LD_LIBRARY_PATH` for building lint-docs itself.
407
+ // Unfortunately, lint-docs is a bootstrap tool while rustc is built from source,
408
+ // and sometimes the paths conflict. In particular, when using `download-rustc`,
409
+ // the LLVM versions can differ between `ci-llvm` and `ci-rustc-sysroot`.
410
+ // Unset LD_LIBRARY_PATH here so it doesn't interfere with running the compiler.
411
+ cmd. env_remove ( "LD_LIBRARY_PATH" ) ;
406
412
if options. contains ( & "edition2015" ) {
407
413
cmd. arg ( "--edition=2015" ) ;
408
414
} else {
@@ -415,6 +421,9 @@ impl<'a> LintExtractor<'a> {
415
421
}
416
422
cmd. arg ( "lint_example.rs" ) ;
417
423
cmd. current_dir ( tempdir. path ( ) ) ;
424
+ if self . verbose {
425
+ eprintln ! ( "running: {cmd:?}" ) ;
426
+ }
418
427
let output = cmd. output ( ) . map_err ( |e| format ! ( "failed to run command {:?}\n {}" , cmd, e) ) ?;
419
428
let stderr = std:: str:: from_utf8 ( & output. stderr ) . unwrap ( ) ;
420
429
let msgs = stderr
You can’t perform that action at this time.
0 commit comments