-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to parse target query : UnknownOperatingSystem
while cross-compiling under Bzlmod
#2529
Comments
I'm encountering the same issue ( An extremely hacky fix is to patch https://github.com/rust-lang/cc-rs to generate the targets your bazel configuration requires. |
This seems related: |
It doesn't look like upstream ( @mattbryant-asana do you have such a patch to |
Just ran into this as well. @minor-fixes here's a patch that seems to resolve the issue, at least for diff --git a/src/lib.rs b/src/lib.rs
index f75b951..8c143f7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2091,6 +2091,12 @@ impl Build {
target.versioned_llvm_target(None)
};
+ let llvm_target = llvm_target
+ .split("-")
+ .filter(|x| !x.contains("unknown"))
+ .collect::<Vec<_>>()
+ .join("-");
+
// Pass `--target` with the LLVM target to properly
// configure Clang even when cross-compiling.
cmd.push_cc_arg(format!("--target={llvm_target}").into()); |
Hi folks, I am experiencing yet a different issue with cross-compilation on my M1 Macbook targeting
linux-arm64
andlinux-amd64
. I have already reported #2518 while I tried to reproduce this error.This is the main error line I get from the
bazel build
output:Full output is here:
My
MODULE.bazel
setup:The targets I'm trying to build, in
backend/app/BUILD.bazel
:The text was updated successfully, but these errors were encountered: