Releases: cargo2nix/cargo2nix
Release 0.11.0
Darwin can build cargo2nix on nixpkgs-unstable
. Examples build on most nixpkgs branches on Darwin.
Added
- re-added flake-compat (and this time it doesn't complain when using
nix flake show
) - Support for passing in a
rustToolchain
from any way you want to provide Rust - Development
workspaceShell
customization pass-throughs to Nix's standardmkShell
function - wasi cross compiling example (runs on Linux only)
- combined overlays for easier consumption when writing your flake.nix
Changed
- removed
localPatterns
completely - git sources no longer do IFD from
readFile
use - CI uses rev from the PR
- local registry support removed (unused)
- overhauled
rustChannel
argument - Rust support to 1.60
- Nixpkgs to 21.11
- The
-f
flag was changed to default when callingcargo2nix
Lots of code cleanups**
-
makePackageSet'
->makePackageSet
-
utils.sh -> mkcrate-utils.sh
-
simplified.nix & full.nix -> user-facing.nix & internal.nix
-
Docs updated
Fixed
defaultApp
updated to nix 2.8 style- direnv uses newer nix style
- rustTriple
- eliminated non-determinism in
Cargo.nix
output to help reduce line noise - openssh cross compile correct build & host offsets / platforms
- Darwin can build cargo2nix (with nixpkgs-unstable) as of this writing
- JSON messages rendered to output for easy reading nix build logs
Release 0.10.0
This release contains many changes that will require updating Cargo.nix and nix expressions for existing projects. See the updates to examples for more information on how to make the change. It's relatively easy since nix flakes have a better defined structure.
Nix Flakes
With this release, cargo2nix will no longer be attempting to support legacy nix commands or legacy nix build expressions. Many may still work, but there will be no further attempt to fix issues or remain compatible with flakes. The benefits of flakes, even to beginners because of the additional structure, is too valuable to be able to justify the maintenance overhead for a usage pattern that likely is barely working even where it is.
The flake commands are really great for rapidly getting started. nix develop
and nix shell github:/cargo2nix/cargo2nix
are just two awesome examples. Of leveraging flakes to make dependencies easier than ever.
CI With Actions & Mac Support
Cargo2nix and some examples now build on mac for CI. This will allow our (more common) Linux users to make PR's without accidentally breaking the bootstrap workflows for Mac users. (you need a working Cargo2nix to conveniently develop Cargo2nix).
Rust 2021 Edition and Cargo 0.57 (Rust 1.57) Support
All of the latest toml and Rust language features are supported
Other Changes
- fixed hostPlatformFeatures
- support for profile-opts and codegen-opts (this likely needs a second pass for architecture. Note as experimental)
- target_arch translation fix #201
- git branches in Cargo.toml sources #174
- fix for localPaths when using
workspacePath
180 - several jq and remarshal issues were worked around 171
- switched Rust overlay to Oxalica 178
Release 0.9.0
Added
- Executables are separated into a
bin
target with smaller closure (#153) - Independent sources can be provided by git or an external local path using the
workspaceSrc
argument tomakePackageSet
(#153) - Cargo v2 lockfile support (#153)
hostPlatformCpu
andhostPlatformFeatures
support for adding-Ctarget-cpu and -Ctarget-feature
rustc flags (#123)rust-src
attribute is available to provide Rust Analyzer with project-specific sources matching the Rust toolchain version in use (#153)- Examples added:
Changed
- Git sources no longer will be filtered by
localPatterns
. Only local paths will havelocalPatterns
filtering applied (#153) - Cargo support updated to 0.48 (#153)
- Builds with a Nixpkgs 20.09 pin on Darwin & Linux (#153)
- Repository transferred to cargo2nix ownership (#147)
- Nixpkgs-mozilla pin updated (#143)
Fixed
- cc crate given
xcbuild
dependency on Darwin (#153) - libssh2-sys crate
zlib.dev
dependency added (#153) - openssl-sys crate provided configuration flags to match libopenssl version (#153)
- zmq-sys crate
zeromq
dependency added (#141) - libudev-sys crate build.rs and
udev
dependency added (#146) - libdbus-sys crate
dbus
dependency added (#146) - fsevent-sys crate converted to Darwin-specific override (#146)
Upgrading
You will need to regenerate your project's Cargo.nix
to accept the workspaceSrc
argument or the 0.9.0+ overlay will not work with it
Release 0.8.3
Added
- Add built-in package override for building the
protoc
crate (#116).
Changed
- Disable OpenSSL patches if not cross-compiling (#99).
- Improve documentation and example projects (#100, #101, #105).
- Move user overlays in
default.nix
to tail (#112). - Switch from deprecated
fetchgitPrivate
tobuiltins.fetchGit
in order to support newer Nixpkgs (#113).
Deprecated
- Deprecate
sha256
argument offetchCrateGit
in theCargo.nix
format (#113).
Fixed
Release 0.8.2
Changed
- Improve Rust error handling in
cargo2nix
command (PR #86). - Set
crossSystem
tonull
by default forcargo2nix
command, improving install UX (PR #89). - Add example projects and improve documentation (PR #91 #93).
- Make
packageOverrides
argument default topkgs: pkgs.rustBuilder.overrides.all
when unspecified (PR #94).
Release 0.8.1
Added
- Add
nix-env
installation instructions to README (#68).
Changed
- Improve code gen for packages required by a subset of root packages (#70).
- Mark
Cargo.nix
with the@generated
keyword (#72). - Enforce minor version requirement to avoid accidental downgrade of
Cargo.nix
(#78). - Set
PKG_CONFIG_ALLOW_CROSS
if host and build platforms differ for betterpkg-config
cross-builds (#79). - Convert
Cargo.nix
templating to Tera (#80). - Remove dependency on
regex
andonce_cell
.
Fixed
- Ensure
Cargo.nix
file is written atomically (#84).
Release 0.8.0
Release 0.7.0
Added
- Add built-in package override for building
ring
on macOS (#58 #59). - Add support for Cargo
git
dependencies by bundlingnix-prefetch-git
(#62).
Changed
- Improve style of generated
Cargo.nix
expressions (#53). - Respect
$NIX_DEBUG
in order to control the log verbosity of Cargo (#57). - Add
#![forbid(unsafe_code)]
attribute to thecargo2nix
crate root (#63). - Parse
Cargo.toml
in the builder script to improve evaluation-time caching behavior (#61 #64).
Fixed
- Fix bug in integration test support when
compileMode = "test"
(#52).
Release 0.6.0
Added
- Add support for
[profile.*]
custom profiles (#29). - Include a set of default overrides for many common Rust crates (#30).
- Implement support for alternative registries (#39).
- Implement support for crate workspaces (#46).
- Add
runTests
command for executing test binaries in a Nix derivation.
Changed
- Correctly propagate environment variables to root crate (#37).
- Improve documentation in
README.md
(#43 #45). - Record the
cargo2nix
version in generatedCargo.nix
expression. - Improve the command-line ergonomics (#50).
Removed
- Replace
rustPackageConfig
argument with much simpleroverrides
argument (#30).
Fixed
- Include
tests
directory, if it exists, when building withcompileMode = "test"
(#41).
Release 0.5.0
Changed
- OpenSSL is no longer linked statically.
- Restore original package attribute convention of
registry.crate."x.y.z"
. - Parse
Cargo.toml
attributes at codegen time instead of dynamically in the Nix overlay. - Bootstrap
cargo2nix
with Rust 1.37.0 again. - Make derivation evaluation speeds even faster.
Fixed
- Fix proc macro crate detection.
- Fix undefined variable error in generated code.
- Fix code generation issues with multiple dependencies sharing the same name.