Added an error message when using enableFakechroot on Darwin (#327336)

* Added an error message when using enableFakechroot on Darwin

Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
This commit is contained in:
Florian Nagel 2024-07-17 10:06:42 +02:00 committed by GitHub
parent 6cb2304c5f
commit e18d3b4894
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,6 +24,7 @@
, runtimeShell
, shadow
, skopeo
, stdenv
, storeDir ? builtins.storeDir
, substituteAll
, symlinkJoin
@ -922,6 +923,13 @@ rec {
assert
(lib.assertMsg (maxLayers > 1)
"the maxLayers argument of dockerTools.buildLayeredImage function must be greather than 1 (current value: ${toString maxLayers})");
assert
(lib.assertMsg (enableFakechroot -> !stdenv.isDarwin) ''
cannot use `enableFakechroot` because `proot` is not portable to Darwin. Workarounds:
- use `fakeRootCommands` with the restricted `fakeroot` environment
- cross-compile your packages
- run your packages in a virtual machine
Discussion: https://github.com/NixOS/nixpkgs/issues/327311'');
let
baseName = baseNameOf name;