From 7c37a0134069d9fe8f7e3c534233d17a8e602413 Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Sun, 14 Jun 2026 12:04:08 -0400 Subject: [PATCH 1/2] tests.trivial-builders.symlinkJoin: fix group mismatches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes group mismatches observed on Darwin, e.g.: ``` --- /nix/store/w7fr9zs91z02c1bbd54lxkvipwn7xfhd-symlinkJoin +++ /nix/store/7r2jq748ikrryqzm55cwbxqpng276wpd-symlinkJoin-foo-bar-baz ├── stat {} │ @@ -1,7 +1,7 @@ │ │ Size: 128 Blocks: 0 IO Block: 4096 directory │ -Device: 1,15 Access: (0555/dr-xr-xr-x) Uid: ( 0/ root) Gid: ( 0/ wheel) │ +Device: 1,15 Access: (0555/dr-xr-xr-x) Uid: ( 0/ root) Gid: ( 350/ nixbld) ``` (cherry picked from commit 85912a429b60c51d316fe33bb9524f41096abe94) --- .../trivial-builders/test/symlink-join.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/build-support/trivial-builders/test/symlink-join.nix b/pkgs/build-support/trivial-builders/test/symlink-join.nix index 4750d9680d4a..30556add3119 100644 --- a/pkgs/build-support/trivial-builders/test/symlink-join.nix +++ b/pkgs/build-support/trivial-builders/test/symlink-join.nix @@ -1,7 +1,7 @@ { symlinkJoin, writeTextFile, - runCommand, + runCommandLocal, testers, }: @@ -31,7 +31,7 @@ let text = "qux"; }; - emulatedSymlinkJoinFooBarStrip = runCommand "symlinkJoin-strip-foo-bar" { } '' + emulatedSymlinkJoinFooBarStrip = runCommandLocal "symlinkJoin-strip-foo-bar" { } '' mkdir $out ln -s ${foo}/etc/test.d/foo $out/ ln -s ${bar}/etc/test.d/bar $out/ @@ -48,7 +48,7 @@ in baz ]; }; - expected = runCommand "symlinkJoin-foo-bar-baz" { } '' + expected = runCommandLocal "symlinkJoin-foo-bar-baz" { } '' mkdir -p $out/{var/lib/arbitrary,etc/test.d} ln -s {${foo},${bar}}/etc/test.d/* $out/etc/test.d ln -s ${baz}/var/lib/arbitrary/baz $out/var/lib/arbitrary/ @@ -66,7 +66,7 @@ in baz ]; }; - expected = runCommand "symlinkJoin-foo-bar-baz" { } '' + expected = runCommandLocal "symlinkJoin-foo-bar-baz" { } '' mkdir -p $out/{var/lib/arbitrary,etc/test.d} ln -s {${foo},${bar}}/etc/test.d/* $out/etc/test.d ln -s ${baz}/var/lib/arbitrary/baz $out/var/lib/arbitrary/ @@ -115,7 +115,7 @@ in }; symlinkJoin-fails-on-missing = - runCommand "symlinkJoin-fails-on-missing" + runCommandLocal "symlinkJoin-fails-on-missing" { failed = testBuildFailure (symlinkJoin { name = "symlinkJoin-fail"; @@ -134,7 +134,7 @@ in ''; symlinkJoin-fails-on-file = - runCommand "symlinkJoin-fails-on-file" + runCommandLocal "symlinkJoin-fails-on-file" { failed = testBuildFailure (symlinkJoin { name = "symlinkJoin-fail"; From 3d9f3d708078dbf7e23b67e1b89d3e536c8cd982 Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Sun, 14 Jun 2026 12:05:43 -0400 Subject: [PATCH 2/2] tests.replaceVars: fix group mismatches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes group mismatches observed on Darwin, e.g.: ``` replaceVars-succeeds --- /nix/store/wahj58fiii5j1jy6s9mpbdyxzhq3plnb-source.txt +++ /nix/store/bfmykrc9r5ycy0dj8l1z2p9c5116dny8-expected ├── stat {} │ @@ -1,7 +1,7 @@ │ │ Size: 96 Blocks: 0 IO Block: 4096 directory │ -Device: 1,15 Access: (0555/dr-xr-xr-x) Uid: ( 0/ root) Gid: ( 0/ wheel) │ +Device: 1,15 Access: (0555/dr-xr-xr-x) Uid: ( 0/ root) Gid: ( 350/ nixbld) │ │ Modify: 1970-01-01 00:00:01.000000000 +0000 ``` (cherry picked from commit 3a5c240ffece70c76c3ee8a3fc8a724569b845a8) --- pkgs/test/replace-vars/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/test/replace-vars/default.nix b/pkgs/test/replace-vars/default.nix index e1cc2bf1c13d..a6dd3c15ec32 100644 --- a/pkgs/test/replace-vars/default.nix +++ b/pkgs/test/replace-vars/default.nix @@ -6,6 +6,7 @@ lib, runCommand, testers, + writeText, }: let inherit (testers) testEqualContents testBuildFailure; @@ -22,7 +23,7 @@ let }; expected = mkExpectation ( - builtins.toFile "source.txt" '' + writeText "source.txt" '' All human beings are born free and are the same in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of shared humanity. @@ -53,7 +54,7 @@ let { failed = let - src = builtins.toFile "source.txt" '' + src = writeText "source.txt" '' Header. before @whatIsThis@ middle @It'sOdd2Me@ after. @cannot detect due to space@ @@ -86,7 +87,7 @@ let }; expected = mkExpectation ( - builtins.toFile "source.txt" '' + writeText "source.txt" '' All human beings are born free and are the same in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of @brotherhood@. @@ -101,7 +102,7 @@ let { failed = let - src = builtins.toFile "source.txt" '' + src = writeText "source.txt" '' @a@ @b@ @c@ @@ -127,7 +128,7 @@ let { failed = let - src = builtins.toFile "source.txt" '' + src = writeText "source.txt" '' @a@ @b@ '';