Skip to content

Commit c18e919

Browse files
authored
Rollup merge of #73691 - ajpaverd:bootstrap-windows-73689, r=Mark-Simulacrum
Bootstrap: detect Windows based on sys.platform Closes #73689.
2 parents dfbba65 + 8b368db commit c18e919

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bootstrap/bootstrap.py

+6
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def default_build_triple():
184184
ostype = require(["uname", "-s"], exit=required)
185185
cputype = require(['uname', '-m'], exit=required)
186186

187+
# If we do not have `uname`, assume Windows.
187188
if ostype is None or cputype is None:
188189
return 'x86_64-pc-windows-msvc'
189190

@@ -236,6 +237,11 @@ def default_build_triple():
236237
if ostype.endswith('WOW64'):
237238
cputype = 'x86_64'
238239
ostype = 'pc-windows-gnu'
240+
elif sys.platform == 'win32':
241+
# Some Windows platforms might have a `uname` command that returns a
242+
# non-standard string (e.g. gnuwin32 tools returns `windows32`). In
243+
# these cases, fall back to using sys.platform.
244+
return 'x86_64-pc-windows-msvc'
239245
else:
240246
err = "unknown OS type: {}".format(ostype)
241247
sys.exit(err)

0 commit comments

Comments
 (0)