Skip to content

0.6.0

Compare
Choose a tag to compare
@kolloch kolloch released this 10 Nov 21:28
· 1184 commits to master since this release

0.5.1 - 0.6.0

  • Issue #22 - Support renamed crates. Fixed in buildRustCrate in nixpkgs and in crate2nix by PR #24 @danieldk, thanks a lot!
    This is especially awesome because the popular rand crate recently made use of the "renamed crates" feature and therefore could not be build by buildRustCrate/crate2nix anymore.

  • Issue #15 - Support "overrideCrates" argument for modifying the derivation for a crate by name. Common use case, adding additional buildInputs. NixOS comes with [defaultCrateOverrides](https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/rust/default-crate-overrides.nix) for some common packages already. This is what I use in default.nix of crate2nix to add a conditional dependency under Mac OS:

       cargo_nix.rootCrate.build.override {
          crateOverrides = defaultCrateOverrides // {
            cssparser-macros = attrs: { 
              buildInputs = stdenv.lib.optionals stdenv.isDarwin [darwin.apple_sdk.frameworks.Security]; };
          };
        }

    Many thanks to @Profpatsch for pointing to the problem and analyzing it.

  • Issue #43 - Support conditional dependencies using "test" configuration:

    [target.'cfg(test)'.dependencies]
    tracing = { version = "0.1.5", features = ["log"] }

    When building with crate2nix, dependencies will not lead to an error anymore and will simply be ignored (since we do not have test support yet). Thanks to @andir for the nice minimal example!

Infrastructure:

  • I moved the integration tests to tests.nix, they were in rust code before.
  • I also now build every push with github actions, and cachix/cachix-action. A suggestion from @vbrandl in #44. Unfortunately, the rust crates are not cached yet, I think, because they are not in the closure of the result. The cachix caches is called "eigenvalue" for now (I might change that in the future).

Happy building and thank you for the prime bug reports!