Skip to content

Commit 101fa90

Browse files
committed
Auto merge of rust-lang#112282 - matthiaskrgr:rollup-1g9w02p, r=matthiaskrgr
Rollup of 3 pull requests Successful merges: - rust-lang#112247 (rust-lld: add rpath entry to the correct `lib` folder) - rust-lang#112274 (Migrate GUI colors test to original CSS color format) - rust-lang#112277 (Don't require the output from libtest to be valid UTF-8) Failed merges: - rust-lang#112251 (rustdoc: convert `if let Some()` that always matches to variable) r? `@ghost` `@rustbot` modify labels: rollup
2 parents dc25fbe + 0716ac9 commit 101fa90

File tree

4 files changed

+38
-12
lines changed

4 files changed

+38
-12
lines changed

src/bootstrap/llvm.rs

+25
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,31 @@ impl Step for Lld {
834834
}
835835
}
836836

837+
// LLD is built as an LLVM tool, but is distributed outside of the `llvm-tools` component,
838+
// which impacts where it expects to find LLVM's shared library. This causes #80703.
839+
//
840+
// LLD is distributed at "$root/lib/rustlib/$host/bin/rust-lld", but the `libLLVM-*.so` it
841+
// needs is distributed at "$root/lib". The default rpath of "$ORIGIN/../lib" points at the
842+
// lib path for LLVM tools, not the one for rust binaries.
843+
//
844+
// (The `llvm-tools` component copies the .so there for the other tools, and with that
845+
// component installed, one can successfully invoke `rust-lld` directly without rustup's
846+
// `LD_LIBRARY_PATH` overrides)
847+
//
848+
if builder.config.rpath_enabled(target)
849+
&& util::use_host_linker(target)
850+
&& builder.config.llvm_link_shared()
851+
&& target.contains("linux")
852+
{
853+
// So we inform LLD where it can find LLVM's libraries by adding an rpath entry to the
854+
// expected parent `lib` directory.
855+
//
856+
// Be careful when changing this path, we need to ensure it's quoted or escaped:
857+
// `$ORIGIN` would otherwise be expanded when the `LdFlags` are passed verbatim to
858+
// cmake.
859+
ldflags.push_all("-Wl,-rpath,'$ORIGIN/../../../'");
860+
}
861+
837862
configure_cmake(builder, target, &mut cfg, true, ldflags, &[]);
838863
configure_llvm(builder, target, &mut cfg);
839864

src/bootstrap/render_tests.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ impl<'a> Renderer<'a> {
8888
}
8989

9090
fn render_all(mut self) {
91-
let mut line = String::new();
91+
let mut line = Vec::new();
9292
loop {
9393
line.clear();
94-
match self.stdout.read_line(&mut line) {
94+
match self.stdout.read_until(b'\n', &mut line) {
9595
Ok(_) => {}
9696
Err(err) if err.kind() == std::io::ErrorKind::UnexpectedEof => break,
9797
Err(err) => panic!("failed to read output of test runner: {err}"),
@@ -100,12 +100,13 @@ impl<'a> Renderer<'a> {
100100
break;
101101
}
102102

103-
match serde_json::from_str(&line) {
103+
match serde_json::from_slice(&line) {
104104
Ok(parsed) => self.render_message(parsed),
105105
Err(_err) => {
106106
// Handle non-JSON output, for example when --nocapture is passed.
107-
print!("{line}");
108-
let _ = std::io::stdout().flush();
107+
let mut stdout = std::io::stdout();
108+
stdout.write_all(&line).unwrap();
109+
let _ = stdout.flush();
109110
}
110111
}
111112
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.16.5
1+
0.16.6

tests/rustdoc-gui/sidebar-mobile.goml

+6-6
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ define-function: (
7373

7474
call-function: ("check-colors", {
7575
"theme": "ayu",
76-
"color": "rgb(197, 197, 197)",
77-
"background": "rgb(20, 25, 31)",
76+
"color": "#c5c5c5",
77+
"background": "#14191f",
7878
})
7979
call-function: ("check-colors", {
8080
"theme": "dark",
81-
"color": "rgb(221, 221, 221)",
82-
"background": "rgb(80, 80, 80)",
81+
"color": "#ddd",
82+
"background": "#505050",
8383
})
8484
call-function: ("check-colors", {
8585
"theme": "light",
86-
"color": "rgb(0, 0, 0)",
87-
"background": "rgb(245, 245, 245)",
86+
"color": "black",
87+
"background": "#F5F5F5",
8888
})

0 commit comments

Comments
 (0)