-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
crossSystem results in failed componentResolution #57
Comments
The error message is not quite clear here. It just failed to find any components with target
We actually hit the
No. Note that the overlay provides compiler itself, and the compiler is expected to be used in |
I would also rely on the rust-overlay in that case. Cargo2nix is duplicating the function unnecessarily (and likely even worse) |
I just opened the PR NixOS/nixpkgs#146274 to nixpkgs. |
Fixed in 7d10573 I added an example about how to cross compile to |
Beautiful |
I'm developing a cross compiling example and fixing up build & host offsets for the various build cases such as test.
You can see my cargo2nix branch here:
cargo2nix/cargo2nix#214
/examples/3-cross-compiling is the flake of interest. The overlay in /overlays is used to consume the /examples/3-cross-compiling/Cargo.nix in that example's flake file.
I can configure oxalica to give me a Rust toolchain capable of outputting
wasm32-wasi
, failing only when the stdenv lacks any final wasi linking capability.To get such a stdenv, I should configure a
crossPlatform
. However, when I do so, this overlay errors out with a failure to resolve components:I suspect that instead of host & target, the overlay should be using build & host. This hunk here using target caught my attention:
rust-overlay/rust-overlay.nix
Lines 99 to 118 in f0a3769
My current belief is that
target
is never used in nixpkgs except when crossing to make a compiler for a third platform, a rare case that can be abstracted out as implementation details for bootstrapping onto a new platform. Rust seems to use host-target terminology. Nix views these offsets as build-host. Backing up by one offset to build-host seems correct. Translation to Rust target triples would be unaffected.If I'm wrong about this, it will undermine my entire understanding of cross compilation, so I am eager to get to the truth 🐱
At present, everything is working fine for explicit or crossSystem configured targets like
aarch64-unknonwn-linux-gnu
which have lots of Rust components available. Only when targeting wasi, which only has arust-std
available for that target, do I get these component resolution errors.The text was updated successfully, but these errors were encountered: