When trying to build rustc (I really need to test --bless for this PR), I'm getting WindowsError: [Error 193] %1 is not a valid Win32 application before even entering the bootstrap Rust code.
D:\rust-lang>git submodule foreach git clean -fdx
Entering 'src/doc/book'
Entering 'src/doc/edition-guide'
Entering 'src/doc/embedded-book'
Entering 'src/doc/nomicon'
Entering 'src/doc/reference'
Entering 'src/doc/rust-by-example'
Entering 'src/doc/rustc-guide'
Entering 'src/llvm-project'
Entering 'src/stdarch'
Entering 'src/tools/cargo'
Entering 'src/tools/clippy'
Entering 'src/tools/miri'
Entering 'src/tools/rls'
Entering 'src/tools/rust-installer'
Entering 'src/tools/rustfmt'
D:\rust-lang>py x.py --help
info: Downloading and building bootstrap before processing --help
command. See src/bootstrap/README.md for help with common
commands.
Updating only changed submodules
Submodules updated in 0.18 seconds
Finished dev [unoptimized] target(s) in 0.36s
Traceback (most recent call last):
File "x.py", line 11, in <module>
bootstrap.main()
File "D:\rust-lang\src\bootstrap\bootstrap.py", line 910, in main
bootstrap(help_triggered)
File "D:\rust-lang\src\bootstrap\bootstrap.py", line 896, in bootstrap
run(args, env=env, verbose=build.verbose)
File "D:\rust-lang\src\bootstrap\bootstrap.py", line 136, in run
ret = subprocess.Popen(args, **kwargs)
File "D:\Program Files\x86\Python37-32\lib\subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "D:\Program Files\x86\Python37-32\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
OSError: [WinError 193] %1 is not a valid Win32 application
Is this an issue of my machine environment, the Python that I'm using, x.py, or something else?
For what it's worth, I've recently built rust on Windows 10. I can't reproduce this exact error. I'm using python 3.7.4 on Windows 10 18362.476. I'm compiling with MSVC 2019 (16.3.10) and have C++ and .NET tools installed, as well as the Windows 10 SDK.
All commands are being run from "x64 Native Tools Command Prompt for VS 2019", which ensures the necessary environment variables are set.
I'm sorry I can't be of more help. Perhaps it would be worth editing bootstrap.py to print more details?
I get the same results running from the native tools command prompt as previously in both powershell and cmd.
Though launching the native tools command prompt gives the following error message before the first prompt, so maybe my VS install is more messed up than I ever realized:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.