Loading pkgs/by-name/ca/cargo-bisect-rustc/0001-dynamically-patchelf-binaries.patch +16 −10 Original line number Diff line number Diff line diff --git a/src/toolchains.rs b/src/toolchains.rs index 53a7ddb..795a711 100644 index a4be8cdcfe..b3e4dc3cee 100644 --- a/src/toolchains.rs +++ b/src/toolchains.rs @@ -206,6 +206,8 @@ impl Toolchain { @@ -208,7 +208,9 @@ })?; } + nix_patchelf(tmpdir.path().to_path_buf()) + .expect("failed to patch toolchain for NixOS"); fs::rename(tmpdir.into_path(), dest).map_err(InstallError::Move) - fs::rename(tmpdir.keep(), dest).map_err(InstallError::Move) + let tmpdir = tmpdir.keep(); + nix_patchelf(tmpdir.clone()).expect("failed to patch toolchain for NixOS"); + fs::rename(tmpdir, dest).map_err(InstallError::Move) } @@ -533,3 +535,42 @@ fn download_tarball( pub(crate) fn remove(&self, dl_params: &DownloadParams) -> io::Result<()> { @@ -564,3 +566,46 @@ res => res, } } Loading @@ -25,8 +27,10 @@ index 53a7ddb..795a711 100644 + continue; + } + + eprintln!("info: you seem to be running NixOS. Attempting to patch {}", + entry.path().to_str().unwrap()); + eprintln!( + "info: you seem to be running NixOS. Attempting to patch {}", + entry.path().to_str().unwrap() + ); + let _ = ::std::process::Command::new("@patchelf@/bin/patchelf") + .arg("--set-interpreter") + .arg("@dynamicLinker@") Loading @@ -43,8 +47,10 @@ index 53a7ddb..795a711 100644 + continue; + } + + eprintln!("info: you seem to be running NixOS. Attempting to patch {}", + entry.path().to_str().unwrap()); + eprintln!( + "info: you seem to be running NixOS. Attempting to patch {}", + entry.path().to_str().unwrap() + ); + let _ = ::std::process::Command::new("@patchelf@/bin/patchelf") + .arg("--set-rpath") + .arg("@libPath@") Loading pkgs/by-name/ca/cargo-bisect-rustc/package.nix +10 −4 Original line number Diff line number Diff line Loading @@ -8,17 +8,18 @@ runCommand, patchelf, zlib, nix-update-script, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "cargo-bisect-rustc"; version = "0.6.8"; version = "0.6.11"; src = fetchFromGitHub { owner = "rust-lang"; repo = "cargo-bisect-rustc"; rev = "v${finalAttrs.version}"; hash = "sha256-7HiM1oRuLSfRaum66duag/w8ncFdxRLF0yeSGlIey0Y="; hash = "sha256-uyIdQn9EQnjBAHBPqvphaKg2KRufveOXOiHEKk0fTGQ="; }; patches = Loading @@ -44,12 +45,17 @@ rustPlatform.buildRustPackage (finalAttrs: { buildInputs = [ openssl ]; cargoHash = "sha256-SigRm2ZC7jH1iCEGRpka1G/e9kBEieFVU0YDBl2LfTM="; cargoHash = "sha256-WSO5LvdJkAorSwsICz9NAWKNM7x4aeNvhGLhJSO6Vi8="; checkFlags = [ "--skip=test_github" # requires internet "--skip=cli_tests" # trycmd does not seem to work in nix's sandbox ]; passthru = { updateScript = nix-update-script { }; }; meta = { description = "Bisects rustc, either nightlies or CI artifacts"; mainProgram = "cargo-bisect-rustc"; Loading @@ -58,6 +64,6 @@ rustPlatform.buildRustPackage (finalAttrs: { asl20 mit ]; maintainers = [ ]; maintainers = with lib.maintainers; [ sandarukasa ]; }; }) Loading
pkgs/by-name/ca/cargo-bisect-rustc/0001-dynamically-patchelf-binaries.patch +16 −10 Original line number Diff line number Diff line diff --git a/src/toolchains.rs b/src/toolchains.rs index 53a7ddb..795a711 100644 index a4be8cdcfe..b3e4dc3cee 100644 --- a/src/toolchains.rs +++ b/src/toolchains.rs @@ -206,6 +206,8 @@ impl Toolchain { @@ -208,7 +208,9 @@ })?; } + nix_patchelf(tmpdir.path().to_path_buf()) + .expect("failed to patch toolchain for NixOS"); fs::rename(tmpdir.into_path(), dest).map_err(InstallError::Move) - fs::rename(tmpdir.keep(), dest).map_err(InstallError::Move) + let tmpdir = tmpdir.keep(); + nix_patchelf(tmpdir.clone()).expect("failed to patch toolchain for NixOS"); + fs::rename(tmpdir, dest).map_err(InstallError::Move) } @@ -533,3 +535,42 @@ fn download_tarball( pub(crate) fn remove(&self, dl_params: &DownloadParams) -> io::Result<()> { @@ -564,3 +566,46 @@ res => res, } } Loading @@ -25,8 +27,10 @@ index 53a7ddb..795a711 100644 + continue; + } + + eprintln!("info: you seem to be running NixOS. Attempting to patch {}", + entry.path().to_str().unwrap()); + eprintln!( + "info: you seem to be running NixOS. Attempting to patch {}", + entry.path().to_str().unwrap() + ); + let _ = ::std::process::Command::new("@patchelf@/bin/patchelf") + .arg("--set-interpreter") + .arg("@dynamicLinker@") Loading @@ -43,8 +47,10 @@ index 53a7ddb..795a711 100644 + continue; + } + + eprintln!("info: you seem to be running NixOS. Attempting to patch {}", + entry.path().to_str().unwrap()); + eprintln!( + "info: you seem to be running NixOS. Attempting to patch {}", + entry.path().to_str().unwrap() + ); + let _ = ::std::process::Command::new("@patchelf@/bin/patchelf") + .arg("--set-rpath") + .arg("@libPath@") Loading
pkgs/by-name/ca/cargo-bisect-rustc/package.nix +10 −4 Original line number Diff line number Diff line Loading @@ -8,17 +8,18 @@ runCommand, patchelf, zlib, nix-update-script, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "cargo-bisect-rustc"; version = "0.6.8"; version = "0.6.11"; src = fetchFromGitHub { owner = "rust-lang"; repo = "cargo-bisect-rustc"; rev = "v${finalAttrs.version}"; hash = "sha256-7HiM1oRuLSfRaum66duag/w8ncFdxRLF0yeSGlIey0Y="; hash = "sha256-uyIdQn9EQnjBAHBPqvphaKg2KRufveOXOiHEKk0fTGQ="; }; patches = Loading @@ -44,12 +45,17 @@ rustPlatform.buildRustPackage (finalAttrs: { buildInputs = [ openssl ]; cargoHash = "sha256-SigRm2ZC7jH1iCEGRpka1G/e9kBEieFVU0YDBl2LfTM="; cargoHash = "sha256-WSO5LvdJkAorSwsICz9NAWKNM7x4aeNvhGLhJSO6Vi8="; checkFlags = [ "--skip=test_github" # requires internet "--skip=cli_tests" # trycmd does not seem to work in nix's sandbox ]; passthru = { updateScript = nix-update-script { }; }; meta = { description = "Bisects rustc, either nightlies or CI artifacts"; mainProgram = "cargo-bisect-rustc"; Loading @@ -58,6 +64,6 @@ rustPlatform.buildRustPackage (finalAttrs: { asl20 mit ]; maintainers = [ ]; maintainers = with lib.maintainers; [ sandarukasa ]; }; })