add ability to override lockfile from tools.nix#276
Open
apoelstra wants to merge 1 commit intonix-community:masterfrom
Open
add ability to override lockfile from tools.nix#276apoelstra wants to merge 1 commit intonix-community:masterfrom
apoelstra wants to merge 1 commit intonix-community:masterfrom
Conversation
8f50bf2 to
5b5c5e1
Compare
5b5c5e1 to
806b05c
Compare
Collaborator
|
Heyo! Couldn't you just do that in the source passed to the tools? |
Collaborator
|
Yes, that is better done separately. |
Contributor
Author
|
Libraries don't have lockfiles as part of their source. It is a big PITA to "edit the source" of something that is coming from a particular git commit. |
Collaborator
|
Are you saying the |
Contributor
Author
I'm saying that I have a set of lockfiles, none of which are from the repo in question, and I want to use those to build a set of source. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I would like the ability to override the Cargo.lock file in a repository (or provide one if none exists). It looks like there is no way to do this through Cargo itself -- its source code hardcodes the path of the lockfile as the workspace root plus
/Cargo.lock. So to override a lockfile you have to copy it in place, which is what this patch does.I'm very new to nix, so any feedback on approach is welcome.
My use case is that I'm using this crate as part of a CI infrastructure, where for a given pull request I grab every commit, dynamically produce a Cargo.nix, and build them. This is a library so it doesn't have a Cargo.lock checked in, and even if it did, there are multiple lockfiles I'd like to test with (a "minimum supported versions" one and a "latest versons of all deps" one), so the checked-in version wouldn't be sufficient.
My current non-nix solution involves doing a shallow checkout of every commit and doing a fresh build, which is roughly what
buildRustPackageswould do if I were to naively port my setup into nix. But this is incredibly wasteful, since it rebuilds my entire dep tree on every commit, even though (for normal PRs) the dependency tree doesn't change at all.