Releases: ipetkov/crane
Releases · ipetkov/crane
v0.22.0
0.22.0 - 2025-12-26
Changed
- Breaking: dropped compatibility for Nix versions below 2.31.2
- Breaking: dropped compatibility for nixpkgs-25.05
remapPathPrefixHookis now do nothing when building on Darwin since the
current implementation results in validating build caches due to Nix behavior
differences between Linux and Darwin.
Fixed
mkCargoDerivationwill now setnoCompressDebugSectionsSetto disable
compressing debug sections (whenremapPathPrefixHookis active and running)
on platforms which do not support it
v0.21.3
0.21.3 - 2025-12-04
Added
- Add
remapSourcePathPrefixHook, which can map source code file paths to their
correct location within the Nix store. By default this hook will run for any
dontStrip = truebuilds, but can otherwise be controlled using
doRemapPathPrefix.
Fixed
downloadCargoPackageFromGitnow correctly includes any files listed in a
.ignorefile (but otherwise not listed in.gitignore) when unpacking git
checkouts.
v0.21.2
0.21.2 - 2025-11-07
Changed
mkDummySrcnow acceptsdummyBuildrsto customize the dummy source used for
build scripts specifically. If not specified, the value ofdummyrswill be
used, otherwise, the existing default dummy build script will be used.
Fixed
- Fix Windows pthreads being added to non-Windows platforms when cross compiling
v0.21.1
0.21.1 - 2025-09-24
Fixed
- The default dummy source used by
mkDummySrcnow additionally works for the
amdgputarget out of the box removeReferencesToRustToolchainHooknow handles exclusions case
insensitivelycleanCargoTomlnow retains targets'harnessattribute if definedcargoTest,cargoDocTest, andcargoNextestwill log a warning ifdoCheck = false;installCargoArtifactsHookgracefully handles (ignores) situations where no
cargo artifacts are generated by the derivation
v0.21.0
0.21.0 - 2025-07-19
Changed
- Breaking: dropped compatibility for Nix versions below 2.28.3
- Breaking: dropped compatibility for nixpkgs-24.11
- Windows cross builds provides pthreads as it is required for most crates.
registryFromSparsenow passesfetchurlExtraArgsto the initial query for the
registry'sconfig.json
v0.20.3
0.20.3 - 2025-04-23
Added
mkCrossToolchainEnvis now available for setting up some default
cross-compilation environment variables and derivation arguments
Changed
- Vendoring git dependencies now respects Cargo.toml
includesandexcludes mkCargoDerivationnow configures the cross-compilation toolchain by default
using the newly addedmkCrossToolchainEnvfunction. To select the utilized
cross compiler, thestdenvargument now also accepts a selector function,
taking an arbitrarypkgsinstantiation as an argument. This behavior can be
turned off by settingdoIncludeCrossToolchainEnv = false;.
v0.20.2
0.20.2 - 2025-03-08
Changed
craneUtils(used internally for vendoring git dependencies) now uses
importCargoLockto fetch its own dependencies instead of the (now
deprecated)fetchCargoTarballmethod.cleanCargoTomlnow preserves theproc-macroattribute of any defined
targets
Fixed
buildTrunkPackageno longer ignoresinstallPhaseandinstallPhaseCommandargs.mkDummySrcnow supports embedded proc-macros.removeReferencesToRustToolchainHooknow handles file names which contain
whitespaceremoveReferencesToVendoredSourcesHooknow handles file names which contain
whitespace
v0.20.1
0.20.1 - 2025-02-08
Added
cargoNextestnow supports passingcargoNextestPartitionsExtraArgsto each
cargo nextestpartition run.- Add self-reference
craneLibto crane lib instance. - Add
removeReferencesToRustToolchainHook, which, by default, removes
references to the Rust toolchain from all installed binaries
Changed
buildPackagenow includesremoveReferencesToRustToolchainHookas a native
dependency. To disable automatically removing references to the Rust
toolchain, setdoNotRemoveReferencesToRustToolchain = true;mkCargoDerivationnow will also append therustcpackage to the
derivation'snativeBuildInputs
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)