Skip to content

fish: avoid replacing "awk" in store paths - #557806

Merged
vcunat merged 1 commit into
NixOS:masterfrom
thunze:unfry-fish
Sep 2, 2026
Merged

vcunat merged 1 commit into
NixOS:masterfrom
thunze:unfry-fish

Conversation

@thunze

@thunze thunze commented Aug 29, 2026

Copy link
Copy Markdown
Member

We're encountering a fish build failure on staging-next-26.05 caused by the store path for gnugrep coincidentally containing the string awk. A later substitution of awk replaces this substring with another store path in some files, resulting in a number of broken paths that look like this:

/nix/store/x3mmar/nix/store/l048yqk8sv2lpz14ww39bqc3vzcmlz6m-gawk-5.4.1/bin/awk8qkqf3257aidf7cljax6mc8-gnugrep-3.12/bin/grep

Extending the awk pattern to awk solves this problem and should be relatively safe given that awk requires arguments to be passed. (Let me know if you have a better idea to match awk invocations!)

Planning to get this into master first, then cherry-pick to staging-next-26.05, where the build failure happens.

Things done

We encountered a fish build failure [1] caused by the store path for
gnugrep coincidentally containing the string `awk`. A later substitution
of `awk` replaced this substring with another store path in some files,
resulting in a number of broken paths.

Extending the `awk` pattern to `awk ` solves this problem and should be
relatively safe given that awk requires arguments to be passed.

[1] https://hydra.nixos.org/build/343861659
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. labels Aug 29, 2026
@adamcstephens

Copy link
Copy Markdown
Contributor

getent has a full /usr path. Could the awk replacement do similar.

@thunze

thunze commented Aug 29, 2026 •

Copy link
Copy Markdown
Member Author

Not sure how that would work. The relevant files invoke awk from PATH, not via full path to the binary.

@adamcstephens

adamcstephens commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

You could also reorder the substitutions to do the awk replacement before grep, and that would achieve the same as 'awk '.

I've never looked at these substitutions before, but they actually have some bad side effects. For example this substitution completely breaks completion for awk itself.

I don't think there is a good substitution for awk. We should either wrap fish, or let it fail for people who don't have awk installed. I'm not quite sure what the behavior for the latter is, but I suspect it's not pretty.

There's also some stale and unnecessary substitutions. e.g. the getent replacement doesn't actually do anything.

I'm ok with merging this for now to unbreak fish. I'll be working on a more comprehensive update though.

@thunze

thunze commented Aug 30, 2026

Copy link
Copy Markdown
Member Author

Sounds good. Yeah, this was only meant as a stopgap to unbreak fish on staging-next-26.05.

@whispersofthedawn whispersofthedawn added the backport staging-next-26.05 Backport PR automatically label Aug 31, 2026
@vcunat
vcunat added this pull request to the merge queue Sep 2, 2026
Merged via the queue into NixOS:master with commit 38a9868 Sep 2, 2026
29 of 31 checks passed
@nixpkgs-ci

nixpkgs-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Successfully created backport PR for staging-next-26.05:

@github-actions github-actions Bot added the 8.has: port to stable This PR already has a backport to the stable release. label Sep 2, 2026
@thunze
thunze deleted the unfry-fish branch September 2, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. backport staging-next-26.05 Backport PR automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants