-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emscripten target broken on win32 with 1.20.0 release #44443
Comments
Got the same issue here :( |
Thanks for opening this up @vvanders! Could you test out a possible solution for this? If you use use std::env;
use std::process::{self, Command};
fn main() {
let status = Command::new("cmd")
.arg("/c")
.arg("emcc.bat")
.args(&env::args().skip(1).collect::<Vec<_>>())
.status()
.expect("failed to spawn `cmd`");
process::exit(status.code().unwrap());
} My hope is that we just need to do |
Hey @alexcrichton, can you explain down to use -C linker flag in a bit more detail? I'm not totally following the steps you listed out above. |
Oh sure yeah, so ideally you could do: # Compile the program in the comment above
$ rustc foo.rs -o foo.exe
# Compile a "hello world"
$ rustc hello.rs --target asmjs-unknown-emscripten -C linker=./foo.exe And see if that works? |
Yup, that appears to work. I'll look into the libc changes on the other issue but this should address things on Win32. |
Ok excellent! I'll prepare a PR for this |
Ok I've opened a PR for this change at #44542 I've also nominated that for beta to make sure we fix this in 1.21 |
In the meantime I've also tagged this as a stable regression, but it should be fixed by the PR above |
Beta backported in #44357 |
It looks like the recent change in how Command executes batch files(see rust-lang/cc-rs#239 for details) has also caused the emscripten target to regress and fail to compile on win32.
I'm also seeing the libc::c_char type change from *const i8 to *const u8 which is causing problems with a bunch of C bindings I have.
Below example works fine when I switch back to 1.19.0.
I tried this code:
/~https://github.com/vvanders/rust_command_repro
I expected to see this happen: Successful compile
Instead, this happened:
Meta
rustc --version --verbose
:C:\dev\command_repro>rustc --version --verbose
rustc 1.20.0 (f3d6973 2017-08-27)
binary: rustc
commit-hash: f3d6973
commit-date: 2017-08-27
host: x86_64-pc-windows-msvc
release: 1.20.0
LLVM version: 4.0
The text was updated successfully, but these errors were encountered: