Commit Graph

6 Commits

Author SHA1 Message Date
Michael Daniels
3a5c240ffe tests.replaceVars: fix group mismatches
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
```
2026-06-14 12:06:11 -04:00
Wolfgang Walther
2e43b87c62 replaceVars: fail when exemption can't be found
This also changes stdenv's substitute --replace-fail to error out when
the replacement is the same as the search pattern, but can't be found.
This should not cause any problems in existing code, from what I can
tell from grepping nixpkgs.

The exception for pattern==replacement was previously introduced all the
way back in 5ff872aa24, but this was
apparently only used to make the check for the warning "simpler".
2025-02-10 19:19:59 +01:00
Wolfgang Walther
d07168dccb tests.replaceVars.replaceVarsWith: fix
This never worked properly, but it does now.
2025-01-21 20:12:26 +01:00
Wolfgang Walther
321bd31b60 replaceVarsWith: fix checkPhase with dir set 2024-12-15 12:21:52 +01:00
Wolfgang Walther
2d64877f63 replaceVars: allow exemptions
replaceVars has a checkPhase to confirm that no left-over @...@ patterns
remain. Since it's not possible to use "placeholder" with replaceVars,
the substitution of some patterns must be delayed to a later step.

By passing "null" for those keys explicitly, replaceVars can make an
exemption *just for this case*, but keep checking all other references.
2024-11-24 17:08:06 +01:00
Philip Taron
b0b3172fb4 replaceVars: init 2024-08-07 07:27:50 -07:00