Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork939
Commit729372f
committed
Prevent buggy interaction between MinGW and WSL
This changes the hashbangs in Makefile helper scripts to be static.Often, "#!/usr/bin/env bash" is a better hashbang for bash scriptsthan "#!/bin/bash", because it automatically works on Unix-likesystems that are not GNU/Linux and do not have bash in /bin, buton which it has been installed in another $PATH directory, such as/usr/local/bin. (It can also be helpful on macOS, where /bin/bashis usually an old version of bash, while a package manager such asbrew may have been used to install a newer version elsewhere.)Windows systems with WSL installed often have a deprecated bash.exein the System32 directory that runs commands and scripts inside aninstalled WSL system. (wsl.exe should be used instead.) Anytimethat bash is used due to a "#!/usr/bin/env bash" hashbang, it iswrong, because that only happens if the caller is some Unix-stylescript running natively or otherwise outside WSL.Normally this is not a reason to prefer a "#!/bin/bash" hashbang,because normally any environment in which one can run a script in away that determines its interpreter from its hashbang is anenvironment in which a native (or otherwise appropriate) bashprecedes the System32 bash in a PATH search. However, MinGW make,a popular make implementation used on Windows, is an exception.The goal of this change is not to sacrifice support for someUnix-like systems to better support Windows, which wouldn'tnecessarily be justified. Rather, this is to avoid extremelyconfusing wrong behavior that in some cases would have bizarreeffects that are very hard to detect. I discovered this problembecause the VIRTUAL_ENV variable was not inheried by the bashinterpreter (because it was, fortunately, not passed through toWSL). But if "python3 -m build" finds a global "build" package,things might get much further before any problem is noticed.1 parent4b1c564 commit729372f
2 files changed
+2
-2
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
|
0 commit comments
Comments
(0)