groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Autoconf, snapshot builds, git-version-gen, and groff's version number


From: G. Branden Robinson
Subject: Autoconf, snapshot builds, git-version-gen, and groff's version number
Date: Fri, 27 May 2022 13:29:11 -0500

Hi folks,

Thanks to Bertrand, groff does a pretty cool thing where the version
number triple is computed based on the tag in the Git repository (using
"git describe").

However this feature seems to play poorly with Savannah/cgit's "snapshot
archive" feature.

You may have noticed that for any commit, Savannah has a dedicated web
page, and from that page you can pull a 'tar' archive of the repository
contents.

Here's an example.

https://git.savannah.gnu.org/cgit/groff.git/commit/?id=c893202d20273c037cb4007e70f38bdc17946cb4

There are two problems with snapshot archives.  One is that because
groff uses a Git submodule (gnulib), that submodule, essential for
building the project, doesn't come along with it.  I've recently updated
the "INSTALL.REPO" instructions to tell people how to overcome this
difficulty.

  Bootstrapping from a snapshot archive
  -------------------------------------

  Obtain groff's supported revision of gnulib and instruct the bootstrap
  script where to find it.

  Here is the output of "git submodule" for this groff release.

   c8b8f3bbcde37a53cd226f4c9cebd0dde6aca37f gnulib (v0.1-5208-gc8b8f3bbcd)

  We therefore do the following.

    $ hash=c8b8f3bbcde37a53cd226f4c9cebd0dde6aca37f
    $ wget -O gnulib.tar.gz https://git.savannah.gnu.org/cgit/gnulib.git/\
  snapshot/gnulib-$hash.tar.gz
    $ tar xf gnulib.tar.gz
    $ ./bootstrap --gnulib-srcdir=gnulib-$hash

So that problem is overcome, albeit with a little bit of tedium imposed
on the user.

The other problem lies at the top of "configure.ac".

  AC_INIT([GNU Troff],
          m4_esyscmd([build-aux/git-version-gen --prefix "" .tarball-version]),
          http://savannah.gnu.org/bugs/?group=groff,
          [groff])

What "git-version-gen" does is either (A) run "git describe" and compute
a version triple from that or (B) read the triple from the file
".tarball-version" (which should never exist in a Git checkout).

But a Savannah/cgit snapshot is neither fish nor fowl.  Out bootstrap
script demands that git be installed, but that doesn't help
git-version-gen any because an unpacked snapshot archive doesn't have
.git directory and "git describe" will thus not work.  Snapshot archives
also contain _only what was in the repository as of that commit_, so
they will _also_ never contain a .tarball-version file.

(There is another file, .version, which caches the output of "git
describe".  git-version-gen says it is there to facilitate [Makefile]
dependencies that need to be cognizant of the version string.  It
doesn't help us because it is .gitignore'd, and never supposed to be
checked in, so snapshot archives will never contain it.)

Does anyone have any ideas for how we might surmount this issue?
git-version-gen is a gnulib thing--do I need to take my plaintive cries
to them?

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]