1
0
Fork 0
mirror of https://github.com/imjasonh/krust synced 2026-07-10 15:42:10 +00:00

Ensure Docker is available on all platforms and fix Windows cross-compilation

- Use docker/setup-buildx-action for consistent Docker setup across all platforms
- Fix Windows rust-lld configuration by using full path instead of command name
- Make Docker-dependent tests fail explicitly when Docker is not available
- Add proper Docker availability check in integration tests

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jason Hall 2025-06-07 21:47:46 -04:00
parent 06b9e37db9
commit 7a7f49c4a3
Failed to extract signature
3 changed files with 76 additions and 11 deletions

View file

@ -50,10 +50,42 @@ impl RustBuilder {
if cfg!(not(target_os = "linux")) && self.target.contains("linux") {
// Check if we have a musl cross-compiler available
if self.target.contains("x86_64-unknown-linux-musl") {
// On Windows, prefer rust-lld
// On Windows, use rust-lld with full path
if cfg!(target_os = "windows") {
cmd.env("CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER", "rust-lld");
debug!("Using linker: rust-lld");
// Get the rust sysroot to find rust-lld
let sysroot_output = Command::new("rustc")
.arg("--print")
.arg("sysroot")
.output()
.context("Failed to get rustc sysroot")?;
if sysroot_output.status.success() {
let sysroot = String::from_utf8_lossy(&sysroot_output.stdout)
.trim()
.to_string();
let rust_lld = PathBuf::from(&sysroot)
.join("lib")
.join("rustlib")
.join("x86_64-pc-windows-msvc")
.join("bin")
.join("rust-lld.exe");
if rust_lld.exists() {
cmd.env(
"CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER",
rust_lld.to_string_lossy().to_string(),
);
debug!("Using linker: {}", rust_lld.display());
} else {
// Fallback to just "rust-lld" and hope it's in PATH
cmd.env("CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER", "rust-lld");
debug!("Using linker: rust-lld (in PATH)");
}
} else {
// Fallback to just "rust-lld"
cmd.env("CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER", "rust-lld");
debug!("Using linker: rust-lld (fallback)");
}
} else {
// Try common linker names on other platforms
let linkers = if cfg!(target_os = "macos") {