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.

Emily 9f362065 f28cc72d

+34 -6
+34 -6
pkgs/test/build-environment-info/default.nix
··· 1 - { runCommand }: 1 + { 2 + lib, 3 + stdenv, 4 + runCommand, 5 + getent, 6 + xcbuild, 7 + }: 2 8 3 9 # Prints information about the state of the build environment for 4 10 # assistance debugging Hydra. Feel free to add anything you would find 5 11 # useful to this. 6 - runCommand "build-environment-info" { } '' 7 - ulimit -a 12 + runCommand "build-environment-info" 13 + { 14 + nativeBuildInputs = [ getent ] ++ lib.optionals stdenv.buildPlatform.isDarwin [ xcbuild ]; 15 + } 16 + '' 17 + # It’s useful to get more info even if a command fails. 18 + set +e 8 19 9 - # Always fail so that this job can easily be restarted. 10 - exit 1 11 - '' 20 + run() { 21 + echoCmd : "$@" 22 + "$@" 23 + } 24 + 25 + run uname -a 26 + 27 + ${lib.optionalString stdenv.buildPlatform.isDarwin '' 28 + run env SYSTEM_VERSION_COMPAT=0 plutil -p /System/Library/CoreServices/SystemVersion.plist 29 + ''} 30 + 31 + run id 32 + 33 + run getent passwd "$(id -un)" 34 + 35 + run ulimit -a 36 + 37 + # Always fail so that this job can easily be restarted. 38 + run exit 1 39 + ''