1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-26 15:41:40 +00:00
nixpkgs/pkgs
Andreas Rammhold 0c50140da5 buildRustCrate: add heuristic to picking the right source files
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.
2018-09-13 20:28:39 +02:00
..
applications tor-browser-bundle-bin: stdenv.shell -> runtimeShell in wrapper 2018-09-13 17:45:50 +02:00
build-support buildRustCrate: add heuristic to picking the right source files 2018-09-13 20:28:39 +02:00
common-updater
data all-cabal-hashes: update snapshot to Hackage at 2018-09-12T08:26:27Z 2018-09-12 10:35:02 +02:00
desktops deepin-image-viewer: init at 1.2.23 2018-09-11 15:33:05 +02:00
development Merge pull request #46602 from xeji/p/zodb 2018-09-13 16:55:03 +01:00
games arx-libertatis: 2017-10-30 -> 2018-08-26 (#46039) 2018-09-10 22:08:48 +02:00
misc Merge pull request #46566 from Mic92/ncm2 2018-09-13 18:36:41 +01:00
os-specific Merge pull request #46426 from clefru/zfs-bump 2018-09-11 05:06:29 +00:00
servers Merge pull request #46614 from mayflower/atlassian-update 2018-09-13 19:52:59 +02:00
shells zsh-history-substring-search: init at 1.0.1 2018-09-11 13:59:54 +01:00
stdenv Merge pull request #46148 from obsidiansystems/plain-system-host 2018-09-06 09:37:20 -04:00
test
tools Merge pull request #46593 from ryantm/aliases 2018-09-13 16:15:43 +02:00
top-level tor-browser-bundle-bin: parameterize icon theme 2018-09-13 17:45:49 +02:00