Skip to content

Conversation

@ludfjig
Copy link
Contributor

@ludfjig ludfjig commented Nov 25, 2025

  • Changed the OS check to use CARGO_CFG_TARGET_OS instead of #[cfg(target_os)]. This ensures the Windows-specific surrogate build logic runs correctly when cross-compiling from a Linux host.
  • Propagated the TARGET triple to the inner cargo build command so the surrogate binary is compiled for the correct target architecture.
  • Switched from output() to status() 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-gnu can 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

@ludfjig ludfjig added the kind/bugfix For PRs that fix bugs label Nov 25, 2025
simongdavies
simongdavies previously approved these changes Nov 25, 2025
Copy link
Contributor

@simongdavies simongdavies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, maybe add/update just recipes as well

@ludfjig ludfjig marked this pull request as ready for review November 25, 2025 21:08
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig ludfjig merged commit 336fb8e into hyperlight-dev:main Nov 25, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bugfix For PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants