Commit a1191d1
committed
Detect the system on windows instead of reading Windows_NT
ci/lib.sh works out OS only when the caller has not set one:
if [[ ! ${OS-} ]]; then OS=$(os); fi
Windows predefines OS as Windows_NT in every process environment, so on a
windows shell that test always finds a value, os() is never called, and OS
stays Windows_NT for the whole build. Every question the build then asks about
the system gets an answer it does not understand: which bin scripts to fix up,
whether to build packages, what the release archive is called.
os() already handles this platform -- `cygwin* | mingw*` answers windows -- it
just never gets the chance. Windows_NT is not a name this build knows, so it is
not treated as one a caller chose.
Measured on a windows shell, sourcing the file three ways:
OS unset -> windows (was Windows_NT)
OS=Windows_NT -> windows (was Windows_NT)
OS=linux -> linux (unchanged)
so an explicit choice still wins, which is the point of the check. Nothing
changes anywhere else: no other platform sets OS, so the added test is never
reached off windows.1 parent 62284ed commit a1191d1
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
0 commit comments