···35};
36```
37000000000000000000000000000000000000000000000000000000000000000038## `testEqualDerivation` {#tester-testEqualDerivation}
3940Checks that two packages produce the exact same build instructions.
···35};
36```
3738+## `testBuildFailure` {#tester-testBuildFailure}
39+40+Make sure that a build does not succeed. This is useful for testing testers.
41+42+This returns a derivation with an override on the builder, with the following effects:
43+44+ - Fail the build when the original builder succeeds
45+ - Move `$out` to `$out/result`, if it exists (assuming `out` is the default output)
46+ - Save the build log to `$out/testBuildFailure.log` (same)
47+48+Example:
49+50+```nix
51+runCommand "example" {
52+ failed = testers.testBuildFailure (runCommand "fail" {} ''
53+ echo ok-ish >$out
54+ echo failing though
55+ exit 3
56+ '');
57+} ''
58+ grep -F 'ok-ish' $failed/result
59+ grep -F 'failing though' $failed/testBuildFailure.log
60+ [[ 3 = $(cat $failed/testBuildFailure.exit) ]]
61+ touch $out
62+'';
63+```
64+65+While `testBuildFailure` is designed to keep changes to the original builder's
66+environment to a minimum, some small changes are inevitable.
67+68+ - The file `$TMPDIR/testBuildFailure.log` is present. It should not be deleted.
69+ - `stdout` and `stderr` are a pipe instead of a tty. This could be improved.
70+ - One or two extra processes are present in the sandbox during the original
71+ builder's execution.
72+ - The derivation and output hashes are different, but not unusual.
73+ - The derivation includes a dependency on `buildPackages.bash` and
74+ `expect-failure.sh`, which is built to include a transitive dependency on
75+ `buildPackages.coreutils` and possibly more. These are not added to `PATH`
76+ or any other environment variable, so they should be hard to observe.
77+78+## `testEqualContents` {#tester-equalContents}
79+80+Check that two paths have the same contents.
81+82+Example:
83+84+```nix
85+testers.testEqualContents {
86+ assertion = "sed -e performs replacement";
87+ expected = writeText "expected" ''
88+ foo baz baz
89+ '';
90+ actual = runCommand "actual" {
91+ # not really necessary for a package that's in stdenv
92+ nativeBuildInputs = [ gnused ];
93+ base = writeText "base" ''
94+ foo bar baz
95+ '';
96+ } ''
97+ sed -e 's/bar/baz/g' $base >$out
98+ '';
99+}
100+```
101+102## `testEqualDerivation` {#tester-testEqualDerivation}
103104Checks that two packages produce the exact same build instructions.
···1+# Run a builder, flip exit code, save log and fix outputs
2+#
3+# Sub-goals:
4+# - Delegate to another original builder passed via args
5+# - Save the build log to output for further checks
6+# - Make the derivation succeed if the original builder fails
7+# - Make the derivation fail if the original builder returns exit code 0
8+#
9+# Requirements:
10+# This runs before, without and after stdenv. Do not modify the environment;
11+# especially not before invoking the original builder. For example, use
12+# "@" substitutions instead of PATH.
13+# Do not export any variables.
14+15+# Stricter bash
16+set -eu
17+18+# ------------------------
19+# Run the original builder
20+21+echo "testBuildFailure: Expecting non-zero exit from builder and args: ${*@Q}"
22+23+("$@" 2>&1) | @coreutils@/bin/tee $TMPDIR/testBuildFailure.log \
24+ | while read ln; do
25+ echo "original builder: $ln"
26+ done
27+28+r=${PIPESTATUS[0]}
29+if [[ $r = 0 ]]; then
30+ echo "testBuildFailure: The builder did not fail, but a failure was expected!"
31+ exit 1
32+fi
33+echo "testBuildFailure: Original builder produced exit code: $r"
34+35+# -----------------------------------------
36+# Write the build log to the default output
37+38+outs=( $outputs )
39+defOut=${outs[0]}
40+defOutPath=${!defOut}
41+42+if [[ ! -d $defOutPath ]]; then
43+ if [[ -e $defOutPath ]]; then
44+ @coreutils@/bin/mv $defOutPath $TMPDIR/out-node
45+ @coreutils@/bin/mkdir $defOutPath
46+ @coreutils@/bin/mv $TMPDIR/out-node $defOutPath/result
47+ fi
48+fi
49+50+@coreutils@/bin/mkdir -p $defOutPath
51+@coreutils@/bin/mv $TMPDIR/testBuildFailure.log $defOutPath/testBuildFailure.log
52+echo $r >$defOutPath/testBuildFailure.exit
53+54+# ------------------------------------------------------
55+# Put empty directories in place for any missing outputs
56+57+for outputName in ${outputs:-out}; do
58+ outputPath="${!outputName}"
59+ if [[ ! -e "${outputPath}" ]]; then
60+ @coreutils@/bin/mkdir "${outputPath}";
61+ fi
62+done
···94 # which cannot be set at the same time as -Wformat-security
95 hardeningDisable = [ "format" ];
9697- patches = [
98- # fixes consistent crashing in github on 6.4.0, can probably remove when there is a patch release
99- # https://codereview.qt-project.org/c/qt/qtwebengine/+/436316
100- ../patches/qtwebengine-fix.patch
101- ];
102-103 postPatch = ''
104 # Patch Chromium build tools
105 (
···94 # which cannot be set at the same time as -Wformat-security
95 hardeningDisable = [ "format" ];
9600000097 postPatch = ''
98 # Patch Chromium build tools
99 (
···46 version = "8.06.12";
47 sha256 = "sha256:17fmb13l18isgwr38hg9r5a0nayf2hhw6acj5153cy1sygsdg3b5";
48 };
000049 };
50 param = params . ${lib.versions.majorMinor ocaml.version}
51 or (throw "labltk is not available for OCaml ${ocaml.version}");
···46 version = "8.06.12";
47 sha256 = "sha256:17fmb13l18isgwr38hg9r5a0nayf2hhw6acj5153cy1sygsdg3b5";
48 };
49+ "5.0" = mkNewParam {
50+ version = "8.06.13";
51+ sha256 = "sha256-Vpf13g3DEWlUI5aypiowGp2fkQPK0cOGv2XiRUY/Ip4=";
52+ };
53 };
54 param = params . ${lib.versions.majorMinor ocaml.version}
55 or (throw "labltk is not available for OCaml ${ocaml.version}");
···40 description = "Unittest-compatible framework for repeating a test function over many fixtures";
41 homepage = "https://github.com/epsy/repeated_test";
42 license = licenses.mit;
43- maintainers = with maintainers; [ ];
44 };
45}
···40 description = "Unittest-compatible framework for repeating a test function over many fixtures";
41 homepage = "https://github.com/epsy/repeated_test";
42 license = licenses.mit;
43+ maintainers = with maintainers; [ tjni ];
44 };
45}
···137 pydrive = throw "pydrive is broken and deprecated and has been replaced with pydrive2."; # added 2022-06-01
138 pyGtkGlade = throw "Glade support for pygtk has been removed"; # added 2022-01-15
139 pycallgraph = throw "pycallgraph has been removed, it was using setuptools 2to3 translation feature, which has been removed in setuptools 58"; # added 2022-01-18
0140 pycryptodome-test-vectors = throw "pycryptodome-test-vectors has been removed because it is an internal package to pycryptodome"; # added 2022-05-28
141 pyialarmxr = pyialarmxr-homeassistant; # added 2022-06-07
142 pyialarmxr-homeassistant = throw "The package was removed together with the component support in home-assistant 2022.7.0"; # added 2022-07-07
···206 tensorflow-estimator_2 = tensorflow-estimator; # added 2021-11-25
207 tensorflow-tensorboard = tensorboard; # added 2022-03-06
208 tensorflow-tensorboard_2 = tensorflow-tensorboard; # added 2021-11-25
0209 tvnamer = throw "tvnamer was moved to pkgs.tvnamer"; # added 2021-07-05
210 types-cryptography = throw "types-cryptography has been removed because it is obsolete since cryptography version 3.4.4."; # added 2022-05-30
211 types-paramiko = throw "types-paramiko has been removed because it was unused."; # added 2022-05-30
···137 pydrive = throw "pydrive is broken and deprecated and has been replaced with pydrive2."; # added 2022-06-01
138 pyGtkGlade = throw "Glade support for pygtk has been removed"; # added 2022-01-15
139 pycallgraph = throw "pycallgraph has been removed, it was using setuptools 2to3 translation feature, which has been removed in setuptools 58"; # added 2022-01-18
140+ pychef = throw "pychef has been removed because it's been archived upstream and abandoned since 2017."; # added 2022-11-14
141 pycryptodome-test-vectors = throw "pycryptodome-test-vectors has been removed because it is an internal package to pycryptodome"; # added 2022-05-28
142 pyialarmxr = pyialarmxr-homeassistant; # added 2022-06-07
143 pyialarmxr-homeassistant = throw "The package was removed together with the component support in home-assistant 2022.7.0"; # added 2022-07-07
···207 tensorflow-estimator_2 = tensorflow-estimator; # added 2021-11-25
208 tensorflow-tensorboard = tensorboard; # added 2022-03-06
209 tensorflow-tensorboard_2 = tensorflow-tensorboard; # added 2021-11-25
210+ tumpa = throw "tumpa was promoted to a top-level attribute"; # added 2022-11-19
211 tvnamer = throw "tvnamer was moved to pkgs.tvnamer"; # added 2021-07-05
212 types-cryptography = throw "types-cryptography has been removed because it is obsolete since cryptography version 3.4.4."; # added 2022-05-30
213 types-paramiko = throw "types-paramiko has been removed because it was unused."; # added 2022-05-30