pyret-lang icon indicating copy to clipboard operation
pyret-lang copied to clipboard

fix: use `bash` from PATH in Makefile

Open ironm00n opened this issue 2 months ago • 2 comments

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

ironm00n avatar Oct 11 '25 21:10 ironm00n

I'm so confused. I swear I added this at either your request or @dbp 's (https://github.com/brownplt/pyret-lang/commit/5fd829e0f1726ce4fc68127aecb4e884229d7d72)

jpolitz avatar Oct 15 '25 19:10 jpolitz

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.

ironm00n avatar Oct 15 '25 20:10 ironm00n