diff options
| author | Eduard-Mihai Burtescu <eddyb@lyken.rs> | 2022-05-14 10:07:47 +0000 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <eddyb@lyken.rs> | 2022-05-14 10:08:02 +0000 |
| commit | f38555c3b3a39b75e9016897f405c795c5afdf18 (patch) | |
| tree | afbe83505c2e6c41988f3672811630c4bc42d125 | |
| parent | c31879922e6ec8200eee6c144073eafcc4a73e38 (diff) | |
| download | rust-f38555c3b3a39b75e9016897f405c795c5afdf18.tar.gz rust-f38555c3b3a39b75e9016897f405c795c5afdf18.zip | |
Fix `download-ci-llvm` NixOS patching for `.so`s.
| -rw-r--r-- | src/bootstrap/native.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 64e25f803b2..72b7f5f6612 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -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 ... |
