build-support/docker: remove assertMsg usage

This commit is contained in:
Eman Resu
2026-05-26 14:14:40 -04:00
parent e21c64b291
commit 58bc1fec6f
+9 -8
View File
@@ -1030,11 +1030,12 @@ rec {
debug ? false,
}:
assert (
lib.assertMsg (layeringPipeline == null -> maxLayers > 1)
"the maxLayers argument of dockerTools.buildLayeredImage function must be greather than 1 (current value: ${toString maxLayers})"
(layeringPipeline == null -> maxLayers > 1)
|| throw "the maxLayers argument of dockerTools.buildLayeredImage function must be greather than 1 (current value: ${toString maxLayers})"
);
assert (
lib.assertMsg (enableFakechroot -> !stdenv.hostPlatform.isDarwin) ''
(enableFakechroot -> !stdenv.hostPlatform.isDarwin)
|| throw ''
cannot use `enableFakechroot` because `proot` is not portable to Darwin. Workarounds:
- use `fakeRootCommands` with the restricted `fakeroot` environment
- cross-compile your packages
@@ -1271,11 +1272,11 @@ rec {
command ? null,
run ? null,
}:
assert lib.assertMsg (!(drv.drvAttrs.__structuredAttrs or false))
"streamNixShellImage: Does not work with the derivation ${drv.name} because it uses __structuredAttrs";
assert lib.assertMsg (
command == null || run == null
) "streamNixShellImage: Can't specify both command and run";
assert
!(drv.drvAttrs.__structuredAttrs or false)
|| throw "streamNixShellImage: Does not work with the derivation ${drv.name} because it uses __structuredAttrs";
assert
command == null || run == null || throw "streamNixShellImage: Can't specify both command and run";
let
# A binary that calls the command to build the derivation