Fix Windows backend import condition to match cfg_if! logic#137
Merged
nagisa merged 5 commits intorust-lang:masterfrom Feb 6, 2026
Merged
Fix Windows backend import condition to match cfg_if! logic#137nagisa merged 5 commits intorust-lang:masterfrom
nagisa merged 5 commits intorust-lang:masterfrom
Conversation
When running under Miri on Windows, the cfg_if! block in backends/mod.rs selects the fallback backend (because miri is checked first), but the conditional import at line 178 was only checking #[cfg(windows)], causing a compilation error when the windows module wasn't compiled. This fix ensures the import condition matches the cfg_if! logic by using #[cfg(all(windows, not(miri)))] instead of #[cfg(windows)], so the windows backend is only imported when it's actually compiled. Fixes compilation error: could not find 'windows' in 'backends'
Adds a new miri-test job that runs Miri tests on Ubuntu, Windows, and macOS for both stacker and psm manifests. This will help catch conditional compilation issues like the one fixed in the previous commit.
The psm crate has test compilation issues unrelated to this fix. Focus Miri testing on the main stacker crate where the cfg condition fix applies.
Deep recursion tests are too slow under Miri's interpreter. These tests are skipped under Miri while still validating that the code compiles correctly (which was the main goal - catching the cfg condition mismatch).
nagisa
reviewed
Jan 27, 2026
Modified the deep test to include Miri in the target architecture check, allowing for better handling of recursion limits under Miri. This change ensures that the test is appropriately limited when running in the Miri environment, addressing performance concerns.
Contributor
Author
|
we ok to merge this PR? @nagisa |
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.
When running under Miri on Windows, the cfg_if! block in backends/mod.rs selects the fallback backend (because miri is checked first), but the conditional import at line 178 was only checking #[cfg(windows)], causing a compilation error when the windows module wasn't compiled.
This fix ensures the import condition matches the cfg_if! logic by using #[cfg(all(windows, not(miri)))] instead of #[cfg(windows)], so the windows backend is only imported when it's actually compiled.
Fixes compilation error: could not find 'windows' in 'backends'