2022-01-18 02:01:21 +03:00
|
|
|
# Crane
|
|
|
|
|
2022-12-27 01:27:13 +03:00
|
|
|
A [Nix] library for building [cargo] projects.
|
2022-01-18 02:01:21 +03:00
|
|
|
|
2022-01-22 22:47:18 +03:00
|
|
|
* **Source fetching**: automatically done using a Cargo.lock file
|
2022-01-24 01:52:16 +03:00
|
|
|
* **Incremental**: build your workspace dependencies just once, then quickly lint,
|
|
|
|
build, and test changes to your project without slowing down
|
2022-01-18 02:01:21 +03:00
|
|
|
* **Composable**: split builds and tests into granular steps. Gate CI without
|
|
|
|
burdening downstream consumers building from source.
|
|
|
|
|
2022-01-19 07:51:11 +03:00
|
|
|
## Features
|
|
|
|
|
|
|
|
* Automatic vendoring of dependencies in a way that works with Nix
|
2022-01-31 02:06:46 +03:00
|
|
|
- Alternative cargo registries are supported (with a minor configuration
|
|
|
|
change)
|
2022-02-12 07:33:11 +03:00
|
|
|
- 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.
|
2022-01-19 07:51:11 +03:00
|
|
|
* Reusing dependency artifacts after only building them once
|
2022-12-27 01:27:13 +03:00
|
|
|
* [clippy] checks
|
|
|
|
* [rustfmt] checks
|
2023-11-06 00:13:22 +03:00
|
|
|
* [cargo-doc] generation
|
|
|
|
* And support for a number of popular tools such as:
|
|
|
|
- [cargo-audit]
|
|
|
|
- [cargo-deny]
|
|
|
|
- [cargo-llvm-cov]
|
|
|
|
- [cargo-nextest]
|
|
|
|
- [cargo-tarpaulin]
|
|
|
|
- [trunk]
|
2022-01-18 02:01:21 +03:00
|
|
|
|
|
|
|
## Getting Started
|
|
|
|
|
|
|
|
The easiest way to get started is to initialize a flake from a template:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
# Start with a comprehensive suite of tests
|
|
|
|
nix flake init -t github:ipetkov/crane#quick-start
|
|
|
|
```
|
|
|
|
|
2022-12-27 01:55:25 +03:00
|
|
|
Otherwise check out the [examples and templates] for more detailed examples. An
|
|
|
|
[API Reference] is also available.
|
2022-01-18 02:01:21 +03:00
|
|
|
|
2022-01-31 03:26:55 +03:00
|
|
|
## 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.
|
|
|
|
|
2022-01-18 02:05:45 +03:00
|
|
|
## License
|
|
|
|
|
2022-12-27 01:55:25 +03:00
|
|
|
This project is licensed under the MIT license.
|
2022-01-18 02:05:45 +03:00
|
|
|
|
|
|
|
### 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.
|
|
|
|
|
2022-12-27 01:55:25 +03:00
|
|
|
[API reference]: https://crane.dev/API.html
|
2022-12-27 01:27:13 +03:00
|
|
|
[cargo-audit]: https://rustsec.org/
|
2023-11-06 00:13:22 +03:00
|
|
|
[cargo-deny]: https://github.com/EmbarkStudios/cargo-deny
|
|
|
|
[cargo-doc]: https://doc.rust-lang.org/cargo/commands/cargo-doc.html
|
2022-12-27 01:27:13 +03:00
|
|
|
[cargo]: https://doc.rust-lang.org/cargo/
|
2023-11-06 00:13:22 +03:00
|
|
|
[cargo-llvm-cov]: https://github.com/taiki-e/cargo-llvm-cov
|
2022-12-27 01:27:13 +03:00
|
|
|
[cargo-nextest]: https://nexte.st/
|
|
|
|
[cargo-tarpaulin]: https://github.com/xd009642/tarpaulin
|
2022-01-31 03:26:55 +03:00
|
|
|
[CHANGELOG]: ./CHANGELOG.md
|
2022-12-27 01:27:13 +03:00
|
|
|
[clippy]: https://github.com/rust-lang/rust-clippy
|
2022-01-18 02:01:21 +03:00
|
|
|
[custom-toolchain]: ./examples/custom-toolchain/flake.nix
|
2022-12-27 01:55:25 +03:00
|
|
|
[examples and templates]: https://crane.dev/getting-started.html
|
2022-01-31 03:26:55 +03:00
|
|
|
[niv]: https://github.com/nmattia/niv
|
2022-12-27 01:27:13 +03:00
|
|
|
[Nix]: https://nixos.org/
|
|
|
|
[rustfmt]: https://github.com/rust-lang/rustfmt
|
2022-01-31 03:26:55 +03:00
|
|
|
[Semantic Versioning]: http://semver.org/spec/v2.0.0.html
|
2023-04-29 22:34:39 +03:00
|
|
|
[Trunk]: https://trunkrs.dev/
|