nixosTests.nixseparatedebuginfod: fix test
nix is not built with separateDebuginfo set to true anymore. Let's use gnumake instead.
This commit is contained in:
@@ -5,7 +5,7 @@ let
|
||||
in
|
||||
{
|
||||
name = "nixseparatedebuginfod";
|
||||
# A binary cache with debug info and source for nix
|
||||
# A binary cache with debug info and source for gnumake
|
||||
nodes.cache =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
@@ -15,8 +15,8 @@ in
|
||||
openFirewall = true;
|
||||
};
|
||||
system.extraDependencies = [
|
||||
pkgs.nix.debug
|
||||
pkgs.nix.src
|
||||
pkgs.gnumake.debug
|
||||
pkgs.gnumake.src
|
||||
pkgs.sl
|
||||
];
|
||||
};
|
||||
@@ -33,9 +33,10 @@ in
|
||||
environment.systemPackages = [
|
||||
pkgs.valgrind
|
||||
pkgs.gdb
|
||||
pkgs.gnumake
|
||||
(pkgs.writeShellScriptBin "wait_for_indexation" ''
|
||||
set -x
|
||||
while debuginfod-find debuginfo /run/current-system/sw/bin/nix |& grep 'File too large'; do
|
||||
while debuginfod-find debuginfo /run/current-system/sw/bin/make |& grep 'File too large'; do
|
||||
sleep 1;
|
||||
done
|
||||
'')
|
||||
@@ -56,27 +57,27 @@ in
|
||||
|
||||
# nixseparatedebuginfod needs .drv to associate executable -> source
|
||||
# on regular systems this would be provided by nixos-rebuild
|
||||
machine.succeed("nix-instantiate '<nixpkgs>' -A nix")
|
||||
machine.succeed("nix-instantiate '<nixpkgs>' -A gnumake")
|
||||
|
||||
machine.succeed("timeout 600 wait_for_indexation")
|
||||
|
||||
# test debuginfod-find
|
||||
machine.succeed("debuginfod-find debuginfo /run/current-system/sw/bin/nix")
|
||||
machine.succeed("debuginfod-find debuginfo /run/current-system/sw/bin/make")
|
||||
|
||||
# test that gdb can fetch source
|
||||
out = machine.succeed("gdb /run/current-system/sw/bin/nix --batch -x ${builtins.toFile "commands" ''
|
||||
out = machine.succeed("gdb /run/current-system/sw/bin/make --batch -x ${builtins.toFile "commands" ''
|
||||
start
|
||||
l
|
||||
''}")
|
||||
print(out)
|
||||
assert 'int main(' in out
|
||||
assert 'main (int argc, char **argv, char **envp)' in out
|
||||
|
||||
# test that valgrind can display location information
|
||||
# this relies on the fact that valgrind complains about nix
|
||||
# libgc helps in this regard, and we also ask valgrind to show leak kinds
|
||||
# this relies on the fact that valgrind complains about gnumake
|
||||
# because we also ask valgrind to show leak kinds
|
||||
# which are usually false positives.
|
||||
out = machine.succeed("valgrind --leak-check=full --show-leak-kinds=all nix-env --version 2>&1")
|
||||
out = machine.succeed("valgrind --leak-check=full --show-leak-kinds=all make --version 2>&1")
|
||||
print(out)
|
||||
assert 'main.cc' in out
|
||||
assert 'main.c' in out
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user