From 3a5c240ffece70c76c3ee8a3fc8a724569b845a8 Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Sun, 14 Jun 2026 12:05:43 -0400 Subject: [PATCH] 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 ``` --- 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@ '';