Releases: ipetkov/crane
Releases · ipetkov/crane
v0.14.0
0.14.0 - 2023-09-21
Added
- Added
devShell
, a thin wrapper aroundpkgs.mkShell
which automatically
providescargo
andrustc
. - Added the ability to specify output hashes of git dependencies for fully
offline evaluations. TheoutputHashes
attribute can now be optionally
specified invendorCargoDeps
,vendorGitDeps
,vendorMultipleCargoDeps
, or
anything else which delegates to them.
Changed
- Breaking (technically):
buildDepsOnly
,buildPackage
,cargoBuild
,
cargoClippy
,cargoDoc
,cargoLlvmCov
, andcargoTest
's defaults have
been changed such that ifcargoExtraArgs
have not been set, a default value
of--locked
will be used. This ensures that a project's committed
Cargo.lock
is exactly what is expected (without implicit changes at build
time) but this may end up rejecting builds which were previously passing. To
get the old behavior back, setcargoExtraArgs = "";
- Breaking:
cargoDoc
will no longer install cargo artifacts by default.
SetdoInstallCargoArtifacts = true;
to get the old behavior back. cargoDoc
will now install generated documentation in$out/share/doc
- Fixed a bug when testing proc macro crates with
cargoNextest
on macOS.
(#376) - Replaced various internal usages of
runCommandLocal
withrunCommand
for
more optimal behavior when downloading cached artifacts
v0.13.1
0.13.1 - 2023-08-22
Changed
buildTrunkPackage
will now usedart-sass
instead ofnodePackages.sass
- Vendoring git dependencies will now always resolve symlinks inside of a
crate's directory. This allows for symlinks inside of a crate's directory to
possibly refer to files at the root of the git repo itself (via symlink) and
have those contents preserved during vendoring.
v0.13.0
0.13.0 - 2023-08-07
Added
buildPackage
now supports installingdylib
targets- Added support for sparse registries
Changed
- Breaking: dropped compatibility for Nix versions below 2.13.3
- Breaking: dropped compatibility for nixpkgs-22.05. nixpkgs-23.05 and
- Breaking (technically): if
buildPackage
is called without setting
cargoArtifacts
, the defaultbuildDepsOnly
invocation will now stop running
any installation hooks - Breaking (technically):
buildPackage
no longer installs cargo binary
dependencies (i.e. when thebindeps
feature is used) by default inheritCargoArtifactsHook
will now symlink dependency.rlib
and.rmeta
files. This means that derivations which reuse existing cargo artifacts will
run faster as fewer files (and bytes!) need to be copied around. To disable
this behavior, setdoNotLinkInheritedArtifacts = true;
.cargoTarpaulin
will now setdoNotLinkInheritedArtifacts = true;
unless
otherwise specified- Update
crane-utils
dependencies for successful build in nightly Rust (2023-06-28)
v0.12.2
v0.12.1
0.12.1 - 2023-04-10
Added
vendorMultipleCargoDeps
can now be used to vendor crates from multiple
distinctCargo.lock
files. Notably this allows for building the standard
library (via-Z build-std
or equivalent) since both the project's
and the Rust toolchain'sCargo.lock
files can be vendored together
Changed
vendorCargoRegistries
now accepts aregistries
parameter from the caller.
If not specified, it will be computed viacargoConfigs
. AlsocargoConfigs
is now an optional parameter which will default to[]
if not specified.
Fixed
vendorCargoDeps
correctly accepts arguments which have not setsrc
, so
long as one ofcargoLock
,cargoLockContents
, orcargoLockParsed
is set
v0.12.0
0.12.0 - 2023-03-19
Added
- Add a stubbed binary target to each "dummy" crate generated to support
"artifact dependencies" nightly feature
in case a crate is used asbin
artifact dependency. - Add
cargoLlvmCov
to runcargo llvm-cov
- Add
cargoLockParsed
option tovendorCargoDeps
to supportCargo.lock
files parsed as nix attribute sets. craneLib.path
can now be used as a convenience wrapper on (or drop in
replacement of)builtins.path
to ensure reproducible results whenever paths
like./.
or./..
are used directly.
Changed
- Breaking (technically):
mkCargoDerivation
will remove the following
attributes before lowering tomkDerivation
:cargoLock
,cargoLockContents
andcargoLockParsed
. If your derivation needs these values to be present
they can be explicitly passed through via.overrideAttrs
buildDepsOnly
asdummySrc
will take priority - The API docs have been updated to refer to
craneLib
(instead of justlib
)
to avoid ambiguities withpkgs.lib
. - cargo is now invoked with
--release
when$CARGO_PROFILE == release
instead
of passing in--profile release
to better support tools which do not
understand the latter
Fixed
- Fixed support for projects depending on crates utilising per-target workspace dependencies.
v0.11.3
0.11.3 - 2023-02-19
Fixed
- Fixed an unintentional cache invalidation whenever
buildDepsOnly
would run
on an unfiltered source (likesrc = ./.;
).
Changed
- A warning will now be emitted if a derivation's
pname
orversion
attributes are not set and the value cannot be loaded from the derivation's
rootCargo.toml
. To resolve it consider settingpname = "...";
orversion = "...";
explicitly on the derivation. - A warning will now be emitted if
src
anddummySrc
are passed to
buildDepsOnly
asdummySrc
will take priority
v0.11.2
v0.11.1
0.11.1 - 2023-01-21
Changed
- Documented and made it easier to build a cargo workspace located in a
subdirectory of the source root
Fixed
- Previously compiled build scripts now maintain their executable bit when
inherited - Workspace inheritance in git dependencies is now correctly handled
v0.11.0
0.11.0 - 2022-12-26
Added
- Documentation is now available at crane.dev
Changed
- Breaking: dropped compatibility for Nix versions below 2.11.0
- Breaking: dropped compatibility for nixpkgs-22.05. nixpkgs-22.11 and
nixpkgs-unstable are fully supported - Zstd compression of cargo artifacts now defaults to using as many cores as
$NIX_BUILD_CORES
allows for (or all available cores if it isn't defined) - Dummy sources now attempt to use the same name as their original source (minus
the Nix store path and hash) to minimize errors with build scripts which
expect their full path to not change between runs