summary refs log tree commit diff
path: root/pkgs/build-support/rust/build-rust-crate/lib.sh
Commit message (Collapse)AuthorAge
* buildRustCrate: fixup integration test mod nameMateusz Kowalczyk2023-01-14
| | | | | | | | | | | | | Fixes #204051. I have tried this on the reproducer stated in the ticket. ``` [nix-develop]$ $(nix-build -I nixpkgs=/home/shana/programming/nixpkgs --no-out-link)/tests/foo running 1 test test check_module_name ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s ```
* buildRustCrate: Support `cargo:rustc-link-arg` and some friends from build.rsJohn Ericson2022-11-30
| | | | | | | | | | | | | See https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-link-argfor details. We are supporting: - `cargo:rustc-link-arg` - `cargo:rustc-link-arg-bins` - `cargo:rustc-link-arg-lib` at this time. `cargo:rustc-link-arg-bin` is left as future work because the per-binary flag keeping is more difficult.
* buildRustCrate: pass link flags when building librariesBen Wolsieffer2022-06-14
| | | | | | | | With Rust 1.61, it is necessary to link to external static/dynamic libaries when building the rlib that uses them, rather than when linking the final binary. In fact, it is no longer necessary to specify the libraries to link when building the final binary, but the library search path flags must still be included.
* buildRustCrate: editorconfig fixeszowoq2020-08-09
|
* buildRustCrate: Add tests for checking files in outputs.Peter Kolloch2020-03-29
| | | | | ...and remove superfluous dependency files (*.d). ...and copy dSYM directories on Mac OS when in release=false mode.
* buildRustCrate: don't sort link flagsSymphorien Gibol2020-03-25
| | | | Linkage order is significant and sorting can result in link errors.
* buildRustCrate: only link build deps into build scriptDaniël de Kok2020-03-13
| | | | | | | | | | | | | | According to the Cargo documentation: > The build script does not have access to the dependencies listed in > the dependencies or dev-dependencies section (they’re not built > yet!). Also, build dependencies are not available to the package > itself unless also explicitly added in the [dependencies] table. https://doc.rust-lang.org/cargo/reference/build-scripts.html This change separates linkage of regular dependencies and build dependencies.
* build-support/rust/buildRustCrate: Search for matching Cargo.toml in sub ↵Peter Kolloch2020-03-09
| | | | | | | | | | | directories This is what cargo does for git repositories. See related issues: * https://github.com/kolloch/crate2nix/issues/53 * https://github.com/kolloch/crate2nix/issues/33
* buildRustCrate: refactor colored loggingPeter Kolloch2020-03-09
| | | | | | * Make errors include the crate name and make them much more prominent. * Move more code into lib.sh * Already source generated logging code and lib.sh in configure
* buildRustCrate: add `buildTests` flag to tell rustc to build tests instead ↵Andreas Rammhold2020-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of binaries This helps us instruct rustc to build tests instead of binaries. The actual build will then ONLY produce test executables. This is a first step towards having rust crate tests within nixpkgs. We default back to only a single output in test cases since that is the only reasonable thing to do here. Producing libraries or binaries in addition to tests would theoretically be feasible but usually generates different dependency trees. It is very common to have some libraries in `[dev-depdendencies]` within Cargo.toml just for your tests. To not start mixing things up going with a dedicated derivation for the test build sounds like the best choice for now. To use this you must provide a proper test dependency chain to `buildRustCrate` (as you would usually do with your non-test inputs). And then set the `buildTests` attribute to `true`. The derivation will then contain all tests that were built in `$out/tests`. All common test patterns and directories should be supported and tested by this change. Below is an example how you would run a single test from the derivation. This commit contains some more examples in the `buildRustCrateTests` attribute set that might be helpful. ``` let drv = buildRustCrate { … buildTests true; }; in runCommand "test-my-crate" {} '' touch $out exec ${drv}/tests/my-test '' ```
* buildRustCrate: move common build functions to a dedicated fileAndreas Rammhold2019-12-12
This means we aren't rebuilding hat file for each crate we are building and the buildPhase expression is a lot easier to comprehent.