Skip to content

Commit 7ac9c12

Browse files
committed
Fix demo seed Killed: 9 error on macos
1 parent 9b1b211 commit 7ac9c12

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

nix/hydra/packages.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
# stdenv as the original drv (important to determine targetPlatform).
3131
drv.stdenv.mkDerivation {
3232
name = "${exe}";
33-
phases = [ "buildPhase" ];
33+
buildInputs = [ pkgs.cctools ];
34+
phases = [ "buildPhase" "postFixup" ];
3435
buildPhase = ''
3536
set -e
3637
@@ -46,6 +47,13 @@
4647
sed 's/${placeholder}/${rev}/' ${drv}/bin/${exe} > $out/bin/${exe}
4748
chmod +x $out/bin/${exe}
4849
'';
50+
postFixup = ''
51+
install_name_tool -add_rpath ${pkgs.zlib}/lib $out/bin/${exe}
52+
install_name_tool -add_rpath ${pkgs.lmdb}/lib $out/bin/${exe}
53+
install_name_tool -add_rpath ${pkgs.libcxx}/lib $out/bin/${exe}
54+
install_name_tool -add_rpath ${pkgs.libiconv}/lib $out/bin/${exe}
55+
install_name_tool -add_rpath ${pkgs.libffi}/lib $out/bin/${exe}
56+
'';
4957
};
5058

5159
nativePkgs = hsPkgs;

nix/hydra/project.nix

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@
4545
hydra-tx.writeHieFiles = true;
4646
hydra-tui.writeHieFiles = true;
4747
hydraw.writeHieFiles = true;
48-
hydra-node.dontStrip = false;
49-
hydra-tui.dontStrip = false;
50-
hydraw.dontStrip = false;
48+
# NOTE: This is needed to fix the "Killed: 9" error on macOS aarch64
49+
# where the executable is being killed by the OS.
50+
# See also: https://github.com/NixOS/nixpkgs/issues/112296
51+
hydra-node.dontStrip = true;
52+
hydra-tui.dontStrip = true;
53+
hydraw.dontStrip = true;
5154
};
5255
}
5356
# Use different static libs on darwin
@@ -90,6 +93,11 @@
9093
{
9194
packages.hydra-node.components.library.build-tools = [ pkgs.etcd ];
9295
}
96+
{
97+
packages.hydra-node.components.exes.hydra-node.preCheck = ''
98+
export HOME=$(mktemp -d)
99+
'';
100+
}
93101
];
94102
};
95103

0 commit comments

Comments
 (0)