Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
diff --git a/src/portable/server/install.rs b/src/portable/server/install.rs
|
|
index feb47f1..157d17a 100644
|
|
--- a/src/portable/server/install.rs
|
|
+++ b/src/portable/server/install.rs
|
|
@@ -229,8 +229,16 @@ fn unpack_package(cache_file: &Path, target_dir: &Path) -> anyhow::Result<()> {
|
|
for entry in arch.entries()? {
|
|
let mut entry = entry?;
|
|
let path = entry.path()?;
|
|
+ let is_inside_bin = {
|
|
+ let mut path_iter = path.iter();
|
|
+ path_iter.next(); // discards first path
|
|
+ path_iter.as_path().starts_with("bin")
|
|
+ };
|
|
if let Some(path) = build_path(&target_dir, &path)? {
|
|
- entry.unpack(path)?;
|
|
+ entry.unpack(&path)?;
|
|
+ if is_inside_bin {
|
|
+ nix_patchelf_if_needed(&path);
|
|
+ }
|
|
}
|
|
}
|
|
bar.finish_and_clear();
|
|
@@ -244,3 +252,12 @@ fn unlink_cache(cache_file: &Path) {
|
|
})
|
|
.ok();
|
|
}
|
|
+
|
|
+fn nix_patchelf_if_needed(dest_path: &Path) {
|
|
+ let _ = ::std::process::Command::new("@patchelf@/bin/patchelf")
|
|
+ .arg("--set-interpreter")
|
|
+ .arg("@dynamicLinker@")
|
|
+ .arg(dest_path)
|
|
+ .output();
|
|
+}
|
|
+
|