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

Implement missing shims for Windows #1537

Closed
3 of 5 tasks
RalfJung opened this issue Sep 7, 2020 · 14 comments
Closed
3 of 5 tasks

Implement missing shims for Windows #1537

RalfJung opened this issue Sep 7, 2020 · 14 comments
Labels
A-shims Area: This affects the external function shims A-windows Area: affects only Windows targets C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement E-good-first-issue A good way to start contributing, mentoring is available

Comments

@RalfJung
Copy link
Member

RalfJung commented Sep 7, 2020

Here we track shims that Miri currently only implements for Linux and macOS targets, but not for Windows.

If you run into this, try cargo miri test --target x86_64-unknown-linux-gnu. This works even on a Windows host (without installing anything extra) and interprets programs on a well-supported Linux target.

@RalfJung RalfJung added A-shims Area: This affects the external function shims A-windows Area: affects only Windows targets C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement labels Sep 7, 2020
@jmerdich

This comment was marked as resolved.

@RalfJung

This comment was marked as resolved.

@RalfJung

This comment was marked as resolved.

@RalfJung

This comment was marked as resolved.

@RalfJung

This comment was marked as resolved.

@jmerdich

This comment was marked as resolved.

@RalfJung

This comment was marked as resolved.

@beepster4096

This comment was marked as resolved.

@rustbot

This comment was marked as resolved.

@RalfJung

This comment was marked as resolved.

@RalfJung RalfJung added E-good-first-issue A good way to start contributing, mentoring is available and removed E-medium labels Apr 4, 2024
@mbyt
Copy link

mbyt commented Apr 18, 2024

Miri is great project, thanks!

I am trying to use miri on a regression test on windows, which uses fs::read_to_string. When doing so, I get an error

can't call foreign function `CreateFileW` on OS `windows`

To my understanding from this issue is that file system access is still not implemented for windows (it was added for Unix platforms 2019 in #923.

Is there a workaround for reading a regression reference in windows, such that miri does not complain (unfortunately I cannot use include_str! as it takes a string literal as argument)?

@parasyte
Copy link

@mbyt You may get further along with miri just by running it under WSL. There are other issues you may run into, especially if there is any FFI outside of what std does. (That's #2365)

@RalfJung
Copy link
Member Author

@mbyt you can run Miri with --target x86_64-unknown-linux-gnu. This works on Windows without WSL and without installing anything extra. Miri can then use its Linux support for file system access to emulate what the program does, and it should largely work for accessing Windows file systems as well. Please report an issue (a new issue) if it does not.

@RalfJung
Copy link
Member Author

Since most of the small things are done now, I'll close this issue in favor of one that is specifically about file system access: #3482.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-shims Area: This affects the external function shims A-windows Area: affects only Windows targets C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement E-good-first-issue A good way to start contributing, mentoring is available
Projects
None yet
Development

No branches or pull requests

6 participants