Repository navigation
Man page installation and distribution #12921
Description
Activity
So what is the issue?
Additionally, should distributed man pages be named foo.[1-9] or foo.[1-9].dist?
This seems to imply you have not understood how dists are created: all
.distfiles are included in the distribution but with the.distextension removed. I propose you check how the tarball actually looks like after you runmaketgz.Or check how current dists look like as daily snapshots.
So what is the issue?
mk-ca-bundle.1is getting installed again. I presume that isn't intended since it wasn't before 8.6.0. This changed in eefcc1b, and then a revert of that behavior was done in a911f4f, but then it was reintroduced again in 755b31d. If it's intended for it to be installed, then no change is necessary, but since a911f4f was merged, I assume it wasn't intentional.- The docs Makefiles set several bogus automake variables (
noinst_man_MANS,nodist_MANS) which seem like they do something, but don't, and as far as I can tell, were never supported by automake.
Additionally, should distributed man pages be named foo.[1-9] or foo.[1-9].dist?
This seems to imply you have not understood how dists are created: all
.distfiles are included in the distribution but with the.distextension removed. I propose you check how the tarball actually looks like after you runmaketgz.Indeed, my apologies. I wasn't familiar with how
dist-hookworked and just made some assumptions. I retract my comments about the distributed file name.Or check how current dists look like as daily snapshots.
Thanks for the link.
One last issue I'd lilke to bring up: although curl.1 is distributed once again, on systems without perl, --disable-docs gets auto-selected, preventing its installation (though, I suppose it could be done manually by the packager).
Should --disable-docs disable installation in both
docsanddocs/libcurl? Only the latter actually requires perl, since those without it can just use the distributed copies. Maybe it could be renamed/repurposed as --disable-libcurl-docs, analogous to the cmake optionBUILD_LIBCURL_DOCS?My thinking has been:
- don't include all the generated man page in the tarball since they can be generated and the
.mdversions of the files are still quite readable. There are some .1 files still included, but I didn't care much about those. - the curl.1 is still shipped generated because of legacy and because it is used in the build of the tool, which then can still be done without the need of perl nor nroff
--disable-docsskips generating (and installing) any nroff docs, except the ones that are shipped in the tarball: this should make the build work without requiring perl
Reacted by Michael Forney- don't include all the generated man page in the tarball since they can be generated and the
Distributed
curl.1is also required for reproducible builds (due to nroff output being env-dependent, andtool_hugehelp.cdepending oncurl.1).@michaelforney is there any still outstanding issue in the current tarballs?
Yes, it doesn't look like anything has changed since I opened this issue.
To reiterate:
mk-ca-bundle.1is installed withmake install:
$ tar xJf curl-8.6.1-20240219.tar.xz $ cd curl-8.6.1-20240219 $ ./configure --with-openssl --disable-manual <snip> $ make install DESTDIR="$PWD/stage" <snip> $ find stage -name '*.1' stage/usr/local/share/man/man1/curl.1 stage/usr/local/share/man/man1/mk-ca-bundle.1 stage/usr/local/share/man/man1/curl-config.1 $- Distributed man pages
curl.1andcurl-config.1are not installed on systems without perl.
$ perl /bin/ksh: perl: not found $ tar xJf curl-8.6.1-20240219.tar.xz $ cd curl-8.6.1-20240219 $ ./configure --with-openssl --disable-manual <snip> $ make install DESTDIR="$PWD/stage" <snip> $ find stage -name '*.1' $docs/Makefile.am,docs/libcurl/Makefile.am, anddocs/libcurl/opts/Makefile.amset bogus automake variablesnodist_MANSandnoinst_man_MANS. This has no actual adverse affect but it is confusing and misdirecting for those trying to understand the docs Makefile.am files.
- added a commit that references this issue
on Feb 20, 2024
I did this
Recently there's been a lot of changes around man pages concerning generation, installation, distribution, and build-by-default.
First, here's my understanding of some automake variables used in curl:
man_MANS: Man pages listed here will get built by default and installed, but not distributeddist_man_MANS: Man pages listed here will get built by default, installed, and distributed.noinst_man_MANS: This doesn't actually do anything. I don't see any reference to it in automake or the generated Makefile.nodist_MANS: This doesn't do anything either. Looking at automake source, there isnodist_man_MANS, which is the same asman_MANSsince man pages aren't distributed by default (see https://www.gnu.org/software/automake/manual/html_node/Man-Pages.html). The comment in the source says "We handle nodist_ for uniformity. man pages aren't distributed by default so it isn't actually very important".EXTRA_DIST: Files here are distributed, but not installed or built by the default target.Here's a summary of the recent history of a few man pages:
Before 8.6.0,
mk-ca-bundle.1was not generated, but it was distributed since it was innoinst_man_MANS, which was present inEXTRA_DIST.man_MANS, making it get installed and built by default. Sincenoinst_man_MANSwas dropped fromEXTRA_DIST, it no longer got distributed.man_MANS, so it was no longer installed or built by default. The only reference left tomk-ca-bundle.1at this point was throughnoinst_man_MANS, a bogus variable not used by anything, andCLEANFILES.dist_man_MANS, making it get installed once again, distributed, and built by default. This is the current state.It seems to me that the intent is for it to be built by default and distributed, but not installed. I think the way to do this is to remove
mk-ca-bundle.1fromdist_man_MANS, add it toEXTRA_DISTto distribute it, and add a dependencyall-local: $(MK_CA_DOCS)to build it by default.Before 8.6.0,curl.1was distributed since it was present innoinst_man_MANS, which was added toEXTRA_DIST.As above, eefcc1b droppednoinst_man_MANSfromEXTRA_DIST, which causedcurl.1to no longer be distributed.cf5f604 added it back through a
# $(abs_builddir) is to disable VPATH when searching for this file, which
# would otherwise find the copy in $(srcdir) which breaks the $(HUGE)
# rule in src/Makefile.am in out-of-tree builds that references the file in the
# build directory.
#
# First, seed the used copy of curl.1 with the prebuilt copy (in an out-of-tree
# build), then run make recursively to rebuild it only if its dependencies
# have changed.
$(abs_builddir)/curl.1:
if test "$(top_builddir)x" != "$(top_srcdir)x" -a -e "$(srcdir)/curl.1"; then \
$(INSTALL_DATA) "$(srcdir)/curl.1" $@ \
&& touch -r "$(srcdir)/curl.1" $@; fi
cd cmdline-opts && $(MAKE)
# EXTRA_DIST breaks with $(abs_builddir) so build it using this variable
# but distribute it (using the relative file name) in the next variable
man_MANS = $(abs_builddir)/curl.1
dist-hookcopying it tocurl.1.dist. This is fine, but this could have also been done by addingcurl.1toEXTRA_DIST, which is what was done prior to 8.6.0 (indirectly). If you do end up sticking with thedist-hookand naming itcurl.1.dist, there is some other logic that can be removed:curl/docs/Makefile.am
Lines 115 to 127 in 922091c
curl/docs/Makefile.am
Lines 34 to 36 in 922091c
I believe this was only needed to make the distinction between the distributed
curl.1, and the builtcurl.1for out-of-tree builds. If the distributed file is calledcurl.1.dist, I think this tricky logic can be removed. However, for uniformity, if one distributed manual using the.distnaming scheme, so should the others (curl-config.1andmk-ca-bundle.1).As described above, some automake variables set by curl aren't actually used by automake. I think
noinst_man_MANSandnodist_MANSshould be removed fromdocs/Makefile.am,docs/libcurl/Makefile.am, anddocs/libcurl/opts/Makefile.am, since it just adds to the confusion.I can work on a pull request to resolve these issues, but first, maybe you could confirm the desired behavior? I think it is
Additionally, should distributed man pages be namedfoo.[1-9]orfoo.[1-9].dist?I expected the following
No response
curl/libcurl version
Current master 5a4b2f9
operating system
N/A