summary refs log tree commit diff
path: root/pkgs/build-support/rust/build-rust-crate/build-crate.nix
Commit message (Collapse)AuthorAge
* Carnix: 0.7.2 -> 0.8.10 (#40587)Pierre-Etienne Meunier2018-10-28
| | | Carnix: splits input into two parts: creates from creates.io and local ones
* buildRustCrate: added some edge cases with binariesAndreas Rammhold2018-09-13
| | | | | | | This commit adds test based on real-world crates (brotli). There were a few more edge cases that were missing beforehand. Also it turned out that we can get rid of the `finalBins` list since that will now be handled during runtime.
* buildRustCrate: binary heuristic should be able to treat spacesAndreas Rammhold2018-09-13
|
* buildRustCrate: add heuristic to picking the right source filesAndreas Rammhold2018-09-13
Cargo has a few odd (old) ways of picking source files if the `bin.path` attribute isn't given in the Cargo.toml. This commit adds support for some of those. The previous behaviour always defaulted to `src/main.rs` which was not always the right choice. Since there is look-ahead into the unpacked sources before running the actual builder the path selection logic has to be embedded within the build script. `buildRustCrate` currently supports two ways of running building binaries when processing a crate: - Explicit definition of all the binaries (& optionally the paths to their respective `main.rs`) and, - if not binary was explictly configured all files matching the patterns `src/main.rs`, `src/bin/*.rs`. When the explicit list is given without path information paths are now being picked from a list of candidates. The first match wins. The order is the same as within the cargo compatibility code. If the crate does not provide any libraries the path `src/{bin_name}.rs` is also considered. All underscores within the binary names are translated into dashes (`-`) before the lookups are made. This seems to be a common convention.