-
Notifications
You must be signed in to change notification settings - Fork 92
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
Optimize Crane to Avoid Full Rebuilds on Single Dependency Updates #528
Comments
Probably not. There are existing issues about it. It's a fundamental design decision how crane works. There are some projects that attempt to work like this. I'd advise that generally developers should be using nix dev shell and not have to go through nix build during normal work. |
This is an unfortunate consequence of the fact that changing Otherwise there's also https://github.com/nix-community/crate2nix if you are okay with eschewing using cargo entirely As for changes to crates from within the workspace it's a similar situation: changing any of the source tree will result in Nix rebuilding things. The best available option is to again split up your build into multiple derivations and "clean" any irrelevant crates to avoid unnecessary rebuilds. I'll also link to existing discussion on this topic: |
Is there some conceptual reason crane doesn't work this way and builds all dependencies at once? Or is it just because this way it's easier to implement? Because to me, that seems like a nice solution. |
It's harder as it requires basically re-implementing what cargo is doing. Also, by storing all dependencies as one big artifact everything can be compressed together in the store, saving storage and making things actually faster. In practice changes to |
Crane currently triggers a full rebuild of all dependencies, even when only a single dependency is updated. This behavior significantly impacts development efficiency in large monorepo Cargo projects, where rebuilding all dependencies can be prohibitively time-consuming.
Is there anything on the roadmap to improve on this?
The text was updated successfully, but these errors were encountered: