fix(grey): fix Windows build errors across all build.rs and node.rs#811
Open
liuxiayu12 wants to merge 2 commits into
Open
fix(grey): fix Windows build errors across all build.rs and node.rs#811liuxiayu12 wants to merge 2 commits into
liuxiayu12 wants to merge 2 commits into
Conversation
Three categories of Windows build errors were preventing compilation: 1. build.rs path escaping (all 4 build.rs files): PathBuf::display() emits Windows backslash separators which Rust's lexer interprets as escape sequences inside include_bytes! string literals (e.g. \b, \j, \s, \o). Fix by adding include_path() helpers to build-javm and build-pvm that replace backslashes with forward slashes. All 4 build.rs files (grey, spec-tests, javm-guest-tests, grey-bench) now use these helpers instead of .display(). 2. node.rs Unix-only signal handling: tokio::signal::unix is not available on Windows. The original code hardcoded SIGTERM, SIGUSR1, and SIGHUP signal registrations. Fix by wrapping Unix-specific signal registrations in #[cfg(unix)] and providing std::future::pending::<()>() placeholders on non-Unix platforms so the select! arms compile but are simply never selected. 3. Previous PR jarchain#783 only fixed grey/build.rs but missed spec-tests, javm-guest-tests, and grey-bench which have the same .display() bug. This PR fixes all 4 build.rs files uniformly through the build-javm/build-pvm helper approach. Testing: cargo build --workspace # passes on Windows cargo clippy -p grey -p build-javm -p build-pvm --all-targets -- -D warnings # 0 warnings cargo test -p javm # 133 passed, 0 failed cargo fmt --all -- --check # no diff
Contributor
Genesis ReviewComparison targets:
How to reviewPost a comment with the following format (rank from best to worst): Use the short commit hashes above and To meta-review another reviewer's comment, react with 👍 or 👎. |
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.
Summary
Fix three categories of Windows build errors that prevented compilation on Windows.
1. build.rs path escaping (all 4 build.rs files)
PathBuf::display()emits Windows backslash separators which Rust's lexer interprets as escape sequences insideinclude_bytes!string literals (e.g.\b,\j,\s,\o).Fix: Add
include_path()helpers tobuild-javmandbuild-pvmthat replace backslashes with forward slashes. All 4 build.rs files now use these helpers instead of.display():grey/crates/grey/build.rsgrey/services/spec-tests/build.rs? missed by fix(grey): fix Windows build errors in build.rs and node.rs #783grey/services/javm-guest-tests/build.rs? missed by fix(grey): fix Windows build errors in build.rs and node.rs #783grey/crates/grey-bench/build.rs? missed by fix(grey): fix Windows build errors in build.rs and node.rs #7832. node.rs Unix-only signal handling
tokio::signal::unixis not available on Windows. The original code hardcoded SIGTERM, SIGUSR1, and SIGHUP signal registrations.Fix: Wrap Unix-specific signal registrations in
#[cfg(unix)]and providestd::future::pending::<()>()placeholders on non-Unix platforms so theselect!arms compile but are simply never selected.3. Comparison with #783
PR #783 fixed
grey/build.rsandnode.rsbut missed the other 3 build.rs files that have the same.display()bug. This PR:build-javm/build-pvmhelper approachinclude_path()to bothbuild-javmandbuild-pvmcrates (the latter is used bygrey-bench)&Pathinstead of&PathBufto satisfy clippyTesting
Note: This is a Windows compatibility fix with no functional changes to Unix builds.