-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{buildRustCrate, defaultCrateOverrides}: remove #373744
Conversation
b1eb9c0
to
21a17f4
Compare
21a17f4
to
b876438
Compare
b876438
to
02bd0ea
Compare
We have other language‐specific packaging utilities in Nixpkgs that can’t be used in Nixpkgs (e.g., various modes that let you IFD a lock file). I’m not sure why this one specifically needs to be removed? But I don’t object to moving it to |
At yesterday's Nix Darmstadt meetup, I raised the question of what the usual procedure for build helpers not anymore required by other packages in nixpkgs is, and was encouraged to open a PR for proposing the removal, one of the reasons being to reduce bloat of the nixpkgs repository. |
|
@@ -3679,21 +3679,6 @@ | |||
"rust-package-built-with-meson": [ | |||
"index.html#rust-package-built-with-meson" | |||
], | |||
"compiling-rust-crates-using-nix-instead-of-cargo": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't simply delete old locations, but redirect them to release notes. That way whoever has a bookmark will instantly find the reason why the thing they were using is gone.
crate2nix relies heavily on both I'm personally not a fan of this change, at least not without fully understanding the implications. In this form, it'll simply break all crate2nix-packaged projects on the next nixpkgs bump if merged. |
Thank you for the feedback, @flokli. Do you think an approach from the opposite direction, bringing Regarding the concern of having to bring in |
Moving it out of nixpkgs would mean crate2nix would need to start vendoring all this into every repo using it. I still think it makes more sense to keep this code in nixpkgs. At least Is it really so much of a liablilty to keep it in nixpkgs? |
The original premise was that this smelled like dead code of a builder that nobody within Nixpkgs uses for anything. If it's actively used in this way, I'd rather keep it in Nixpkgs too. This fact should be clearly documented though and I think the same people who maintain crate2nix should maintain that code. |
Alright, I will close this PR and refer to it if the topic comes up again. As keeping both |
Motivation and historical background
The
buildRustCrate
helper was introduced in 2017 by 5a0d954 for the purpose of allowing Rust packages created through carnix to be included in nixpkgs.Similar to crate2nix, carnix generated a rather large Nix expression
Cargo.nix
from a cargo lockfile.As carnix has been unmaintained since 2019, @figsoda removed it in #202394.
Ever since,
buildRustCrate
has been left in a state where it was exposed by nixpkgs, but nothing inside nixpkgs depended on it.The tests for
buildRustCrate
were previously maintained by @andir, but have been left without a maintainer since 31e5b8d.It is unlikely that packages using
buildRustCrate
would ever be allowed inside nixpkgs again, partially due to the size of such generatedCargo.nix
expressions.In fact, nixpkgs is currently in progress of removing all occurences of
Cargo.lock
, motivated by @Atemu in #327063 and enabled by the @TomaSajt with the recently introducedrustPlatform.fetchCargoVendor
in #349360.Considerations against removal
It is noteworthy that
buildRustCrate
is not without maintenance, seeing a few changes and improvements per year.A popular solution for packaging Rust outside nixpkgs that depends on
buildRustCrate
is crate2nix, which allows building and caching every crate in its own derivation.crate2nix's own docs state:
In this regard, it may be in crate2nix's own interest to continue maintenance of
buildRustCrate
inside their own repository.Furthermore, there are ongoing discussions initiated by @emilazy in #333702 to package Rust crates separately, possibly encouraging leaving
buildRustCrate
in tree in case it will be needed to implement such a Rust package set.However, since the introduction of
fetchCargoVendor
, the urgency of such a package set seems to have shrunk.Required actions if this were to be merged
While
buildRustCrate
is not needed by nixpkgs anymore, it still is a vital part of the Nix Rust community outside nixpkgs, in particular because of the popularity of crate2nix.It should either be moved to a shared repository inside https://github.com/nix-community/ or become a part of crate2nix itself.
Ping for other maintainers involved in
buildRustCrate
(this list may be non-exhaustive)
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.