-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
Fix using git deps with rev= in pyproject.toml #358
Closed
Closed
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
Currently poetry2nix calls builtins.fetchGit with ref=<rev>, which Nix translates to ref=refs/heads/<rev> and breaks (git): $ nix-build + /usr/bin/git -C /home/bf/.cache/nix/gitv3/1aba8psc37ekc9ph2m5ziidm644mj84yrrj7g6x8amy3g13kyjm4 cat-file -e 4d41bada407267a008473547085f8242bb8663e5 + /usr/bin/git -C /home/bf/.cache/nix/gitv3/1aba8psc37ekc9ph2m5ziidm644mj84yrrj7g6x8amy3g13kyjm4 fetch --quiet --force -- ssh://git@server.example/repo.git refs/heads/4d41bada407267a008473547085f8242bb8663e5:refs/heads/4d41bada407267a008473547085f8242bb8663e5 fatal: Couldn't find remote ref refs/heads/4d41bada407267a008473547085f8242bb8663e5 error: program 'git' failed with exit code 128 (use '--show-trace' to show detailed location information) fatal: the remote end hung up unexpectedly (I wrote a git wrapper that traces the calls to the real git.) Unfortunately, poetry does not support specifying both branch= and rev= in pyproject.toml (it ignores branch= if rev= is set), so we have to fix this in poetry2nix. (At least for now.) Fix it by using the new builtins.fetchGit 'allRefs' parameter when rev= is set. This parameter is only available in nixUnstable, but as the current code is broken anyway, I think that's ok.
Ping? |
@adisbladis: Can you please have a look? |
Looks like nix 2.3 and 2.4 handles this differently: NixOS/nix#5128 |
Since it seems that this PR relies on a bug in the unreleased Nix 2.4 I'm inclined to close it. |
vlaci
pushed a commit
to vlaci/poetry2nix
that referenced
this pull request
Oct 20, 2021
Another approach to make `poetry2nix` work with dependencies specified by arbitrary `rev=<hash>` values on newer Nix revisions. Relates-to: nix-community#358 Relates-to: NixOS/nix#5128
vlaci
pushed a commit
to vlaci/poetry2nix
that referenced
this pull request
Oct 20, 2021
Another approach to make `poetry2nix` work with dependencies specified by arbitrary `rev=<hash>` values on newer Nix revisions. Relates-to: nix-community#358 Relates-to: NixOS/nix#5128
vlaci
pushed a commit
to vlaci/poetry2nix
that referenced
this pull request
Oct 20, 2021
Another approach to make `poetry2nix` work with dependencies specified by arbitrary `rev=<hash>` values on newer Nix revisions. Relates-to: nix-community#358 Relates-to: NixOS/nix#5128
vlaci
pushed a commit
to vlaci/poetry2nix
that referenced
this pull request
Oct 22, 2021
Another approach to make `poetry2nix` work with dependencies specified by arbitrary `rev=<hash>` values on newer Nix revisions. Relates-to: nix-community#358 Relates-to: NixOS/nix#5128
adisbladis
pushed a commit
that referenced
this pull request
Jan 17, 2022
Another approach to make `poetry2nix` work with dependencies specified by arbitrary `rev=<hash>` values on newer Nix revisions. Relates-to: #358 Relates-to: NixOS/nix#5128
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.
Currently poetry2nix calls builtins.fetchGit with ref=<rev>, which Nix
translates to ref=refs/heads/<rev> and breaks (git):
(I wrote a git wrapper that traces the calls to the real git.)
Unfortunately, poetry does not support specifying both branch= and rev=
in pyproject.toml (it ignores branch= if rev= is set), so we have to fix
this in poetry2nix. (At least for now.)
Fix it by using the new builtins.fetchGit 'allRefs' parameter when rev=
is set. This parameter is only available in nixUnstable, but as the
current code is broken anyway, I think that's ok.