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.
···11-{ runCommand }:
11+{
22+ lib,
33+ stdenv,
44+ runCommand,
55+ getent,
66+ xcbuild,
77+}:
2839# Prints information about the state of the build environment for
410# assistance debugging Hydra. Feel free to add anything you would find
511# useful to this.
66-runCommand "build-environment-info" { } ''
77- ulimit -a
1212+runCommand "build-environment-info"
1313+ {
1414+ nativeBuildInputs = [ getent ] ++ lib.optionals stdenv.buildPlatform.isDarwin [ xcbuild ];
1515+ }
1616+ ''
1717+ # It’s useful to get more info even if a command fails.
1818+ set +e
81999- # Always fail so that this job can easily be restarted.
1010- exit 1
1111-''
2020+ run() {
2121+ echoCmd : "$@"
2222+ "$@"
2323+ }
2424+2525+ run uname -a
2626+2727+ ${lib.optionalString stdenv.buildPlatform.isDarwin ''
2828+ run env SYSTEM_VERSION_COMPAT=0 plutil -p /System/Library/CoreServices/SystemVersion.plist
2929+ ''}
3030+3131+ run id
3232+3333+ run getent passwd "$(id -un)"
3434+3535+ run ulimit -a
3636+3737+ # Always fail so that this job can easily be restarted.
3838+ run exit 1
3939+ ''