Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unix: rewrite shebangs of Python scripts to reference local interpreter
Before, the shebangs referenced a path in the build environment, which likely didn't exist in the run-time environment. After this change, the shebang uses a multiline shell script to call `exec` on the `python*` binary in the same directory as the script. The solution is similar to #61 but the technical approach is a bit different. We perform the rewrite inside the build environment, so this should work when building in Docker containers. And we use binary I/O everywhere, ensuring bytes are preserved. We also always exec the canonical `python*` binary to avoid symlink overhead.
- Loading branch information
Showing
2 changed files
with
44 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters