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

Need to fix 'miri' bash script for Windows powershell users #978

Closed
JOE1994 opened this issue Oct 5, 2019 · 9 comments · Fixed by #980
Closed

Need to fix 'miri' bash script for Windows powershell users #978

JOE1994 opened this issue Oct 5, 2019 · 9 comments · Fixed by #980
Labels
A-windows Area: affects only Windows targets C-bug Category: This is a bug.

Comments

@JOE1994
Copy link
Contributor

JOE1994 commented Oct 5, 2019

image

While trying to work on Issue #707 locally, I got stuck with 'Testing the Miri driver' step. I used Powershell to confront the above error. The current issue is that $MIRI_SYSROOT fed to the miri executable is stripped off of its backslashes, resulting in an error "can't find crate for std"

Maybe the 'miri' bash script should be fixed to escape backslashes for windows users?
Or it could also be an issue with cargo

@RalfJung RalfJung added A-windows Area: affects only Windows targets C-bug Category: This is a bug. labels Oct 5, 2019
@RalfJung
Copy link
Member

RalfJung commented Oct 5, 2019

Unfortunately I have no experience with bash scripts on Windows, nor with PowerShell. But I'd happily review a PR trying to fix this. :)

I am surprised the bash script does anything on Windows. I didn't even know PowerShell can run bash...

@RalfJung
Copy link
Member

@JOE1994 so now that this works, do you think we could somehow use the miri script for our AppVeyor CI (configured at https://github.com/rust-lang/miri/blob/master/.appveyor.yml ) ?

@JOE1994
Copy link
Contributor Author

JOE1994 commented Oct 15, 2019

@RalfJung I currently have zero knowledge of AppVeyor CI. I'll need some time to learn about it before I can say something about it 😢

miri/.appveyor.yml

Lines 1 to 6 in 0d01c30

environment:
global:
PROJECT_NAME: miri
matrix:
- TARGET: x86_64-pc-windows-msvc
- TARGET: i686-pc-windows-msvc

Is the AppVeyor script solely for Windows ??
(I assume not, but don't see any TARGETs in the script other than Windows)

@RalfJung
Copy link
Member

RalfJung commented Oct 15, 2019 via email

@JOE1994
Copy link
Contributor Author

JOE1994 commented Oct 15, 2019

In either Powershell or the Batch shell (2 shells that come with Windows), it is possible to run bash scripts or enter bash shell by using the sh command.

image

how do I get bash onto Windows? Is that a normal thing for Rust devs to do on Windows?

Maybe I should ask this question to the Rust language forum or the Rust subreddit to find out..
Personally, I try to use bash on Windows when projects only provide bash scripts for building it.

https://users.rust-lang.org/t/is-it-normal-to-use-bash-on-windows-to-build-rust-projects/33628

@RalfJung
Copy link
Member

Hm, but sh is not shipped with Windows, right? Don't we need to install it?

@JOE1994
Copy link
Contributor Author

JOE1994 commented Oct 15, 2019

Oh.. I just realized that sh is not shipped with Windows by default.
One needs to have WSL(Windows Subsystem for Linux) installed and enabled in order to use bash shell in Windows.

@RalfJung
Copy link
Member

That still seems to be rather experimental on the AppVeyor side: appveyor/ci#1295.

So, probably best to stick to our current scheme for now. Thanks for testing the script on WSL though, good to know it works now!

@mati865
Copy link
Contributor

mati865 commented Oct 19, 2019

Git for Windows ships with bash (bash and sh executables) so anybody who have git will have sh available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-windows Area: affects only Windows targets C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants