Build the test suite on Windows by gating Unix-only tests - #1
Open
Tyagiquamar wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
cargo testfails to compile on Windows. Three files use Unix-only APIs unconditionally:src/spec_identity.rs— the unit-test module importsstd::os::unix::fsand runs two symlink-escape tests (unix_fs::symlink).tests/spec_identity_tests.rs— same import plus two symlink tests.tests/adapter_tests.rs— importsstd::os::unix::fs::PermissionsExt(forset_mode(0o755)on fake host shims) in three dogfood tests that also executebashscripts.On Windows the build stops at
error[E0432]: unresolved import std::os::unix, so no test binary builds at all — including all platform-independent tests.Provenance: found by running
cargo teston Windows; the repo's local CI gate has only been exercised on Unix so far. No matching issue exists.Fix
Gate exactly the Unix-dependent imports, helpers, and tests behind
#[cfg(unix)]:unix_fs::symlink; the three adapter dogfood tests create executable bash shims viaPermissionsExt. All are inherently POSIX-only.HOST_MEDIATED_DOGFOOD,host_mediated_dogfood_guard,json/fs/Path/tempdirimports) is gated with them, so both platforms compile warning-free.#[cfg(unix)]is a no-op there).Testing
Windows (
x86_64-pc-windows-gnu, Rust 1.98):error[E0432]: unresolved import std::os::unix— no test binaries built.cargo test→ all green: 108 unit + 65 integration tests pass, 0 failed, no warnings.cargo fmt --checkclean;cargo clippy --all-targets --all-features -- -D warningsclean.