-
Notifications
You must be signed in to change notification settings - Fork 89
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
Git workspaces #298
Open
tilpner
wants to merge
11
commits into
nix-community:master
Choose a base branch
from
tilpner:git-workspaces
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Git workspaces #298
Conversation
This file contains 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
It has a fairly narrow range of libgit2 versions it will accept from the system environment, so instead of manually providing a recent-enough version from nixpkgs-unstable, or downgrading the rust crate until the available version matches, we allow it to build its preferred version.
When copying out workspace member crates from a larger workspace, cargo will not be able to process the separated manifest if it still refers to e.g. the workspace license or workspace dependencies, because it can't find the workspace manifest. We can't help it find the workspace manifest, because crates in a cargo vendor directory aren't discovered recursively, and cargo doesn't resolve symlinks before checking the ancestors to find the workspace manifest.
Heyo @tilpner, I am not sure when I have time to think about this. But I already merged some of your commits on master, so thanks a lot! |
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.
This adds support for using workspaces in git dependencies with inherited fields, building upon #166 and #281.
An example project which doesn't build on master, but works with this PR, can be found here.
#166 takes care of exposing workspace members at the top level of a vendoring entry, so that cargo can find it, but it abducts the crate from its workspace without adjusting the manifest.
For example, the sqlx-postgres manifest inherits dependencies and metadata (edition, license) from the workspace manifest. These fields can't be filled in by cargo after copying the member crate out of the workspace, so this PR fills in that information before/while copying it out.
It does add a dependency on cargo's unstable API, which I found preferable to reimplementing the manifest inheritance on top of
cargo_metadata
, but I'd understand if it's an unacceptable choice for crate2nix. cargo (in the most recent version, which might not be required) also expects a very recent rustc.The libgit2-sys dependencies are currently duplicated, due to lack of a central place to put them. If tools.nix could import default.nix, this wouldn't be a problem, but that seems to have been avoided so far, and would probably cause changes to the public interface.
If the commit message convention is out of place, or the drive-by "improvements" (don't shadow nix, use stable CLI) don't fit into this PR, we can change/drop them.