-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
builtins.fetchGit regression in 2.4 when coming from 2.3 #5128
Comments
Passing
|
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
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
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
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
@edolstra can we either have a post-release errata about the compatibility issue with existing expressions, or is this something that should and can be fixed in 2.4.1? |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nix-2-4-and-what-s-next/16257/1 |
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
The issue was not fixed in later versions, so we need the workaround for all versions greater than `2.4pre`.
The issue was not fixed in later versions, so we need the workaround for all versions greater than `2.4pre`.
Could Now that I've installed 22.05 and upgraded away from nix-2.3, this issue is causing me grief. Let me explain my unusual use-case: We build several embedded products, and they are all put together with nix. The top level build products are "install" scripts that will partition, format, and install to a given disk device. All these scripts are added to a customized NixOS ISO image that we boot on the target hardware, and then run the "install" script for the specific product we are making that day. This works great... I can drop our code repo on a sparkling new NixOS machine and hit The embedded products are mostly nix-2.3 era but newer ones in development will use current nix and nixpkgs. I cannot build those older 2.3 era products with current nix-2.8 because of changes to fetchGit. Specifically, all those older products also have older nixpkgs that predate the In the short term I will investigate using a nix with hacked fetchGit, but it would be good to not have to resort to hacked tools to do what I want. EDIT: My hacked nix for those that are interested: |
The issue here is that |
In addition, With that said,
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/summer-of-nix-documentation-stream/20351/3 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/summer-of-nix-documentation-stream/20351/2 |
The issue was not fixed in later versions, so we need the workaround for all versions greater than `2.4pre`.
This was called out as a bug in an earlier comment. There is currently work-in-progress for fetchGit,fetchTree and associated behavior.
|
I guess this is related #5313. |
Triaged in Nix team meeting: If someone wants to make a PR that fixes the problem and issues a warning, we'll put it through the pipeline. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-11-24-nix-team-meeting-minutes-106/35955/1 |
Seems to be fixed between 2.19.2 and master. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-02-16-nix-team-meeting-minutes-124/39870/1 |
Re-open if not fixed. |
Describe the bug
When using
builtins.fetchGit
like below, Nix used to warn that the refname might be ambiguous but still did the right thing. With Nix 2.4 the warning is gone and Git fails to fetch the path leading to expressions that worked on 2.3 failing to build.Steps To Reproduce
reproducer.nix
:nix-build reproducer.nix
on both Nix 2.3 and 2.4Regardless of the above warning fetching works. It doesn't produce a
result
symlink as builtin fetchers tend to not do that when invoked outside of a derivation.Expected behavior
Nix should allow using the same fetchers as in previous versions even after upgrading even in the situation where the inputs to the fetchers were previously warned about.
Additional context
The problem was initially reported over here: nix-community/npmlock2nix#91
The way we are using
builtins.fetchGit
over there is super simple and pragmatic as NPM just throws some string at you. Sometimes it is a ref and in other scenarios a revision. I'll try to find a way to distinguish between them better and improve our code but IMO this bug is still valid as it breaks old expressions.The text was updated successfully, but these errors were encountered: