Skip to content

Releases: ipetkov/crane

v0.22.0

26 Dec 19:02
v0.22.0
01bc1d4

Choose a tag to compare

0.22.0 - 2025-12-26

Changed

  • Breaking: dropped compatibility for Nix versions below 2.31.2
  • Breaking: dropped compatibility for nixpkgs-25.05
  • remapPathPrefixHook is 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

  • mkCargoDerivation will now set noCompressDebugSectionsSet to disable
    compressing debug sections (when remapPathPrefixHook is active and running)
    on platforms which do not support it

v0.21.3

05 Dec 03:11
v0.21.3
2b3a5a8

Choose a tag to compare

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 = true builds, but can otherwise be controlled using
    doRemapPathPrefix.

Fixed

  • downloadCargoPackageFromGit now correctly includes any files listed in a
    .ignore file (but otherwise not listed in .gitignore) when unpacking git
    checkouts.

v0.21.2

07 Nov 17:30
v0.21.2
c43a1f1

Choose a tag to compare

0.21.2 - 2025-11-07

Changed

  • mkDummySrc now accepts dummyBuildrs to customize the dummy source used for
    build scripts specifically. If not specified, the value of dummyrs will 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

25 Sep 00:23
v0.21.1
95d528a

Choose a tag to compare

0.21.1 - 2025-09-24

Fixed

  • The default dummy source used by mkDummySrc now additionally works for the
    amdgpu target out of the box
  • removeReferencesToRustToolchainHook now handles exclusions case
    insensitively
  • cleanCargoToml now retains targets' harness attribute if defined
  • cargoTest, cargoDocTest, and cargoNextest will log a warning if doCheck = false;
  • installCargoArtifactsHook gracefully handles (ignores) situations where no
    cargo artifacts are generated by the derivation

v0.21.0

19 Jul 17:45
v0.21.0
544d09f

Choose a tag to compare

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.
  • registryFromSparse now passes fetchurlExtraArgs to the initial query for the
    registry's config.json

v0.20.3

24 Apr 00:35
v0.20.3
efd3668

Choose a tag to compare

0.20.3 - 2025-04-23

Added

  • mkCrossToolchainEnv is now available for setting up some default
    cross-compilation environment variables and derivation arguments

Changed

  • Vendoring git dependencies now respects Cargo.toml includes and excludes
  • mkCargoDerivation now configures the cross-compilation toolchain by default
    using the newly added mkCrossToolchainEnv function. To select the utilized
    cross compiler, the stdenv argument now also accepts a selector function,
    taking an arbitrary pkgs instantiation as an argument. This behavior can be
    turned off by setting doIncludeCrossToolchainEnv = false;.

v0.20.2

09 Mar 00:26
v0.20.2
60202a2

Choose a tag to compare

0.20.2 - 2025-03-08

Changed

  • craneUtils (used internally for vendoring git dependencies) now uses
    importCargoLock to fetch its own dependencies instead of the (now
    deprecated) fetchCargoTarball method.
  • cleanCargoToml now preserves the proc-macro attribute of any defined
    targets

Fixed

  • buildTrunkPackage no longer ignores installPhase and installPhaseCommand args.
  • mkDummySrc now supports embedded proc-macros.
  • removeReferencesToRustToolchainHook now handles file names which contain
    whitespace
  • removeReferencesToVendoredSourcesHook now handles file names which contain
    whitespace

v0.20.1

08 Feb 22:20
v0.20.1
112e659

Choose a tag to compare

0.20.1 - 2025-02-08

Added

  • cargoNextest now supports passing cargoNextestPartitionsExtraArgs to each
    cargo nextest partition run.
  • Add self-reference craneLib to crane lib instance.
  • Add removeReferencesToRustToolchainHook, which, by default, removes
    references to the Rust toolchain from all installed binaries

Changed

  • buildPackage now includes removeReferencesToRustToolchainHook as a native
    dependency. To disable automatically removing references to the Rust
    toolchain, set doNotRemoveReferencesToRustToolchain = true;
  • mkCargoDerivation now will also append the rustc package to the
    derivation's nativeBuildInputs

v0.20.0

21 Dec 19:25
v0.20.0
72e2d02

Choose a tag to compare

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 with buildPackage you may need to ensure the additional
    post build hook defined in installFromCargoBuildLogHook runs (or follow the
    error messages to resolve any build issues).
  • mkDummySrc has been reworked to match cargo's autobin detection logic,
    meaning that only real binary targets defined by the project will be dummified
    if they exist (no more injecting src/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

  • mkDummySrc will deduplicate discovered and declared binary targets when
    dummifying sources
  • crateNameFromCargoToml will ignore store contexts when parsing a Cargo.toml
    file (avoiding errors like the string ... is not allowed to refer to a store path).
  • vendorGitDeps will perform a basic URL-decoding of git dependency entries in
    the Cargo.lock file since lockfiles now encode special characters starting
    at version 4

Meta

v0.19.4

30 Nov 18:18
v0.19.4
a031189

Choose a tag to compare

0.19.4 - 2024-11-30

Fixed

  • removeReferencesToVendoredSources now deduplicates any found references to
    avoid pathological memory usage before removing them.
  • buildDepsOnly will calculate fallback pname/version/cargoVendorDir
    attributes using dummySrc if it was specified (rather than attempting to use
    src)