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

Enable Running Test Cases on Windows #280

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

voteblake
Copy link

#279 includes changes necessary to start supporting Windows once support also lands in rustc (see rust-lang/rust#89369). I wanted to explore the current state of support by running the cargo-fuzz test suite with the rust toolchain built with Windows support for asan symbols enabled. I've run in to two issues so far.

First Issue - Addressed

The test suite generates a set of fuzz targets and associated Cargo.toml manifest files. Those files include path configuration that, up until this point, has leveraged the PathBuf display functionality to render the paths as strings for the generated toml file. This breaks on Windows. toml needs \ in Windows paths to be escaped, which display does not do. Using the toml serializer address this in a cross platform way. I have tested this change on Windows and Linux. While I don't have a Mac system to test on I have no reason to think this is a risky change there.

Second Issue - Work In Progress

With a dev toolchain built and linked including the changes from rust-lang/rust#89369 and the above path issue addressed there are still failures of the test cases on Windows. All test cases that execute fuzz tests fail with:

error: unable to unlink old fallback exe: Access is denied. (os error 5)

References to this error I've found suggest it has to do with calling cargo from within another execution of cargo on Windows, which is the behavior we're attempting in these test cases. Reference rust-lang/rust-clippy#3118. Clippy addressed this with hardcoding the +nightly toolchain in their calls to cargo which might work here when/if rust-lang/rust#89369 or other support hits nightly. I'm investigating other options.

#[cfg(not(target_family = "windows"))]
let expected_err = "File exists (os error 17)";
#[cfg(target_family = "windows")]
let expected_err = "The file exists. (os error 80)";
Copy link
Member

Choose a reason for hiding this comment

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

Won't this fail to work on Windows systems that have the system language set to some other language than English?

Copy link
Author

Choose a reason for hiding this comment

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

Good question, I will look in to the localization impact.

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

Successfully merging this pull request may close these issues.

2 participants