mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-22 23:17:15 +03:00
A Nix library for building cargo projects. Never build twice thanks to incremental artifact caching.
4c1711399d
* The intention here is to split up different "responsibilities" into smaller parts which can be composed as a DAG rather than mutually recursive functions. Specifically: * `mkCargoDerivation` represents a lower-level thin wrapper around `stdenv.mkDerivation` which will - set up hooks - require the caller to define the variables needed by the hooks (like vendor dir, or artifacts to inherit) - ensure that build/check/install phases can be configured by the caller without having them remember to call pre/post hooks * This allows `buildDepsOnly` to only focus on setting some default values (like good default commands to build all artifacts, setting the derivation name, etc.) and delegating the rest to `mkCargoDerivation` * Lastly, the responsibility of `buildWithCargo` ends up ensuring that `cargoArtifacts` and `cargoVendorDir` are defined if the caller does not pass them in |
||
---|---|---|
checks | ||
lib | ||
pkgs | ||
tests | ||
.envrc | ||
.gitignore | ||
default.nix | ||
flake.lock | ||
flake.nix | ||
runTests.sh |