Skip to content

Commit

Permalink
Rollup merge of rust-lang#73691 - ajpaverd:bootstrap-windows-73689, r…
Browse files Browse the repository at this point in the history
…=Mark-Simulacrum

Bootstrap: detect Windows based on sys.platform

Closes rust-lang#73689.
  • Loading branch information
Manishearth authored Jun 26, 2020
2 parents b3c2a4a + 8b368db commit eff76f3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def default_build_triple():
ostype = require(["uname", "-s"], exit=required)
cputype = require(['uname', '-m'], exit=required)

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

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

0 comments on commit eff76f3

Please sign in to comment.