1{
2 lib,
3 stdenv,
4 runCommand,
5 getent,
6 xcbuild,
7}:
8
9# Prints information about the state of the build environment for
10# assistance debugging Hydra. Feel free to add anything you would find
11# useful to this.
12runCommand "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
19
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 ''