about summary refs log tree commit diff
path: root/pkgs/build-support/dotnet
diff options
context:
space:
mode:
authorWinter <winter@winter.cafe>2023-02-21 18:04:39 -0500
committerWinter <winter@winter.cafe>2023-02-21 18:04:39 -0500
commit8c8524bc9a95f9a0ba7691b097804f928781d162 (patch)
tree7c31169fe380218f28ef5e9f24c172fff694e918 /pkgs/build-support/dotnet
parent9f58b8fe3ab939a4ca2b40a2e692d7b9772b8f98 (diff)
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
Diffstat (limited to 'pkgs/build-support/dotnet')
-rw-r--r--pkgs/build-support/dotnet/build-dotnet-module/default.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgs/build-support/dotnet/build-dotnet-module/default.nix b/pkgs/build-support/dotnet/build-dotnet-module/default.nix
index 514255f324ac4..bf2b9df54fbc9 100644
--- a/pkgs/build-support/dotnet/build-dotnet-module/default.nix
+++ b/pkgs/build-support/dotnet/build-dotnet-module/default.nix
@@ -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; })