Open gen-xu opened 4 months ago
Hey, sorry—afraid we're not able to offer support for cross compiling issues in general, and in particular cargo zigbuild
is not something we're familiar with. Happy to take a PR if you're able to debug this issue yourself, though. I'd start sniffing around here:
Perhaps cargo zigbuild
doesn't set the TARGET
environment variable as cargo build
does?
Hey, sorry—afraid we're not able to offer support for cross compiling issues in general, and in particular
cargo zigbuild
is not something we're familiar with. Happy to take a PR if you're able to debug this issue yourself, though. I'd start sniffing around here:Perhaps
cargo zigbuild
doesn't set theTARGET
environment variable ascargo build
does?
Thanks for reply and the hint, it does set the TARGET
correctly though
Metadata { host: "aarch64-apple-darwin", target: "aarch64-unknown-linux-musl", build_dir: "/Users/gen/rust-krb5-src/target/aarch64-unknown-linux-musl/debug/build/krb5-src-66a2027f1b8020ae/out/build", install_dir: "/Users/gen/rust-krb5-src/target/aarch64-unknown-linux-musl/debug/build/krb5-src-66a2027f1b8020ae/out/install" }
I tried comment out following lines in build.rs
and it worked afterwards for both cargo build --target aarch64-unknown-linux-musl
and cargo zigbuild --target aarch64-unknown-linux-musl
// If we're cross-compiling, let configure know.
if metadata.host != metadata.target {
configure_args.push(format!("--host={}", metadata.target));
}
Instead of comment out, I also tried just change the configre args push line into
configure_args.push(format!("--host={}", metadata.host));
this also worked for both cargo build --target aarch64-unknown-linux-musl
and cargo zigbuild --target aarch64-unknown-linux-musl
before this change neither commmands worked, created a PR for this
Host: macos arm64 Target: aarch64-unknown-linux-musl
when using zigbuild,
cargo zigbuild --target aarch64-unknown-linux-musl
for project that dependes onrdkafka
, so indirectly useskrb5
, the build fails with following error:that looks like it can't find
#include "kcmrpc.h"
, while this#include
is defined__APPLE__
section, which should be off when compiling target islinux-musl
Is this an issue in
krb5
build/configure ?