radian-software / straight.el

🍀 Next-generation, purely functional package manager for the Emacs hacker.
MIT License
2.75k stars 151 forks source link

Invalid index-pack output #994

Open hkjels opened 2 years ago

hkjels commented 2 years ago

What's wrong

It's no longer possible to clone https://git.savannah.gnu.org/git/emacs/nongnu.git due to a zero-padded file mode in the object 2699d230e3b592ae42506d7b5c969a7ac6a4593c. I believe this is a straight.el specific mirror and thus the reason I'm posting here (might be wrong 🥸).

Error from *straight-process*

$ cd /Users/henrik/.emacs.d/straight/repos/
$ git clone --origin origin --no-checkout https\://git.savannah.gnu.org/git/emacs/nongnu.git /Users/henrik/.emacs.d/straight/repos/nongnu-elpa/ --no-single-branch

Cloning into '/Users/henrik/.emacs.d/straight/repos/nongnu-elpa'...
error: object 2699d230e3b592ae42506d7b5c969a7ac6a4593c: zeroPaddedFilemode: contains zero-padded file modes
fatal: fsck error in packed object
fatal: fetch-pack: invalid index-pack output

[Return code: 128]

$ cd /Users/henrik/.emacs.d/straight/repos/nongnu-elpa/
$ git branch -r

[File error while Setting current directory]

Directions to reproduce

Running git clone https://git.savannah.gnu.org/git/emacs/nongnu.git ./nongnu-elpa will fail

Version information

hkjels commented 2 years ago

Running the command with --depth 1 worked and seemingly doesn't break anything. If it in fact doesn't break anything, a shallow clone should probably be the default. Not sure how this mirror is used internally, so I might be totally wrong.

progfolio commented 2 years ago

Thank you for the detailed report. Unfortunately, this is not our repository. This is GNU's repository and the issue has been reported in the past:

https://lists.gnu.org/r/emacs-devel/2020-05/msg02856.html

The advice from that thread essentially boils down to:

Known problem: just disable fsck for the initial fetch.

I'll see if I can add that as a workaround when we clone the repository. Adding a :depth of 1 is a workaround, but not a complete solution because the user may need more git history to unfreeze their packages.

Related issue: #981