Skip to content

Conversation

@TKorr
Copy link

@TKorr TKorr commented Jan 27, 2026

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'

error[E0432]: unresolved import `backends::windows`
   --> C:\Users\runneradmin\.cargo\git\checkouts\stacker-7f63da2d59ff4c55\017540a\src\lib.rs:178:23
    |
178 |         use backends::windows::_grow;
    |                       ^^^^^^^ could not find `windows` in `backends`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `stacker` (lib) due to 1 previous error

TKorr added 4 commits January 27, 2026 15:55
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).
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.
@TKorr TKorr requested a review from nagisa January 28, 2026 01:12
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