Skip to content

Releases: ipetkov/crane

v0.9.0

29 Oct 17:23
v0.9.0
f48777a
Compare
Choose a tag to compare

0.9.0 - 2022-10-29

Changed

  • Breaking: all setup hooks have been removed from the packages flake
    output. They can still be accessed via the lib flake output.
  • Breaking: cargoBuild now only runs cargo build in a workspace, tests
    are no longer run
  • Breaking: buildDepsOnly does not automatically imply the --all-targets
    flag when invoking cargo check. Use cargoCheckExtraArgs to control this
  • buildDepsOnly now accepts cargoCheckExtraArgs for passing additional
    arguments just to the cargo check invocation. By default --all-targets
    will be used
  • buildDepsOnly now accepts cargoTestExtraArgs for passing additional
    arguments just to the cargo test invocation
  • buildPackage now delegates to mkCargoDerivation instead of cargoBuild

Fixed

  • crateNameFromCargoToml now takes workspace inheritance into account. If a
    crate does not specify package.version in its (root) Cargo.toml but does
    specify workspace.package.version then the latter will be returned.
  • Freestanding (#![no_std]) targets are now supported

v0.8.0

09 Oct 21:11
v0.8.0
f2a92d6
Compare
Choose a tag to compare

0.8.0 - 2022-10-09

Added

  • cargoTest can now be used for only running the tests of a workspace

Changed

  • Breaking (technically): build hooks now expect helper tools (like cargo,
    jq, zstd, etc.) to be present on the path instead of substituting a
    reference to a (possibly different) executable in the store.
  • mkCargoDerivation now automatically vendors dependencies if cargoVendorDir
    is not defined
  • mkCargoDerivation now automatically populates pname and version (via
    crateNameFromCargoToml) if they are not specified
  • mkCargoDerivation now defaults to an empty checkPhaseCargoCommand if not
    specified
  • cargoAudit now delegates to mkCargoDerivation instead of cargoBuild
  • cargoClippy now delegates to mkCargoDerivation instead of cargoBuild
  • cargoDoc now delegates to mkCargoDerivation instead of cargoBuild
  • cargoFmt now delegates to mkCargoDerivation instead of cargoBuild
  • cargoNextest now delegates to mkCargoDerivation instead of cargoBuild
  • cargoTarpaulin now delegates to mkCargoDerivation instead of cargoBuild

Fixed

  • Installing binaries now uses the same version of cargo as was used to build
    the package (instead of using whatever version is present in nixpkgs)

Deprecated

  • The packages flake output has been deprecated. All setup hooks can be
    accessed via the lib flake output (or via the result of the mkLib flake
    output)

v0.7.0

29 Sep 01:02
v0.7.0
755acd2
Compare
Choose a tag to compare

0.7.0 - 2022-09-28

Added

  • cargoDoc can now be used for building the documentation of a workspace
  • cleanCargoSource can now be used to filter sources to only include cargo and
    Rust files (and avoid rebuilds when irrelevant files change).
    filterCargoSources is the underlying filter implementation and can be
    composed with other filters
  • removeReferencesToVendoredSourcesHook defines a post-install hook which will
    remove any references to vendored sources from any installed binaries. Useful
    for preventing nix from considering the binaries as having a (runtime)
    dependency on said sources

Changed

  • Breaking: mkCargoDerivation now includes a default configurePhase
    which does nothing but run the preConfigure and postConfigure hooks. This
    is done to avoid breaking builds by including puts happen to have setup-hooks
    which try to claim the configure phase (such as cmake). To get the old
    behavior back, set configurePhase = null; in the derivation.
  • mkCargoDerivation (along with any of its callers like cargoBuild,
    buildPackage, etc.) now accept a stdenv argument which will override the
    default environment (coming from pkgs.stdenv) for that particular derivation
  • mkDummySrc now accepts extraScript which can be used to run a custom
    script, and therefore customize what the dummy source contains
  • buildDepsOnly now accepts dummySrc as a way to directly pass in the dummy
    source to be used. Automatically derived via args.src if not specified.

Fixed

  • cargoAudit properly keeps any audit.toml files when cleaning the source
  • buildPackage now has more robust checks to ensure that all references to
    vendored sources are removed after installation (which avoids consumers of the
    final binaries having to download the sources as well)
  • mkDummySrc how handles build scripts in a manner which ensures cargo runs
    the real script later (instead of thinking it has not changed)

v0.6.0

08 Sep 04:10
v0.6.0
2d5e7fb
Compare
Choose a tag to compare

0.6.0 - 2022-09-07

Added

  • Added cargoNextest for running tests via cargo-nextest
  • Added cargoAudit for running cargo-audit
    with a provided advisory database instance.

Changed

  • Breaking: the --workspace flag is no longer set for all cargo commands
    by default. The previous behavior can be recovered by setting cargoExtraArgs = "--workspace"; in any derivation.
  • Breaking: the $CARGO_PROFILE environment variable can be used to specify
    which cargo-profile all invocations use (by default release will be used).
    Technically breaking if the default command was overridden for any derivation;
    set CARGO_PROFILE = ""; to avoid telling cargo to use a release build.
  • Breaking: cargoTarpaulin will use the release profile by default
  • Breaking: cargoClippy's cargoClippyExtraArgs now default to
    "--all-targets" instead of being specified as the cargo command itself. If
    you have set cargoClippyExtraArgs to an explicit value and wish to retain
    the previous behavior you should prepend "--all-targets" to it.
  • Breaking: remapSourcePathPrefixHook and the doRemapSourcePathPrefix
    option have been removed, and the behavior of buildPackage has been updated
    to break false dependencies on the crate sources from the final binaries
    (which was the old behavior of the doRemapSourcePathPrefix option). To
    disable this behavior, set the doNotRemoveReferencesToVendorDir environment
    variable to any non-empty string.
  • All cargo invocations made during the build are automatically logged
  • Vendoring git dependencies will throw a descriptive error message if a locked
    revision is missing from Cargo.lock and a hint towards resolution

Fixed

  • Breaking: vendorGitDeps will only include crates referenced by the
    Cargo.lock file, meaning any extraneous crates which happen to be present in
    the git repository will be ignored.

v0.5.1

21 Jul 17:30
v0.5.1
731a810
Compare
Choose a tag to compare

0.5.1 - 2022-07-21

Added

  • Added .overrideToolchain as a convenience for using a custom rust toolchain

Fixed

  • Fixed an issue where mkDummySrc would produce incorrect results for filtered
    sources: #46

v0.5.0

13 Jun 00:08
v0.5.0
4a3f139
Compare
Choose a tag to compare

0.5.0 - 2022-06-12

Changed

  • Breaking: dropped compatibility for Nix versions below 2.8.1
  • Breaking: updated all flake attributes to follow the new .default
    guidance as per Nix's warnings. Specifically:
    • Crane's default overlay is now available at .overlays.default (previously
      .overlay)
    • All templates now use {app,devShells,packages}.default as well
  • Breaking: lib.fromTOML and lib.toTOML have been removed in favor of
    builtins.fromTOML
  • Improved support for consuming crane without using flakes
  • The nix-std dependency has been dropped

v0.4.1

29 May 23:14
v0.4.1
4cce5fe
Compare
Choose a tag to compare

0.4.1 - 2022-05-29

Fixed

  • Dummy source derivations go to greater lengths to only depend on the files
    they consume. Specifying the entire flake source as an input (e.g. via
    buildPackage { src = self; }) now avoids rebuilding everything from scratch
    whenever any file is changed. #28

v0.4.0

11 May 00:45
v0.4.0
ca0bc62
Compare
Choose a tag to compare

0.4.0 - 2022-05-10

Changed

  • Breaking: the previously named utils flake input has been renamed to
    flake-utils
  • buildDepsOnly now adds --all-targets to the default cargo check invocation. This allows caching all artifacts (including from
    dev-dependencies) such that tools like clippy don't have to generate them
    every time they run.
  • Templates now use the newer flake format accepted by Nix 2.8 (e.g.
    {packages,overlays,devShells}.default, etc.)

Fixed

  • Fixed project and template flakes to avoid superfluous follows declaration for
    flake-utils
  • Fixed quoting of relative paths to allow building with external sources

v0.3.3

25 Feb 02:00
v0.3.3
8629d56
Compare
Choose a tag to compare

0.3.3 - 2022-02-24

Fixed

  • Use lib.groupBy if builtins.groupBy isn't available (i.e. if a Nix version
    earlier than 2.5 is used)
  • The cross compilation example also hows how to set the HOST_CC environment
    variable which may be required by some build scripts to function properly

v0.3.2

19 Feb 02:20
v0.3.2
b4b5146
Compare
Choose a tag to compare

0.3.2 - 2022-02-18

Fixed

  • Fixed handling git dependencies whose locked revision is not on the
    repository's main branch