-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Flake input git+file:./${submodule}
no longer works
#9708
Comments
git+file:./${submodule}
works on 2.18.1 but no longer works on 2.19.2git+file:./${submodule}
works on 2.18.1 but no longer works on 2.19.2 [regression]
In the upcoming release 2.20, the git fetcher is overhauled, with improved submodule support, but the submodule flag for the fetcher is not enabled by default. |
I tried the latest static binary from hydra which is built from 8e865f3, and it has a similar regression: $ latestStatic=/nix/store/x1vkrxsxakk9wj7x0sydwifqa22jvqpx-nix-static-x86_64-unknown-linux-musl-2.20.0pre20240106_8e865f3
$ nix copy --from https://cache.nixos.org "$latestStatic"
$ nix shell "$latestStatic" ## below is from within the nix shell
$ nix --version
nix (Nix) 2.20.0pre20240106_8e865f3
$ nix flake update nixpkgs
fatal: '/nixpkgs' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
warning: could not read HEAD ref from repo at 'file://file:./nixpkgs', using 'master'
error:
… while updating the lock file of flake 'git+file:///home/$USER/.config/home-manager?ref=refs/heads/master&rev=c445c8c82697de2bde53c65e9acacb9790fcd54e'
… while updating the flake input 'nixpkgs'
… while fetching the input 'git+file://file:./nixpkgs'
error: fetching 'refs/heads/master:refs/heads/master' from 'file://file:./nixpkgs': failed to resolve path 'file://file:./nixpkgs': No such file or directory |
I tried a bisect using hydra static builds, and it seems that the breaking change is made:
... which narrows down the commits to this range: 301623f...d070d8b. Looks like it is indeed related to Update: I think it is precisely: Update: I found that reverting these lines fixes the issue: But I need to understand why. Then I can make a PR to try to fix it. |
git+file:./${submodule}
works on 2.18.1 but no longer works on 2.19.2 [regression]git+file:./${submodule}
no longer works since #9061 [regression]
git+file:./${submodule}
no longer works since #9061 [regression]git+file:./${submodule}
no longer works
Before I open a new issue, I also noticed that this broke:
Is this the same issue by any chance? It's possible to work around this issue with:
|
I think this is a different issue, though it is also related to flake URI parsing. |
@roberth @fricklerhandwerk would you be interested in taking a look at #9897? 🥺 It is a super simple PR which fixes the issue for the 2.19 series (but not 2.20 yet, due to new complications from submodules & switching to libgit2). |
I'm using 2.24.10 and I have a working flake.nix file looking like: {
inputs = {
emacs-overlay.url = "git+file:./emacs-overlay?shallow=1";
...
};
} This seems to work fine. Should this issue be closed? |
Ha, this broke again between 2.24.10...2.24.11 $ /nix/store/nmpx2d5vlypzbc62rzcbplyaygxq6kk6-nix-2.24.10/bin/nix flake update submodule
• Updated input 'submodule':
'git+file:./submodule?ref=refs/heads/dev&rev=62315f886eed0edf1b711afd2ae1a89afdbe2073' (2024-12-21)
→ 'git+file:./submodule?ref=refs/heads/dev&rev=4d0e38dce0405c5990df95b560ca58b1d81e1a2d' (2024-12-22)
$ nix run nixpkgs\#nixVersions.nix_2_24 -- --version
nix (Nix) 2.24.11
$ nix run nixpkgs\#nixVersions.nix_2_24 -- flake update submodule
nix: src/libutil/posix-source-accessor.cc:13: nix::PosixSourceAccessor::PosixSourceAccessor(std::filesystem::__cxx11::path&&): Assertion `root.empty() || root.is_absolute()' failed.
[1] 2741534 IOT instruction (core dumped) nix run nixpkgs\#nixVersions.nix_2_24 -- flake update submodule Update: I don't understand how this happened through the diff. Could it be c556c20 ? |
I confirm the issue |
Indeed it's something between these two hydra builds: ... which translates to: 6e095dd...ef21dfa. Basically, the culprit is indeed c556c20, which is backported from #11837. However, it appears that #11837 is a bugfix commit. So perhaps we have been depending on this bug for |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-12-23-nix-team-meeting-minutes-205/57783/1 |
ipimiutil broken in unstable as of 03539677da5a6caba6a6b3d2143ec63b116902d3 And on top of that `nix flake update` is crashing with ``` nix: src/libutil/posix-source-accessor.cc:13: nix::PosixSourceAccessor::PosixSourceAccessor(std::filesystem::__cxx11::path&&): Assertion `root.empty() || root.is_absolute()' failed. Aborted (core dumped) ``` I might need to try an older or newer version... Update / note to self: It worked with nix from nixpkgs unstable at c77dab3ae5c71a5eaef539968ebfb13dce79b0ea I eventually found NixOS/nix#9708 which was for a much older issue is being used to track the new regression. Nixpkgs downgraded back to Nix 2.24.10 in DamienCassou/nixpkgs@0bb2579 so I'll probably just use that.
I just submitted a fix! Please see #12107. |
Describe the bug
Flake input of a git submodule in a relative subdirectory
git+file:./${submodule}
nixpkgs.nixVersions.nix_2_18
)nixpkgs.nixVersions.nix_2_19
)Update: it seems that the regression happens since #9061. An example of this flake ref:
https://github.com/bryango/cheznix/blob/c445c8c82697de2bde53c65e9acacb9790fcd54e/flake.nix#L20-L23
The breakage would be acceptable to me if there is any alternative syntax that works, but currently I could not find anything that can replace
git+file:./${submodule}
.Steps To Reproduce
Expected behavior
I believe submodule sub-flake is quite common and
git+file:./${submodule}
should still work.nix-env --version
outputAdditional context
N/A
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: