From 9f36206578abde5ab43e512916a2099b290df88a Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 28 Oct 2024 13:32:39 +0000 Subject: [PATCH] tests.build-environment-info: add more information The user information would have helped diagnose the empty GECOS issue we had with the Hydra Darwin builders recently and the OS information seems generally nice to have. --- pkgs/test/build-environment-info/default.nix | 40 +++++++++++++++++--- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/pkgs/test/build-environment-info/default.nix b/pkgs/test/build-environment-info/default.nix index f0c71d8d1eaf..dce91edbf4d1 100644 --- a/pkgs/test/build-environment-info/default.nix +++ b/pkgs/test/build-environment-info/default.nix @@ -1,11 +1,39 @@ -{ runCommand }: +{ + lib, + stdenv, + runCommand, + getent, + xcbuild, +}: # Prints information about the state of the build environment for # assistance debugging Hydra. Feel free to add anything you would find # useful to this. -runCommand "build-environment-info" { } '' - ulimit -a +runCommand "build-environment-info" + { + nativeBuildInputs = [ getent ] ++ lib.optionals stdenv.buildPlatform.isDarwin [ xcbuild ]; + } + '' + # It’s useful to get more info even if a command fails. + set +e - # Always fail so that this job can easily be restarted. - exit 1 -'' + run() { + echoCmd : "$@" + "$@" + } + + run uname -a + + ${lib.optionalString stdenv.buildPlatform.isDarwin '' + run env SYSTEM_VERSION_COMPAT=0 plutil -p /System/Library/CoreServices/SystemVersion.plist + ''} + + run id + + run getent passwd "$(id -un)" + + run ulimit -a + + # Always fail so that this job can easily be restarted. + run exit 1 + ''