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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Host Platform build.rs for Cross Build #214
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
7887b8c
to
9c6fd2f
Compare
9c6fd2f
to
3e3ba54
Compare
Latest changes add explicit target configuration. I think we need to split up the For C deps, there may be more work in the form of providing a linker or some lib without bringing in a whole stdenv.
|
There's two places we translate between nix platforms & rust triples. I'm working on web assembly right now. List of triples Rust probably comprehends (at least a bit) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Evidently there is now a |
This comment has been minimized.
This comment has been minimized.
036c1ed
to
8eb3261
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
moving static-resources -> cross-compiling This tests the feature correctness of cross builds point to nixpkgs master for the wasi build. Because of an upstream fix to toRustTriple
This stuff was from back when there was some kind of airplain mode. It would replace the remote registry with a local registry. Marginal use if you have the crate sources in your cache.
This change enables overriding the target for rustc, making it build different than whatever `crossPlatform` and `platform` would otherwise go for. The rust toolchain may not have such a target, so this feature is incomplete where the rust toolchain needs to be selected with one target and told to build for another (because it's a target that toolchain can be configured to cross for) Builds for cross should build identically if the target is set explicitly to the same value as the crossSystem config. note about explicit target
This function's entire job is to convert the nix triple to a rust triple. "real" was confusing. "Real" to what? It's also not always used to map a host triple and sometimes was used to map a build triple. The world is a bit better now. Second, the generation of the synthetic Cargo.toml used to build each crate drv in mkcrate.nix was using a combination of rustTriple and the explicit target override. That has been slightly normalized. There is still a problem in pkgsBuild in make-package-set/simple.nix. I don't think the explicit target we set for the host output needs to even touch the depsBuildBuild outputs. The detection for when to enable multiple targets when generating the Cargo.toml for build was changed to compare the two triples we generate. This means even if crossSystem is not set but the explicit target is used, the difference will be picked up and both target entries will be present in the toml. I'm concerned about the CC flags becuase it may mean we provide a triple that Rust understands and the cc cannot. This is especially true if the explicit target is provided by the user.
Rust supports a ton of platforms. At least the stuff with crossSystem examples should work. Some of these like wasm64 are pure fantasy until Rust supports it.
null out explicit target for build packages so that it doesn't become an explicit override
Use nixpkgs-<version>-darwin for darwin builds And logic gate the Rust Analyzer build so that only successful operating systems are used use local cargo2nix in exmaples. This is overriden by CI use darwin nixpkgs for all examples update cachix action Flakes are built in as of 15. Using authenticated requests was on the updated README. Much, much better.
Breaks the linking behavior. Could instead just not st the linker. More testing needed with better examples.
More generated Explicit target from latest overlay breaks them update generated clean this out of the final history update-generated updated generated
9b3ebcf
to
56f4c26
Compare
They can't build things
This PR strips out the
localFilters
because:I used the static resources example and just built with cargo to get a target dir. Zero effect on the resutls of nix builds.
target
did not need to be filtered from sources. Flakes 馃コSo Example 3 is Now Cross-Compiling!
The third example's use of a build.rs script is perfect for debugging the host and build platform offsets. We will fix everything. 馃憡
The cross compiling example with wasi linking can now be compiled on Linux and run with
wasmtime
Lets fix....
wasm32-unknown-unknown
聽#203