@cryptotaxi247 / infra / commits / dfd77d6d

macs: test chroot disable patch from nixpkgs#353709

Martin Weinelt committed Nov 6, 2024 at 17:16 UTC dfd77d6dbe22ebbc2d8720d217a9947c02741723
2 files changed +25 -1
macs/disable-chroot.patch new
+20
@@ -0,0 +1,20 @@
1 +diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
2 +index 2a09e3dd4..baeae54f8 100644
3 +--- a/src/libstore/unix/build/local-derivation-goal.cc
4 ++++ b/src/libstore/unix/build/local-derivation-goal.cc
5 +@@ -509,11 +509,11 @@ void LocalDerivationGoal::startBuilder()
6 + /* Create a temporary directory where the build will take
7 + place. */
8 + topTmpDir = createTempDir(settings.buildDir.get().value_or(""), "nix-build-" + std::string(drvPath.name()), false, false, 0700);
9 +-#if __APPLE__
10 ++//#if __APPLE__
11 + if (false) {
12 +-#else
13 +- if (useChroot) {
14 +-#endif
15 ++//#else
16 ++// if (useChroot) {
17 ++//#endif
18 + /* If sandboxing is enabled, put the actual TMPDIR underneath
19 + an inaccessible root-owned directory, to prevent outside
20 + access.
macs/nix-darwin.nix
+5 -1
@@ -45,7 +45,11 @@ in
45 cores = 2;
46 };
47
48 - nix.package = pkgs.nixVersions.nix_2_24;
48 + nix.package = pkgs.nixVersions.nix_2_24.overrideAttrs (oldAttrs: {
49 + patches = oldAttrs.patches or [ ] ++ [
50 + ./disable-chroot.patch
51 + ];
52 + });
53 nix.gc.automatic = true;
54 nix.gc.user = "";
55 nix.gc.interval = {