Select Git revision
remove-empty-file
-
Patrick Steinhardt authored
We're using the `/bin/bash` shebang in many of our scripts. This path is not guaranteed to exist by POSIX though, and it in fact doesn't on NixOS, for example. Unfortunately, there is no way to make this portable according to the POSIX standard except to rewrite the shebang: Furthermore, on systems that support executable scripts (the "#!" construct), it is recommended that applications using executable scripts install them using getconf PATH to determine the shell pathname and update the "#!" script appropriately as it is being installed (for example, with sed). For example: This is not really practical though. There are two alternatives that are commonly used in practice though: 1. Use `/bin/sh` and stop using Bashisms. This binary really exists on virtually every platform, even on NixOS. This would require us to port over existing test scripts to be compatible. 2. Use `/usr/bin/env bash`, which resolves the shell via PATH. This does not require us to port shell scripts and works in practice. Convert our scripts to use the second option, as it is the easier one of both and addresses the underlying issue on NixOS.
Patrick Steinhardt authoredWe're using the `/bin/bash` shebang in many of our scripts. This path is not guaranteed to exist by POSIX though, and it in fact doesn't on NixOS, for example. Unfortunately, there is no way to make this portable according to the POSIX standard except to rewrite the shebang: Furthermore, on systems that support executable scripts (the "#!" construct), it is recommended that applications using executable scripts install them using getconf PATH to determine the shell pathname and update the "#!" script appropriately as it is being installed (for example, with sed). For example: This is not really practical though. There are two alternatives that are commonly used in practice though: 1. Use `/bin/sh` and stop using Bashisms. This binary really exists on virtually every platform, even on NixOS. This would require us to port over existing test scripts to be compatible. 2. Use `/usr/bin/env bash`, which resolves the shell via PATH. This does not require us to port shell scripts and works in practice. Convert our scripts to use the second option, as it is the easier one of both and addresses the underlying issue on NixOS.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.