Skip to content

Fix Savannah snapshot downloads by switching from cgit to gitweb#523

Closed
ghost wants to merge 1 commit intomasterfrom
unknown repository
Closed

Fix Savannah snapshot downloads by switching from cgit to gitweb#523
ghost wants to merge 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Dec 9, 2025

The cgit snapshot service on Savannah GNU.org has been disabled/broken, returning HTTP 400 errors for all snapshot requests. This affects the emacs update CI job which downloads source tarballs for building.

The error manifested as:
error: unable to download 'https://git.savannah.gnu.org/cgit/emacs.git/snapshot/emacs-.tar.gz': HTTP error 400

This is a known infrastructure issue affecting multiple projects:

The recommended workaround from the Guix community discussion is to use gitweb URLs instead of cgit URLs for downloading snapshots:
Old: https://git.savannah.gnu.org/cgit/emacs.git/snapshot/emacs-.tar.gz
New: https://git.savannah.gnu.org/gitweb/?p=emacs.git;a=snapshot;h=;sf=tgz

The cgit snapshot service on Savannah GNU.org has been disabled/broken,
returning HTTP 400 errors for all snapshot requests. This affects the
emacs update CI job which downloads source tarballs for building.

The error manifested as:
  error: unable to download 'https://git.savannah.gnu.org/cgit/emacs.git/snapshot/emacs-<sha>.tar.gz': HTTP error 400

This is a known infrastructure issue affecting multiple projects:
- https://lists.gnu.org/r/guix-devel/2025-01/msg00170.html
- NixOS/nixpkgs#346264

The recommended workaround from the Guix community discussion is to use
gitweb URLs instead of cgit URLs for downloading snapshots:
  Old: https://git.savannah.gnu.org/cgit/emacs.git/snapshot/emacs-<sha>.tar.gz
  New: https://git.savannah.gnu.org/gitweb/?p=emacs.git;a=snapshot;h=<sha>;sf=tgz

The --name flag is required because gitweb URLs contain semicolons which
nix-prefetch-url incorrectly interprets as part of the store path name.
@jian-lin jian-lin self-requested a review December 9, 2025 14:07
@ghost
Copy link
Copy Markdown
Author

ghost commented Dec 9, 2025

I kept trying to fix my nix code to install emacs with some customization, but finally gave up. I think the fetcher in https://github.com/nix-community/emacs-overlay/blob/master/overlays/emacs.nix probably needs some adjustments as well. The above is only part of the fix, I guess.

@Stebalien
Copy link
Copy Markdown

NOTE: There's a GitHub mirror maintained by tarsius. It doesn't currently include the feature/igc branch, but it will once the GitHub actions next run.

Comment thread repos/emacs/update

output_branch=$(echo $branch | sed s/"\/"/"_"/)
digest=$(nix-prefetch-url --unpack "https://git.savannah.gnu.org/cgit/emacs.git/snapshot/emacs-${commit_sha}.tar.gz")
digest=$(nix-prefetch-url --unpack --name "emacs-${commit_sha}.tar.gz" "https://git.savannah.gnu.org/gitweb/?p=emacs.git;a=snapshot;h=${commit_sha};sf=tgz")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essentially, the gitweb snapshot service is no more reliable than the cgit snapshot service. They may decide to also disable gitweb snapshot in the future.

What is more reliable here is the git protocol. We should use that instead. Our use cases should be covered well by fetchgit.


I think the fetcher in https://github.com/nix-community/emacs-overlay/blob/master/overlays/emacs.nix probably needs some adjustments as well. The above is only part of the fix, I guess.

Yes. Here we update info about source and we use this source info in overlays/emacs.nix.


NOTE: There's a GitHub mirror maintained by tarsius. It doesn't currently include the feature/igc branch, but it will once the GitHub actions next run.

I am not a fan of adding more indirection.


I checked a few repos and their cgit snapshot services are all disabled. CC @normalcea (author of NixOS/nixpkgs#435964 and NixOS/nixpkgs#427024)

@ghost
Copy link
Copy Markdown
Author

ghost commented Dec 11, 2025

@jian-lin Sorry, I don't have plans to keep working on this.

@ghost ghost closed this Dec 11, 2025
@jian-lin
Copy link
Copy Markdown
Member

No worries. I’ll fix this, probably this weekend.

femiagbabiaka added a commit to femiagbabiaka/emacs-overlay that referenced this pull request Dec 13, 2025
See previous discussion:
nix-community#523

This is fairly slow because the Savannah git repository doesn't seem
to support blob filtration. Given that this is normally run via a CI
job that seems minor.
@femiagbabiaka
Copy link
Copy Markdown
Contributor

@jian-lin I made a PR after reading the discussion here: #524

jian-lin added a commit to femiagbabiaka/emacs-overlay that referenced this pull request Dec 13, 2025
Upstream Emacs disabled their cgit snapshot services again.  It is
more future-proofing to fetch Emacs source via git.

More context: nix-community#523 (comment)

Note that this patch does not affect Emacs forks whose source code is
hosted on and fetched via GitHub.

Fixes: nix-community#519
Ref: nix-community#523
Co-authored-by: Lin Jian <me@linj.tech>
jian-lin added a commit to femiagbabiaka/emacs-overlay that referenced this pull request Dec 13, 2025
Upstream Emacs disabled their cgit snapshot services again.  It is
more future-proofing to fetch Emacs source via git.

More context: nix-community#523 (comment)

Note that this patch does not affect Emacs forks whose source code is
hosted on and fetched via GitHub.

Ref: nix-community#523
Co-authored-by: Lin Jian <me@linj.tech>
jian-lin added a commit that referenced this pull request Dec 13, 2025
Upstream Emacs disabled their cgit snapshot services again.  It is
more future-proofing to fetch Emacs source via git.

More context: #523 (comment)

Note that this patch does not affect Emacs forks whose source code is
hosted on and fetched via GitHub.

Ref: #523
Co-authored-by: Lin Jian <me@linj.tech>
Swarsel pushed a commit to Swarsel/emacs-overlay that referenced this pull request Feb 3, 2026
Upstream Emacs disabled their cgit snapshot services again.  It is
more future-proofing to fetch Emacs source via git.

More context: nix-community#523 (comment)

Note that this patch does not affect Emacs forks whose source code is
hosted on and fetched via GitHub.

Ref: nix-community#523
Co-authored-by: Lin Jian <me@linj.tech>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants