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

Windows fixes #489

Merged
merged 2 commits into from
Jan 14, 2019
Merged

Windows fixes #489

merged 2 commits into from
Jan 14, 2019

Conversation

danwilhelm
Copy link
Member

@danwilhelm danwilhelm commented Jan 12, 2019

Issue #277 - Affects running login, pack, and publish on Windows.

Wraps Command::new by child::new_command(program: &str). This prepends cmd /c to the program name if cfg!(windows). See rustc: #42436, #42791, #44542

See commits for more details. Tested build/login/pack/publish on the latest stable Windows, Mac, and Ubuntu.

  • [✅] You have the latest version of rustfmt installed
  • [✅] You ran cargo fmt on the code base before submitting
  • [✅] You reference which issue is being closed in the PR text

`child::run` overrides the stdout config, so is misleading to to set it
differently beforehand. `child::run` uses `spawn()`, which inherits
stdin by default. So, no need to set stdin to default beforehand,
particularly when the spawned program is non-interactive.
Issue rustwasm#277 - Affects running login, pack, and publish on Windows.

`Command::new("npm")` launched `npm` with quotes, `"npm"`, causing a
run-time error on Windows. Now, `Command::new` is wrapped by
`child::new_command(program: &str)`. This prepends `cmd /c` to the
program name if `cfg!(windows)`.

See rustc: #42436, #42791, #44542
Copy link
Member

@ashleygwilliams ashleygwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good to me! i'm going to have @steveklabnik also test locally, just to be sure everything works (i trust u of course, but it's always good to test twice <3 )

@ashleygwilliams
Copy link
Member

@steveklabnik could you test this locally on your Windows set up?

@steveklabnik
Copy link
Contributor

cargo test passes for me locally with these changes!

@ashleygwilliams
Copy link
Member

(also made @steveklabnik actually run the commands on Windows as i sadly don't trust our tests for this- and success! thanks again @danwilhelm - this work is very much appreciated!)

@ashleygwilliams ashleygwilliams merged commit 3fc8043 into rustwasm:master Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants