-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Cargo.nix generation via cargo2nix is incredibly slow #341
Comments
It can be fixed. Open up the cargo source and check the metadata code. It's output contains all of the necessary information. Consider the feature logic busted. It's going to get burned to the ground if a metadata style solution is used. The template stuff will mostly be intact, but with extra support for platform specific dependencies that happen when deps depend on the target, such as with the Bevy crate. |
Thank you for your quick answer. Good to know that it can be fixed. |
Plans are in #301 and possibly other linked issues. Cargo already outputs the correct information in its metadata command. Cargo2nix uses the cargo library and basically can access all the same information that the metadata command outputs via serde. We need nix expressions as the output instead of the JSON. I'm oversimplifying, but that's the gist. |
#301 seems to be a PR about a large change in the nix code, and seems to have no comments on discussion on slowness in the rust code (which it is because of "cargo2nix process at a high CPU load") or plans for using metadata instead. |
Check issues tagged with high priority. I'm certain everything you're talking about is somewhere in there. |
I've got a 20k lines
Cargo.lock
and it takes ~1m to generate the correspondingCargo.nix
.For something that's supposed to be re-generated every time the
Cargo.lock
is touched that's unacceptably slow.During that time I can see the
cargo2nix
process at a high CPU load (~70% on average I think).This gives me O(n²) vibes, something like, for each dependency we run a cargo API tool that itself does go through the entire
Cargo.lock
...Thanks,
The text was updated successfully, but these errors were encountered: