crane/docs
Ivan Petkov 4dcf584de1
mkCargoDerivation: replace Cargo.lock with contents of cargoLock (#425)
* The vendoring helpers already accept a `cargoLock` override, so
  automatically linking it in the derivation (if set) makes it a bit
  easier without having the caller manually do the link themselves
2023-10-15 01:42:24 +00:00
..
advanced docs: document using overrideScope' (#303) 2023-04-16 20:55:46 +00:00
examples Add example of E2E testing (#368) 2023-10-12 18:59:36 -07:00
faq Add FAQ about proc-macro rebuilds in dev mode (#388) 2023-09-18 03:22:10 +00:00
introduction Add path as a convenience wrapper around builtins.path (#273) 2023-03-19 20:57:15 -07:00
.gitignore Add Crane book (#199) 2022-12-26 14:27:13 -08:00
API.md mkCargoDerivation: replace Cargo.lock with contents of cargoLock (#425) 2023-10-15 01:42:24 +00:00
book.toml book: add CNAME 2022-12-26 14:37:04 -08:00
CHANGELOG.md book: fix references 2022-12-26 14:55:25 -08:00
custom_cargo_commands.md Add path as a convenience wrapper around builtins.path (#273) 2023-03-19 20:57:15 -07:00
customizing_builds.md Fix postInstall name (#406) 2023-10-01 01:41:26 +00:00
getting-started.md Add example of E2E testing (#368) 2023-10-12 18:59:36 -07:00
highlight.js Add Crane book (#199) 2022-12-26 14:27:13 -08:00
introduction.md Add Crane book (#199) 2022-12-26 14:27:13 -08:00
local_development.md Add devshell helper (#378) 2023-09-03 10:33:10 -07:00
README.md book: fix references 2022-12-26 14:55:25 -08:00
source-filtering.md docs: typo lib.filterCargoSources -> craneLib.filterCargoSources (#326) 2023-05-19 03:57:50 +00:00
SUMMARY.md Add example of E2E testing (#368) 2023-10-12 18:59:36 -07:00

Crane

A Nix library for building cargo projects.

  • Source fetching: automatically done using a Cargo.lock file
  • Incremental: build your workspace dependencies just once, then quickly lint, build, and test changes to your project without slowing down
  • Composable: split builds and tests into granular steps. Gate CI without burdening downstream consumers building from source.

Features

  • Automatic vendoring of dependencies in a way that works with Nix
    • Alternative cargo registries are supported (with a minor configuration change)
    • Git dependencies are automatically supported without additional configuration.
      • Cargo retains the flexibility to only use these dependencies when they are actually needed, without forcing an override for the entire workspace.
  • Reusing dependency artifacts after only building them once
  • clippy checks
  • rustfmt checks
  • cargo-audit for vulnerability scanning
  • cargo-nextest a next-generation test runner
  • cargo-tarpaulin for code coverage
  • trunk for wasm frontend apps

Getting Started

The easiest way to get started is to initialize a flake from a template:

# Start with a comprehensive suite of tests
nix flake init -t github:ipetkov/crane#quick-start

Otherwise check out the examples and templates for more detailed examples. An API Reference is also available.

Compatibility Policy

Breaking changes can land on the master branch at any time, so it is recommended you use a versioning strategy when consuming this library (for example, using something like flakes or niv).

Tagged releases will be cut periodically and changes will be documented in the CHANGELOG. Release versions will follow Semantic Versioning.

The test suite is run against the latest stable nixpkgs release, as well as nixpkgs-unstable. Any breakage on those channels is considered a bug and should be reported as such.

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion by you, shall be licensed as MIT, without any additional terms or conditions.