Fix cross-compilation of Windows surrogate binary on Linux#1045
Merged
ludfjig merged 1 commit intohyperlight-dev:mainfrom Nov 25, 2025
Merged
Fix cross-compilation of Windows surrogate binary on Linux#1045ludfjig merged 1 commit intohyperlight-dev:mainfrom
ludfjig merged 1 commit intohyperlight-dev:mainfrom
Conversation
33386a3 to
1cb3a78
Compare
simongdavies
previously approved these changes
Nov 25, 2025
Contributor
simongdavies
left a comment
There was a problem hiding this comment.
LGTM, maybe add/update just recipes as well
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
1cb3a78 to
e155ea6
Compare
simongdavies
approved these changes
Nov 25, 2025
vshailesh
pushed a commit
to vshailesh/hyperlight
that referenced
this pull request
Dec 7, 2025
…t-dev#1045) Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
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.
CARGO_CFG_TARGET_OSinstead of#[cfg(target_os)]. This ensures the Windows-specific surrogate build logic runs correctly when cross-compiling from a Linux host.TARGETtriple to the innercargo buildcommand so the surrogate binary is compiled for the correct target architecture.output()tostatus()for the inner build command. This ensures build errors are visible in the terminal and causes the main build to fail correctly if the surrogate build fails.After this pr, commands like
cargo clippy --target x86_64-pc-windows-gnucan be ran from a linux host without erroring out.The reason for doing this is that it is useful to be able to compile for windows on a linux host, for example to spot clippy issues without having to push to CI or try compiling on a different host machine. At least personally I often think I fixed all clippy errors, then CI spots some new ones when compiling for windows, and I'll have to go back and forth between machines