Skip to content

Conversation

@ironm00n
Copy link
Contributor

/usr/bin/env is not present in all environments (ex. Nix sandbox)

/usr/bin/env is not present in all environments (ex. Nix sandbox)
@jpolitz
Copy link
Member

jpolitz commented Oct 15, 2025

I'm so confused. I swear I added this at either your request or @dbp 's (5fd829e)

@ironm00n
Copy link
Contributor Author

That change was an improvement over /bin/bash since /usr/bin/env is a de-facto standard for unix-like systems.

However, not all build environments include a full filesystem hierarchy by default (as they aim to remain minimal). Relying on bash existing in $PATH is the most reliable solution here since it avoids assuming any fixed directory structures.

Due to the prevalence of shebangs, Nix (and other build systems), often patch #!/usr/bin/env ... to point to a static path (eg #!/nix/store/...). This doesn't work for Makefiles since its expected that it will use the environments dynamic $PATH.


If you don't feel that this change is appropriate to upstream that's fine :). I will continue patching the Makefile in my own scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants