Skip to content

fetchFromSavannah: deprecate#435964

Merged
jian-lin merged 1 commit intomasterfrom
unknown repository
Jan 15, 2026
Merged

fetchFromSavannah: deprecate#435964
jian-lin merged 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Aug 22, 2025

Context

fetchFromSavannah is a fetcher which interpolates its arguments into a URL to be used by fetchzip to download a CGit snapshot from GNU Savannah's cgit instance.

Most Savannah and GNU software is available through archive mirrors which are enumerated in nixpkgs via "mirror://" and is used for the majority of GNU/Savannah packages in nixpkgs and in other distributions.

I also updated the link for the savannah fetcher in #427024

The Issue

Doing a naive grep of the nixpkgs source checkout, fetchFromSavannah is only used in a total of 5 packages. With single digit usage and no discernible tests, keeping fetchFromSavannah becomes a maintenance burden when it can easily be removed.

Also, CGit offers snapshot support, but it is optional and is not a API interface. Considering that GNU expects distributions to download from their release mirrors, we can't rely on CGit in the same way one can rely on Gitea/GitLab/GitHub.

The Solution

Replace each usage of fetchFromSavannah with either a fetchurl mirror or a fetchgit call and adjust as needed.

Packages changed

Tracking PRs:

Deprecation notice

I decided not to remove fetchFromSavannah completely but to instead deprecate via lib.warn and remove its entry from fetchers documentation to account for downstream use since fetchFromSavannah was in nixpkgs for a long time, it should be removed in the subsequent release of nixpkgs though, downstreams that use the savannah fetcher can just re-implement the string interpolating function downstream.

So far I know emacs-overlay does use the savannah fetcher and nix-update has a savannah update codepath (that haphazardly works)

{
  lib,
  repoRevToNameMaybe,
  fetchzip,
}:

lib.makeOverridable (
  # cgit example, snapshot support is optional in cgit
  {
    repo,
    rev,
    name ? repoRevToNameMaybe repo rev "savannah",
    ... # For hash agility
  }@args:
  fetchzip (
    {
      inherit name;
      url =
        let
          repo' = lib.last (lib.strings.splitString "/" repo); # support repo like emacs/elpa
        in
        "https://cgit.git.savannah.gnu.org/cgit/${repo}.git/snapshot/${repo'}-${rev}.tar.gz";
      meta.homepage = "https://cgit.git.savannah.gnu.org/cgit/${repo}.git/";
      passthru.gitRepoUrl = "https://cgit.git.savannah.gnu.org/git/${repo}.git";
    }
    // removeAttrs args [
      "repo"
      "rev"
    ]
  )
  // {
    inherit rev;
  }
)

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@ghost ghost marked this pull request as draft August 22, 2025 20:04
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 8.has: changelog This PR adds or changes release notes 6.topic: emacs Text editor 6.topic: ruby A dynamic, open source programming language with a focus on simplicity and productivity. 8.has: documentation This PR adds or changes documentation labels Aug 22, 2025
@ghost ghost force-pushed the deprecate-savannah-fetcher branch from d5a45bc to f8d6258 Compare August 22, 2025 20:18
@ghost ghost changed the base branch from master to staging August 22, 2025 20:18
@nixpkgs-ci nixpkgs-ci bot closed this Aug 22, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Aug 22, 2025
@ghost ghost changed the base branch from staging to master August 22, 2025 20:20
@nixpkgs-ci nixpkgs-ci bot closed this Aug 22, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Aug 22, 2025
Copy link
Contributor

@jian-lin jian-lin Aug 22, 2025

Choose a reason for hiding this comment

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

fetchfromsavannah currently is not widely used in Nixpkgs. However, as I mentioned before, we, Nixpkgs Emacs ecosystem maintainers, plan to use fetchfromsavannah to re-write (non-)GNU (devel-)ELPA package generation for reproducibility. fetchfromsavannah will be used by about 1500 elisp packages after the re-write. It will be used to fetch tarballs of arbitrary commit of elisp packages in https://cgit.git.savannah.gnu.org/cgit/emacs/nongnu.git/ and https://git.savannah.gnu.org/cgit/emacs/elpa.git/ .

Given this potential use case of fetchfromsavannah, do you still think removing it is a good idea? If so, what is the alternative of fetchfromsavannah?

Copy link
Author

@ghost ghost Aug 22, 2025

Choose a reason for hiding this comment

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

I think the Emacs team then can have their own internal fetchFromSavannah equivalent that they use for elisp package generation as you've said here.

I'm not entirely against using Savannah's cgit snapshot feature in this way at all (outside of general savannah stability concerns). I think removing fetchFromSavannah usage tree-wide and then re-implementing for this purpose would make the Emacs team's work easier since they don't have to worry about breaking the interface for other package consumers (both in nixpkgs and out of it) anymore and can focus on Emacs' needs.

In short, I think this PR would actually aid in this endeavor since its not a nixpkgs wide fetcher anymore that has to stay backwards compatible.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @normalcea about vendoring a specific variant for emacs use.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the Emacs team then can have their own internal fetchFromSavannah equivalent that they use for elisp package generation

I think we all agree that fetchFromSavannah should only be used when necessary. What we do not agree is how to achieve this goal. Instead of removing fetchFromSavannah and then re-introducing it somewhere else, I propose keeping fetchFromSavannah and modifying its doc to tell users to only use it when necessary. Sharing is good and vendoring is bad.

@ghost ghost marked this pull request as ready for review August 22, 2025 20:42
@jian-lin jian-lin self-requested a review August 22, 2025 21:06
@ghost ghost requested a review from philiptaron August 22, 2025 21:33
Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

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

I'd love to merge most of the changes in this PR in their own precursor PRs. Let's do that then focus on the deprecation/removal solely in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @normalcea about vendoring a specific variant for emacs use.

@jian-lin
Copy link
Contributor

jian-lin commented Oct 1, 2025

Re @normalcea

"similar" from the doc is quite open to interpretation. As I said above, we need to improve the doc.

BTW, I do not think "similar" means other fetchers should also support fallback from fetchzip to fetchgit.

For fetchers that do not have the fetchgit fallback now, are there real use cases needing fetchgit fallback?


Re renaming fetchFromSavannah to fetchSavannahSnapshot

"snapshot" does not add more meaning, I think, because fetchFrom* fetchers almost all fetch snapshots.

In addition, if we do that rename, what should be the new implementation of fetchFromSavannah?


Re @philiptaron's first thought

I am not sure if you have read https://www.mail-archive.com/bug-gnulib%40gnu.org/msg48636.html or not. My conclusion after reading that is savannah only disables cgit snapshots when savannah is under DDoS attack or for some specific repos. Cgit snapshot is an interface and fetchFromSavannah is reliable. In fact, as a heavy user of fetchFromSavannah, emacs-overlay only had issues with fetchFromSavannah when savannah was under DDoS attack.

In addition, fetchFromSavannah is not replaceable in some cases. See #435964 (comment)

I do not quite understand @philiptaron's second thought since I am not a native English speaker. So I won't comment on that.


Conclusion: extending doc of fetchFromSavannah (maybe like this) is enough

Only use fetchFromSavannah when you really want to fetch snapshots. If possible, prefer fetchzip/fetchurl or fetchgit.

@ghost
Copy link
Author

ghost commented Oct 1, 2025

@jian-lin

For fetchers that do not have the fetchgit fallback now, are there real use cases needing fetchgit fallback?

When needing to pass args such as fetchSubmodules and deepClone and still keeping the same fetcher (which handles the URL logic that doesn't need to be repeated in consuming derivation src builders). This is done with fetchFromGitHub

"snapshot" does not add more meaning, I think, because fetchFrom* fetchers almost all fetch snapshots.

Snapshot can add meaning by setting that this is fetching a snapshot offered by Savannah rather than being the best effort general-purpose fetcher from savannah which is competing with fetchgit and mirrors.

In addition, if we do that rename, what should be the new implementation of fetchFromSavannah?

There is no new implementation, this is still a deprecation in the sense that it is a symbolic deprecation. Savannah's cgit instance and their canonical savannah urls are not related by any sort of pattern we can take advantage of so it's difficult to extend fetchFromSavannah in a confident way. But it's not a vendoring of the functionality offered by said fetcher to be internally used in nixpkgs and not shared.

Only use fetchFromSavannah when you really want to fetch snapshots. If possible, prefer fetchzip/fetchurl or fetchgit.

I don't think going down this route would be helpful in the long-term and it's also not the approach I want to take with fetcher documentation. For example "how" does one know when to prefer mirrors or fetchgit and "what" is a snapshot referring to (since it still leaves out the fact that these are served by their cgit instance).

However, I agree that these sorts of recommendations about when to use certain fetchers are also needed.

Re: @philiptaron

I also am in the same boat as @jian-lin in your second point (I'm a native english speaker so don't feel bad jian-lin for not understanding), you did say it was a collection of conflicting thoughts. I'm interested to hear your opinion specifically on the effects of renaming the savannah fetcher (allowing it to be shared with out-of-tree) while also implicitly discouraging its use as a general purpose fetcher via a rename.


At the very least I strongly agree that the documentation for the fetchers has room for improvement. I personally prefer if the fetchers were more verbose and technical so that one does not ever have the need to read the implementation to understand how to use the fetcher.

But I also don't want to go down the route of fetchFromSourcehut which while being technical also feels too conversational as documentation.

(doc/build-helpers/fetchers.chapter.md)

## `fetchFromSourcehut` {#fetchfromsourcehut}

This is used with sourcehut repositories. Similar to `fetchFromGitHub` above,
it expects `owner`, `repo`, `rev` and `hash`, but don't forget the tilde (~)
in front of the username! Expected arguments also include `vc` ("git" (default)
or "hg"), `domain` and `fetchSubmodules`.

If `fetchSubmodules` is `true`, `fetchFromSourcehut` uses `fetchgit`
or `fetchhg` with `fetchSubmodules` or `fetchSubrepos` set to `true`,
respectively. Otherwise, the fetcher uses `fetchzip`.

@philiptaron philiptaron dismissed their stale review October 3, 2025 20:38

@jian-lin's ❌ vetoing. I think we don't deprecate.

@nixpkgs-ci nixpkgs-ci bot removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 3, 2025
@ghost
Copy link
Author

ghost commented Oct 11, 2025

My mind has also changed, echoing what @philiptaron mentioned, all in-tree uses of fetchFromSavannah on unique (as in, not tied to any autogeneration) packages have been replaced. It doesn't seem fair to me anymore to insist on deprecation over semantics.

@ghost
Copy link
Author

ghost commented Jan 8, 2026

From #477666 it stands to reason that the Savannah admins have disabled cgit snapshotting.

Guix1 for example, shows the "Download' section in the tags header but clicking on it leads you to the revision status rather than a download link. Grub2 is the same way, Emacs3 too.

Re-opening this PR, glad I didn't delete the patches. But now the question is that a nixpkgs fetcher is in a non-working state, so this deprecation will have to be backported to 25.11 from the looks of it. This makes me think instead of outright removal, a deprecation is more warranted in the off-chance that the Savannah administrators decide to re-enable the feature or that there exists a savannah package that still has snapshots or snapshots are re-enabled for some packages but not all.

I can't find an official announcement of this change, finding a response from the Savannah admins would be helpful.

CC: @jian-lin @philiptaron

Footnotes

  1. https://cgit.git.savannah.gnu.org/cgit/guix.git/

  2. https://cgit.git.savannah.gnu.org/cgit/grub.git/

  3. https://cgit.git.savannah.gnu.org/cgit/emacs.git/

@ghost ghost reopened this Jan 8, 2026
@ghost ghost force-pushed the deprecate-savannah-fetcher branch from 619431c to 4e4f235 Compare January 8, 2026 21:22
@ghost ghost changed the title fetchFromSavannah: deprecate and replace usage fetchFromSavannah: deprecate Jan 8, 2026
@jian-lin
Copy link
Contributor

jian-lin commented Jan 8, 2026

As I said, I agree with the deprecation or removal now since the situation has changed.


this deprecation will have to be backported to 25.11

I do not think it is a "have to". Quite the opposite, the deprecation does not seem to be a qualified backport according to https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#changes-acceptable-for-releases.

in the off-chance that the Savannah administrators decide to re-enable the feature or that there exists a savannah package that still has snapshots or snapshots are re-enabled for some packages but not all

It would be good to ask Savannah admins about the current state and future plan of cgit snapshot. Would you like to do it?

@ghost
Copy link
Author

ghost commented Jan 9, 2026

I found this thread1 which was made relatively recently (dated December of last year), here's the relevant snippet I pulled out:

Follow-up Comment 1, sr 111357 (group administration):

Also, for another reason, please do not download tarballs from cgit snapshots,
it puts a lot of pressure on the server especially when the git repo is large.
You should modify your build recipes to clone the git repo and do a
"git-archive" to export a tarball.

when you change to the "git clone, git archive" flow, you should fix your
scripts to use our latest and fastest distributed mirror system, i.e.,
(git protocol clone url, fast) git://git.git.savannah.gnu.org
(https clone url) https://https.git.savannah.gnu.org/

It seems like the admin consensus is that downstream packagers really shouldn't be relying on snapshots. @jian-lin if you would like to email them for more details or reply to this email thread you can do it on behalf of nixpkgs but I think they made their position clear enough already.


I do not think it is a "have to". Quite the opposite, the deprecation does not seem to be a qualified backport according to https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#changes-acceptable-for-releases.

There's no word for word on what to do for fetchers, but my intention is for the deprecation to act as a "warning sign" to downstream consumers in stable since the functionality of the fetcher no longer is guaranteed. If we were removing the codepath entirely then I would agree that it wouldn't be appropriate to backport since it would crash downstream evaluations but a deprecation shouldn't do that. I'm all ears for suggestions on how else to do this properly.

Footnotes

  1. https://lists.gnu.org/archive/html/savannah-hackers/2025-12/msg00014.html

Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

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

I don't think we should backport but I do think we should merge given the message above.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 12, 2026
Copy link
Contributor

@jian-lin jian-lin left a comment

Choose a reason for hiding this comment

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

Generally LGTM

I think the commits organization can be improve. Currently the removal of manual section and the changes of redirection are in separated commits, which is not atomic. IMHO, just 1 commit is enough.

@ghost ghost force-pushed the deprecate-savannah-fetcher branch from 4e4f235 to cbde561 Compare January 14, 2026 22:00
@ghost
Copy link
Author

ghost commented Jan 14, 2026

Re: @jian-lin

Squashed the doc removal and redirection into one commit, they are related changes so they should be together.

@jian-lin jian-lin dismissed their stale review January 15, 2026 00:54

outdated

Copy link
Contributor

@jian-lin jian-lin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

One small thing is that GitHub only knows Co-authored-by: instead of Co-developed-by:.

In addition, I do not quite get why you separate the code change and its corresponding doc change into two commits. However, this does not affect my approval since @philiptaron has approved already.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Jan 15, 2026
@ghost ghost force-pushed the deprecate-savannah-fetcher branch from cbde561 to 5d85c19 Compare January 15, 2026 01:45
@ghost
Copy link
Author

ghost commented Jan 15, 2026

Re: @jian-lin

The choice of separation was probably when this PR was a draft and I split the changes into each commit, I squashed all the changes and fixed the "authored by" lines, also adding you as co-author if you want that.

The Savannah administrators do not want package maintainers to use
cgit snapshots due to putting strain on the servers and have disabled
cgit snapshots for most if not all of their repositories.

See: https://lists.gnu.org/archive/html/savannah-hackers/2025-12/msg00014.html

Co-authored-by: Philip Taron <[email protected]>
Co-authored-by: LIN, Jian <[email protected]>
@ghost ghost force-pushed the deprecate-savannah-fetcher branch from 5d85c19 to 03b2128 Compare January 15, 2026 01:48
@jian-lin jian-lin added this pull request to the merge queue Jan 15, 2026
Merged via the queue into NixOS:master with commit d786739 Jan 15, 2026
25 checks passed
@ghost ghost deleted the deprecate-savannah-fetcher branch January 15, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants