From ca350c84aebd3d42f4bc7fc9e59331000fdf9b7e Mon Sep 17 00:00:00 2001 From: Samuel Balco Date: Thu, 16 Nov 2023 16:28:27 +0000 Subject: [PATCH] Fix llvm backend bins in the k derivation (#3819) The refactor of the K derivation in #3806 broke the booster integration test shell, because we stopped wrapping llvm-backend bins with the `NIX_LLVM_KOMPILE_LIBS` env var. This PR restores that functionality and I have confirmed this fixes the integration tests in booster. --- nix/k.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nix/k.nix b/nix/k.nix index 10920617e40..7adedd785e8 100644 --- a/nix/k.nix +++ b/nix/k.nix @@ -55,7 +55,6 @@ let ln -sf ${llvm-backend}/include/kllvm-c $out/include/ ln -sf ${llvm-backend}/lib/kllvm $out/lib/ ln -sf ${llvm-backend}/lib/scripts $out/lib/ - ln -sf ${llvm-backend}/bin/* $out/bin/ ln -sf ${haskell-backend}/bin/kore-rpc $out/bin/kore-rpc ln -sf ${haskell-backend}/bin/kore-exec $out/bin/kore-exec @@ -80,6 +79,18 @@ let }"'' } done + + ${if (current-llvm-kompile-libs == [ ]) then '' + ln -sf ${llvm-backend}/bin/* $out/bin/ + '' else '' + for prog in ${llvm-backend}/bin/* + do + makeWrapper $prog $out/bin/$(basename $prog) \ + --set NIX_LLVM_KOMPILE_LIBS "${ + lib.strings.concatStringsSep " " + (lib.lists.unique current-llvm-kompile-libs) + }" + done''} ''; preFixup = lib.optionalString (!stdenv.isDarwin) ''