From 8c8524bc9a95f9a0ba7691b097804f928781d162 Mon Sep 17 00:00:00 2001 From: Winter Date: Tue, 21 Feb 2023 18:04:39 -0500 Subject: [PATCH] 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 --- pkgs/build-support/dotnet/build-dotnet-module/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/dotnet/build-dotnet-module/default.nix b/pkgs/build-support/dotnet/build-dotnet-module/default.nix index 514255f324ac..bf2b9df54fbc 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; })