"Alexis (surryhill)" <[email protected]> writes:
> Hi Branden, hi Phong
>
> I'd like to offer some personal insights and possible workarounds on
> this, as I've been building from a distribution archive and a
> snapshot archive.
> By snapshot archive I mean any archive (tgz, zip) from a commit
> bundled by your forge of choice, e.g.:
> https://api.github.com/repos/coreutils/gnulib/tarball/833eea6be5607a85bc964bf728a7a82ca461b5b1
> (Couldn't find how to fetch a snapshot archive for groff from Savannah,
> hence the coreutils github example url)
I would assume snapshots are disabled on Savannah, since it likely
invites bot spam. Though trying to access gitweb gives me a 502 error at
the moment, so I can't check if they are available on any repositories.
> When no distribution archive is available snapshot archives are
> preferred in nixpkgs over a real, even just a shallow,
> git (or other VCS) clone, because snapshot archives do not contain the
> VCS history, which takes a toll on build systems and caches.
> The VCS history isn't really relevant for building the software, unless
> of course the project includes a commit hash in the version info.
>
> From a distribution (nixpkgs/NixOS) perspective I find this "annoying";
> from a software builder perspective I see the value in having it.
>
> To build groff from a snapshot archive I'm doing the following to
> work around the issues that stem from it. Note these are hacky and
> only for my personal and not nixpkgs upstream use.
>
> 1. sed -i '/m4_esyscmd/s/.*/${finalAttrs.version}/' configure.ac
> where ${finalAttrs.version} is the version I'd like to give groff.
> For snapshot builds nixpkgs recommends something along the lines of:
> groff-1.25.0.rc1-unstable-2026-07-22
>
> 2. Calling ./bootstrap --no-git --gnulib-srcdir=${gnulib}
> before running autoconf (in nixpkgs terms in the preAutoconf phase).
> Here ${gnulib} is a reference to the gnulib package in nixpkgs
> and will be replaced by the path to gnulib in the nix store (not
> sure what the Guix equivalent term is).
>
> 3. Add --enable-maintainer-mode to the configure flags.
>
> 4. After configure is run
> sed Makefile -e 's/$(LN_S) $(exampledir)/mv $(exampledir)/'
> since this results in a dangling symlink in nixpkgs, which it
> doesn't like. This might not be an issue in Guix.
> As an added measure I'm running find $doc -xtype l -delete
> where $doc refers to the install documentation, just to ensure it
> does not contain symlinks to the groff build.
>
> With these changes to the existing groff nixpkgs, I am able to build
> groff from a snapshot archive using nixpkgs.
This concerns me a bit. Does Nix actually use that Gnulib package to
build GNU software? I ask because the package is pinned to a commit from
2024 [1]. There have been many bug fixes since then. It would be a bit
sad if lots of time is wasted dealing with build errors from outdated
Gnulib files, along with bugs that have been fixed in actual copy used
by tarball.
Collin
[1]
https://github.com/NixOS/nixpkgs/blob/db097eb0b663e66d571cf56d14ed9f66df6f6db7/pkgs/by-name/gn/gnulib/package.nix#L9-L17