Releases: ipetkov/crane
Releases · ipetkov/crane
v0.19.1
0.19.1 - 2024-10-12
Added
cargoDocTest
is now available as an alternative tocargoTest
which runs
only doc tests.
Changed
buildDepsOnly
now setsCRANE_BUILD_DEPS_ONLY
as an environment variable
when it runs. Build hooks can use this as a shortcut to determine whether
running inside of abuildDepsOnly
derivation in case they need to tailor
their behavior accordingly.
Fixed
- Vendoring dependencies avoids creating malformed TOML configurations in
situations where registry name/url definitions cannot be found. When this
happens a warning will be printed out during evaluation to highlight the
issue.
v0.19.0
0.19.0 - 2024-09-25
Added
taploFmt
is now available for checking TOML formatting
Changed
- Breaking (technically):
buildPackage
no longer addsjq
to
nativeBuildInputs
as doing so can result in rebuilding any*-sys
crates
which rely onPKG_CONFIG_PATH
remaining stable - Breaking:
downloadCargoPackageFromGit
now takeshash
instead of
sha256
when specifying an output hash for the download installFromCargoBuildLogHook
no longer assumes or requires thatjq
is
available on$PATH
and will instead directly referencepkgs.jq
downloadCargoPackageFromGit
will now setfetchLFS = true
when fetching git
repos with defined output hashes
Fixed
cargoDoc
correctly honorsdocInstallRoot
when specifiedcargoDoc
falls back to installing from./target/doc
even if
$CARGO_BUILD_TARGET
is set but./target/$CARGO_BUILD_TARGET/doc
does not
exist
Removed
- The deprecated top-level (flake) attribute
lib
no longer exists. Please use
mkLib
with an instance ofpkgs
instead.
v0.18.1
0.18.1 - 2024-08-22
Fixed
- Fixed vendoring dependencies from an alternative registry which they
themselves have dependencies on crates from other registries. - Fixed
cargoNextest
's positioning ofcargoExtraArgs
to form a valid command
invocation when specified.
v0.18.0
0.18.0 - 2024-07-05
Changed
- Breaking: dropped compatibility for Nix versions below 2.18.2
- Breaking: dropped compatibility for nixpkgs-23.11.
- The guidance around using (both)
cleanCargoSource
andpath
has been
updated. Namely, it is no longer necessary to call both (e.g.
craneLib.cleanCargoSource (craneLib.path ./.)
): it is recommended to either
usecraneLib.cleanCargoSource ./.
directly (if the default source cleaning
is desired) orcraneLib.path ./.
(if not). overrideToolchain
has been updated to better handle cross-compilation
splicing for a customized toolchain. This means thatoverrideToolchain
should now be called with a function which constructs said toolchain for any
givenpkgs
instantiation. For example:craneLib.overrideToolchain (p: p.rust-bin.stable.latest.default)
Fixed
- The cross compilation example also hows how to set the
TARGET_CC
environment
variable which may be required by some build scripts to function properly vendorCargoDeps
andcrateNameFromCargoToml
do their best to avoid IFD when
src
is the result oflib.cleanSourceWith
(and by extension
cleanCargoSource
)removeReferencesToVendoredSources
handles the edge case where
cargoVendorDir
does not point to a path within the Nix store- It is now possible to use
.overrideScope
to change what instance of
craneUtils
will be used during vendoring.
v0.17.3
v0.17.2
0.17.2 - 2024-05-26
Fixed
removeReferencesToVendoredSources
has been optimzed to search for source
references only once. For derivations which install many files, this phase can
run up to 99% faster than before.cleanCargoToml
now cleans underscored versions of the same attributes (e.g.
lib.proc-macro
andlib.proc_macro
)
v0.17.1
0.17.1 - 2024-05-19
Fixed
downloadCargoPackage
anddownloadCargoPackageFromGit
no longer run the
fixup phase by default, avoiding issues with source directories and files
being moved to different locationsdownloadCargoPackage
now unpacks and installs from a fresh directory,
avoiding having build environment files (likeenv-vars
) appearing in the
output
v0.17.0
0.17.0 - 2024-05-18
Added
cargoDoc
now supportsdocInstallRoot
to influence which directory will be
installed to$out/share
(which can be useful when cross-compiling). By
default$CARGO_TARGET_DIR
and$CARGO_BUILD_TARGET
(if set) will be taken
into accountcrateNameFromCargoToml
now supports selecting a derivation name by setting
package.metadata.crane.name
orworkspace.metadata.crane.name
in the root
Cargo.toml
vendorCargoDeps
,vendorCargoRegistries
,vendorGitDeps
, and
vendorMultipleCargoDeps
now support arbitrary overrides (i.e. patching) at
the individual crate/repo level when vendoring sources.
Changed
- Breaking
cargoAudit
no longer acceptscargoExtraArgs
(since it does
not support the regular set ofcargo
flags like most cargo-commands do, it
does not make much sense to propagate those flags through) buildTrunkPackage
now setsenv.TRUNK_SKIP_VERSION_CHECK = "true";
if not
specified
Deprecations
- In the future,
crateNameFromCargoToml
will stop considering
workspace.package.name
in the rootCargo.toml
when determining the crate
name. This attribute is not recognized by cargo (which will emit its own
warnings about it) and should be avoided going forward. - In the future,
crane.lib.${system}
will be removed. Please switch to using
(crane.mkLib nixpkgs.lib.${system})
as an equivalent alternative.