nixpkgs-suyu/nixos/tests/nix-ld.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
607 B
Nix
Raw Normal View History

2022-03-15 13:22:18 +01:00
import ./make-test-python.nix ({ lib, pkgs, ...} :
{
name = "nix-ld";
nodes.machine = { pkgs, ... }: {
programs.nix-ld.enable = true;
environment.systemPackages = [
(pkgs.runCommand "patched-hello" {} ''
install -D -m755 ${pkgs.hello}/bin/hello $out/bin/hello
2022-05-14 17:02:37 +02:00
patchelf $out/bin/hello --set-interpreter $(cat ${pkgs.nix-ld}/nix-support/ldpath)
2022-03-15 13:22:18 +01:00
'')
];
};
testScript = ''
start_all()
path = "${pkgs.stdenv.cc}/nix-support/dynamic-linker"
with open(path) as f:
real_ld = f.read().strip()
machine.succeed(f"NIX_LD={real_ld} hello")
'';
})