Releases: ipetkov/crane
Releases · ipetkov/crane
v0.20.0
0.20.0 - 2024-12-21
Changed
- Breaking: dropped compatibility for Nix versions below 2.24.10
- Breaking: dropped compatibility for nixpkgs-23.11
- Breaking (technically):
buildPackage's installation behavior has been
split into two steps: binaries are now installed into a temporary directory as
a post build hook (to avoid interference from the check phase clobbering
resultant binaries with development features enabled) followed by an actual
installation (from said directory) during the install phase. If you use a
custom build phase withbuildPackageyou may need to ensure the additional
post build hook defined ininstallFromCargoBuildLogHookruns (or follow the
error messages to resolve any build issues). mkDummySrchas been reworked to match cargo'sautobindetection logic,
meaning that only real binary targets defined by the project will be dummified
if they exist (no more injectingsrc/bin/crane-dummy-*). This does mean that
adding a new bin target definition will invalidate caches and require
rebuilding all dependencies once more. (If this is a frequent enough
occurrence for your project to cause headaches, please open an issue!)
Fixed
mkDummySrcwill deduplicate discovered and declared binary targets when
dummifying sourcescrateNameFromCargoTomlwill ignore store contexts when parsing a Cargo.toml
file (avoiding errors likethe string ... is not allowed to refer to a store path).vendorGitDepswill perform a basic URL-decoding of git dependency entries in
theCargo.lockfile since lockfiles now encode special characters starting
at version 4
Meta
- Dropped support for publishing releases to https://flakestry.dev/
v0.19.4
0.19.4 - 2024-11-30
Fixed
removeReferencesToVendoredSourcesnow deduplicates any found references to
avoid pathological memory usage before removing them.buildDepsOnlywill calculate fallbackpname/version/cargoVendorDir
attributes usingdummySrcif it was specified (rather than attempting to use
src)
v0.19.3
0.19.3 - 2024-11-18
Added
- Added a number of fileset helpers to more easily compose source filtering:
fileset.cargoTomlAndLock: forCargo.tomlandCargo.lockfilesfileset.commonCargoSources: for files commonly used by cargo projectsfileset.configToml: forconfig.tomlfilesfileset.rust: for*.rsfilesfileset.toml: for*.tomlfiles
Fixed
buildTrunkPackagewill pass in--release=true(instead of just
--release) for trunk versions 0.21 or higher to avoid argument ambiguitiesbuildTrunkPackagewill now correctly honorbuildPhaseCargoCommandif
specified (previously the value ofbuildPhaseCommandwas incorrectly being
used)removeReferencesToVendoredSourcesHookavoids referencing/dev/fd
directly since it may not be present on certain platforms
v0.19.1
0.19.1 - 2024-10-12
Added
cargoDocTestis now available as an alternative tocargoTestwhich runs
only doc tests.
Changed
buildDepsOnlynow setsCRANE_BUILD_DEPS_ONLYas an environment variable
when it runs. Build hooks can use this as a shortcut to determine whether
running inside of abuildDepsOnlyderivation 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
taploFmtis now available for checking TOML formatting
Changed
- Breaking (technically):
buildPackageno longer addsjqto
nativeBuildInputsas doing so can result in rebuilding any*-syscrates
which rely onPKG_CONFIG_PATHremaining stable - Breaking:
downloadCargoPackageFromGitnow takeshashinstead of
sha256when specifying an output hash for the download installFromCargoBuildLogHookno longer assumes or requires thatjqis
available on$PATHand will instead directly referencepkgs.jqdownloadCargoPackageFromGitwill now setfetchLFS = truewhen fetching git
repos with defined output hashes
Fixed
cargoDoccorrectly honorsdocInstallRootwhen specifiedcargoDocfalls back to installing from./target/doceven if
$CARGO_BUILD_TARGETis set but./target/$CARGO_BUILD_TARGET/docdoes not
exist
Removed
- The deprecated top-level (flake) attribute
libno longer exists. Please use
mkLibwith an instance ofpkgsinstead.
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 ofcargoExtraArgsto 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)
cleanCargoSourceandpathhas 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). overrideToolchainhas 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
givenpkgsinstantiation. For example:craneLib.overrideToolchain (p: p.rust-bin.stable.latest.default)
Fixed
- The cross compilation example also hows how to set the
TARGET_CCenvironment
variable which may be required by some build scripts to function properly vendorCargoDepsandcrateNameFromCargoTomldo their best to avoid IFD when
srcis the result oflib.cleanSourceWith(and by extension
cleanCargoSource)removeReferencesToVendoredSourceshandles the edge case where
cargoVendorDirdoes not point to a path within the Nix store- It is now possible to use
.overrideScopeto change what instance of
craneUtilswill be used during vendoring.
v0.17.3
v0.17.2
0.17.2 - 2024-05-26
Fixed
removeReferencesToVendoredSourceshas 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.cleanCargoTomlnow cleans underscored versions of the same attributes (e.g.
lib.proc-macroandlib.proc_macro)
v0.17.1
0.17.1 - 2024-05-19
Fixed
downloadCargoPackageanddownloadCargoPackageFromGitno longer run the
fixup phase by default, avoiding issues with source directories and files
being moved to different locationsdownloadCargoPackagenow unpacks and installs from a fresh directory,
avoiding having build environment files (likeenv-vars) appearing in the
output