-
-
Notifications
You must be signed in to change notification settings - Fork 14.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
Nix flake not working in git repository with LFS #137998
Comments
cd /tmp/
mkdir test
cd test/
git init
git lfs install
curl -OL https://github.com/NixOS/nixpkgs/archive/refs/heads/master.zip
git lfs track "*.zip"
git add .gitattributes
git add .
git commit -m "Initial commit"
git lfs ls-files
cat /tmp/test/flake.nix
{
outputs = inputs@{ self, nixpkgs }:
{
legacyPackages = nixpkgs.legacyPackages;
};
}
nix build .#hello
|
This comment has been minimized.
This comment has been minimized.
Okay got it. This is the exact reproducer you just need to push it somewhere and then clone the remote. See https://github.com/mohe2015/nixpkgs-137998-reproducer git clone https://github.com/mohe2015/nixpkgs-137998-reproducer.git
cd nixpkgs-137998-reproducer/
nix build .#hello reproduces. Edit: I won't work on a fix for now but now it should be easy to reproduce. |
Can confirm that rm flake.lock # important
nix run github:NixOS/nixpkgs/7cf9185aaeb95f79cfe9cae8689433434576aaff#nixUnstable build .#hello works but rm flake.lock # important
nix run github:NixOS/nixpkgs/release-21.05#nixUnstable build .#hello doesn't. So it's 21c1c06#diff-b94b72b12e07bed8c4a3b4c50242499d5efb1e32797426d319574fd613bc07ae and therefore one of NixOS/nix@47e96bb...3c56f62 Current bisect status: git clone git@github.com:NixOS/nix.git
cd nix
git bisect start
git bisect good 47e96bb533f8cacc171bec9b688b134de31a48a9
git bisect bad 3c56f62093601143838af923195f630d8ffae2d4
cd ..
cat test.sh
#!/bin/sh
rm -f ../flake.lock
nix build .#nix || exit 125
nix run .#nix build ..#hello || exit 1
chmod +x test.sh
cd nix
git bisect run ../test.sh |
Potentially looks like duplicate of NixOS/nix#4623 |
git bisect log
git bisect start
# good: [47e96bb533f8cacc171bec9b688b134de31a48a9] Merge pull request #5082 from manveru/fix-git-init-race
git bisect good 47e96bb533f8cacc171bec9b688b134de31a48a9
# bad: [3c56f62093601143838af923195f630d8ffae2d4] Merge pull request #5225 from ncfavier/patch-1
git bisect bad 3c56f62093601143838af923195f630d8ffae2d4
# good: [323cafcb4ec632881c297f9b3004ea7fb07b678f] Merge pull request #5191 from hercules-ci/evalstate-lifetime-hygiene
git bisect good 323cafcb4ec632881c297f9b3004ea7fb07b678f
# good: [7ee639f9db987a442fdf3820d3681a77b2ee1688] Merge pull request #5066 from Radvendii/master
git bisect good 7ee639f9db987a442fdf3820d3681a77b2ee1688
# good: [a4d02d100afba729b09c43ee19f2398c529dc904] Merge pull request #5204 from lucc/patch-1
git bisect good a4d02d100afba729b09c43ee19f2398c529dc904
# good: [90b2dd570cbd8313a8cf45b3cf66ddef2bb06e07] Add FIXME
git bisect good 90b2dd570cbd8313a8cf45b3cf66ddef2bb06e07
# bad: [6678e98411cd3bfe8143a4ba1b35d1451babce32] Merge pull request #4922 from nrdxp/default-submodules
git bisect bad 6678e98411cd3bfe8143a4ba1b35d1451babce32
# skip: [769ca4e26d973660756de85b51efdb7fc36a00fd] libfetchers/git: fetch submodules by default
git bisect skip 769ca4e26d973660756de85b51efdb7fc36a00fd
# only skipped commits left to test
# possible first bad commit: [6678e98411cd3bfe8143a4ba1b35d1451babce32] Merge pull request #4922 from nrdxp/default-submodules
# possible first bad commit: [769ca4e26d973660756de85b51efdb7fc36a00fd] libfetchers/git: fetch submodules by default git revert 769ca4e26d973660756de85b51efdb7fc36a00fd NixOS/nix@769ca4e Really seems to be the problem. Edit: @laikq If it's just that .tar.gz file you could probably also fetch it with nix directly and not use lfs at all. |
It seems like you sometimes need to garbage collect to reproduce btw. |
This may or may not be like the regular fetchers. If Nix already has the output with the right name and hash in the store, it doesn't need to fetch it again. This is usually a good thing, unless you are testing changes. |
I marked this as stale due to inactivity. → More info |
I have also hit this.
Did you ever manage to resolve this? |
This is a problem of the nix package manager and the linked issue, not nixpkgs. |
Describe the bug
My nix flake cannot be built. The git repository of the flake uses LFS. Error message:
(here,
cvode-2.5.0.tar.gz
is a file already present & downloaded in the working directory)Using
nix.package = pkgs.nixUnstable;
inconfiguration.nix
, wherepkgs
is fromhttps://nixos.org/channels/nixos-21.05
on 2021-09-15. It also doesn't work if I try to pull the flake from remote:nix build "git+ssh://git@gitlab.com…"
still fails with exactly the same error message.Using
https://github.com/nixos/nixpkgs/archive/7cf9185aaeb95f79cfe9cae8689433434576aaff.tar.gz
(release-21.05
from 2021-09-05) aspkgs
, it works again.Steps To Reproduce
I don't have a minimal working example yet, sorry :/ (I first wanted to sketch out the issue, don't have much time available right now) I guess it will happen with many git lfs repositories?
Expected behavior
Package should be built.
Metadata
Maintainer information:
The text was updated successfully, but these errors were encountered: