buildDotnetModule: fix sandboxed builds on darwin

ICU tries to unconditionally load files from /usr/share/icu on Darwin,
which makes builds fail in the sandbox. Thus, let's disable ICU during
the build on Darwin by setting DOTNET_SYSTEM_GLOBALIZATION_INVARIANT [0].

[0]: https://learn.microsoft.com/en-us/dotnet/core/runtime-config/globalization#invariant-mode
This commit is contained in:
Winter 2023-02-21 18:04:39 -05:00
parent 9f58b8fe3a
commit 8c8524bc9a

View file

@ -267,4 +267,8 @@ stdenvNoCC.mkDerivation (args // {
} // args.passthru or { };
meta = (args.meta or { }) // { inherit platforms; };
})
}
# ICU tries to unconditionally load files from /usr/share/icu on Darwin, which makes builds fail
# in the sandbox, so disable ICU on Darwin. This, as far as I know, shouldn't cause any built packages
# to behave differently, just the dotnet build tool.
// lib.optionalAttrs stdenvNoCC.isDarwin { DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = 1; })