Rollup merge of #97041 - eddyb:nixos-llvm-ci-patchelf, r=Mark-Simulacrum
Fix `download-ci-llvm` NixOS patching for `.so`s. See https://github.com/rust-lang/rust/pull/95170#discussion_r872960686 - in short, `Path::ends_with` doesn't do the same thing as `str::ends_with`, and can only be used to check for whole file names, not extensions. With this PR, I get the full suite of: ``` extracting /home/eddy/Projects/rust-A/build/cache/llvm-ebb80ec4e90f8622440f3e33562db0d6e6c66555-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /home/eddy/Projects/rust-A/build/x86_64-unknown-linux-gnu/ci-llvm info: you seem to be using Nix. Attempting to patch /home/eddy/Projects/rust-A/build/x86_64-unknown-linux-gnu/ci-llvm/bin/llvm-config /nix/store/r4bzq2xilvv8fmqjg626hzwi22ah3hf4-rust-stage0-dependencies info: you seem to be using Nix. Attempting to patch /home/eddy/Projects/rust-A/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck info: you seem to be using Nix. Attempting to patch /home/eddy/Projects/rust-A/build/x86_64-unknown-linux-gnu/ci-llvm/lib/libLLVM-14-rust-1.62.0-nightly.so ``` (that `libLLVM-14-rust-1.62.0-nightly.so` at the end having been missing before) r? `@Mark-Simulacrum` cc `@jyn514`
This commit is contained in:
commit
a37ba96868
@ -156,7 +156,7 @@ pub(crate) fn maybe_download_ci_llvm(builder: &Builder<'_>) {
|
||||
let llvm_lib = llvm_root.join("lib");
|
||||
for entry in t!(fs::read_dir(&llvm_lib)) {
|
||||
let lib = t!(entry).path();
|
||||
if lib.ends_with(".so") {
|
||||
if lib.extension().map_or(false, |ext| ext == "so") {
|
||||
fix_bin_or_dylib(builder, &lib);
|
||||
}
|
||||
}
|
||||
@ -284,7 +284,7 @@ fn fix_bin_or_dylib(builder: &Builder<'_>, fname: &Path) {
|
||||
entries
|
||||
};
|
||||
patchelf.args(&[OsString::from("--set-rpath"), rpath_entries]);
|
||||
if !fname.ends_with(".so") {
|
||||
if !fname.extension().map_or(false, |ext| ext == "so") {
|
||||
// Finally, set the corret .interp for binaries
|
||||
let dynamic_linker_path = nix_deps_dir.join("nix-support/dynamic-linker");
|
||||
// FIXME: can we support utf8 here? `args` doesn't accept Vec<u8>, only OsString ...
|
||||
|
Loading…
x
Reference in New Issue
Block a user