nixpkgs/pkgs/build-support/rust
Andreas Rammhold 1b748554d5
buildRustCrate: add lib output
This cuts down the dependency tree on some rust builds where a crate not
just exposes a binary but also a library. `$out/lib` contained a bunch
of extra support files that among other information carry linker flags
(including the full path to link-time dependencies). Worst case this led
to some binary outputs depending on the full build closure of rust
crates.

Moving all the `$out/lib` files to `$lib/lib` solves this nicely.

`lib` might be a bit weird here as they are most of the time just rlib
files (rust libraries). Those are essential only required during
compilation but they can also be shared objects (like with traditional
C-style packages). Which is why I went with `lib` for the new output.

One of the caveats we are running into here is that we do not (always)
know ahead of time of a crate produces just a library or just a binary.
Cargo allows for some ambiguity regarding whether or not a crate
provides one, two, … binaries and libraries as it's outputs. Ideally we
would be able to rely on the `crateType` entirely but so far that isn't
the case. More work on that area might show how difficult that actually
is.
2019-11-26 15:05:01 +01:00
..
build-rust-crate buildRustCrate: add lib output 2019-11-26 15:05:01 +01:00
patch-registry-deps buildRustPackage: don't hardcode /nix/store, use $NIX_STORE 2016-01-12 13:45:11 -05:00
cargo-vendor-normalise.py fetchcargo: add type checking to cargo-vendor-normalise.py 2018-09-11 23:44:14 +02:00
carnix.nix Carnix: 0.9 -> 0.10 2019-03-26 18:54:28 +00:00
crates-io.nix treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
default-crate-overrides.nix cargo-vendor: drop 2019-09-22 20:20:20 -05:00
default.nix Merge pull request #71899 from decentriq/aslemmer/build-rust-package-add-target 2019-11-01 15:46:47 +00:00
fetchcargo-default-config.toml fectchcargo: don't break old sha256 2018-09-11 23:44:14 +02:00
fetchcargo.nix buildRustPackage: add verifyCargoDeps option 2019-09-30 17:09:52 +00:00
fetchcrate.nix add fetchCrate function to fetch rust crates 2017-12-12 04:58:45 -06:00