Skip to content
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

Command::new() doesn't expand %dp0 correctly in nightly #43273

Closed
vvanders opened this issue Jul 16, 2017 · 5 comments
Closed

Command::new() doesn't expand %dp0 correctly in nightly #43273

vvanders opened this issue Jul 16, 2017 · 5 comments

Comments

@vvanders
Copy link
Contributor

vvanders commented Jul 16, 2017

Currently the GCC crate fails to build with emscripten on nightly due to issues running the emcc.bat in emscripten:

@echo off
python "%~dp0\emcc" %*

Logging %~dp0 in nightly shows it pointing to the current directory of the crate while in stable it points to the path of the batch file(Ex: C:\Program Files\Emscripten\emscripten\incoming).

Tested between

nightly-x86_64-pc-windows-msvc unchanged - rustc 1.20.0-nightly (086eaa7 2017-07-15)

and

stable-x86_64-pc-windows-msvc unchanged - rustc 1.18.0 (03fc9d6 2017-06-06)

@vvanders
Copy link
Contributor Author

From looking at https://github.com/rust-lang/rust/blob/beta/src/libstd/sys/windows/process.rs it doesn't seem like there's any difference between stable and nightly so not sure exactly where this is getting introduced.

Happy to dig into it more with some pointers if anyone has an idea where this could be coming from.

@vvanders
Copy link
Contributor Author

Also, modifying GCC crate with the fill path ahead of the command("emcc.bat" vs "C:\Program Files\Emscripten\emscripten\incoming\emcc.bat") gets the bat file to find the correct path for %~dp0. Obviously this isn't a good long-term fix but might be why the behavior here has changed.

@ollie27
Copy link
Member

ollie27 commented Jul 17, 2017

dupe of #42791

@Mark-Simulacrum
Copy link
Member

Closing as duplicate of #42791.

@Mark-Simulacrum Mark-Simulacrum marked this as a duplicate of #42791 Jul 19, 2017
@kuviman
Copy link

kuviman commented Sep 6, 2017

Hello,
So I guess this is the reason I cannot build targeting asmjs-unknown-emscripten on stable now on Windows.

I also had to fix some of my build scripts but I am not sure if I can fix this:

   Compiling my_project v0.1.0 (file:///P:/my_project)
error: linking with `emcc.bat` failed: exit code: 2
  |
  = note: "emcc.bat" "-s" ...
  = note: python: can't open file 'P:\my_project\\emcc': [Errno 2] No such file or directory
          

error: aborting due to previous error

error: Could not compile `my_project`.

To learn more, run the command again with --verbose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants