Skip to content

Conversation

@sshambar
Copy link
Contributor

@sshambar sshambar commented Mar 9, 2025

make dist was failing to build all man pages. Changed how the *-prepped file dependencies are handled to fix.

Custom man sections were being implemented in configure, but automake runs before they are chosen, so the Makefile.in were missing the install logic. Changed to use _DATA targets with directories that can be chosen at configure time

Also added index.txt to DIST target to fix distcheck

Fixed substitution bug in external_apis/Makefile.am

`make dist` was failing to build all man pages.  Changed how the *-prepped
file dependencies are handled to fix.

Custom man sections were being implemented in configure, but automake
runs before they are chosen, so the Makefile.in were missing the
install logic.  Changed to use _DATA targets with directories that
can be chosen at configure time

Also added index.txt to DIST target to fix distcheck

Fixed substitution bug in external_apis/Makefile.am

Signed-off-by: Scott Shambarger <devel@shambarger.net>
@AppVeyorBot
Copy link

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov
Copy link
Member

Great catch, reasonable analysis and fix - thanks!

How did you stumble on this? On many systems, make distcheck{,-light} did pass - although this is a test to build it in same conditions as the original creation of the archive, so checking in another bare-bone system would have been more reliable.

I did have concerns about better checks of the archive validity, posted at #2829... I suppose your PR brings the solution a step closer :)

@AppVeyorBot
Copy link

@sshambar
Copy link
Contributor Author

How did you stumble on this? On many systems, make distcheck{,-light} did pass - although this is a test to

I was trying to fix the Fedora RPM to build HEAD, and make distclean; make dist to make a source-tar always failed with
cp: cannot stat './nut.conf.5': No such file or directory
but running dist check again worked... traced the problem to the missing suffix rule. (I think distcheck worked because it builds html docs, which masks the man the problem).

Of course, then trying to build the RPM failed to install the man pages (because the install-man: rule was empty), and figured how the man custom-section change caused the automake issues... testing my fix exposed the missing index.txt dist file...

I found a couple other issues updating the RPM, but I figured fixing the build was best done first :)

@jimklimov
Copy link
Member

jimklimov commented Mar 10, 2025

I think the changes about prepped rules broke the build, at least for Sun make.

Your new ruleset seems factually wrong in any case (maybe that is what upsets the build):

+.txt.txt-prepped:
+       rm -f "$(abs_top_builddir)/docs/man/.prep-src-docs"*
+       $(MAKE) prep-src-docs

The .prep-src-docs is a single flag for dependency tracking (newer than all of its prerequisites) so you remove it every time you prep another text file, and then call make prep-src-docs which processes all PREP_SRC files (and makes their individual *-prepped contents). I suppose that new code has potential to overlap, deleting the flag and re-prepping all the files for each file.

Also, calling autotools make is more complicated than that (see other cases with AM_MAKEFLAGS, + for job server cooperation, etc.

Currently it seems to end up with no *-prepped files in distcheck work area, and fails to generate mans/htmls from them.

Also, the .NOTINTERMEDIATE keyword seems to be GNU Make specific, not an automake scripting trick, right?.. In fact, IIRC the percent-rules like %.txt-prepped are also a GNU make extension, not a standard thing.

Was this bit critical for your fixes? I'll try to put back the previous code for these, to see if it helps.

@sshambar
Copy link
Contributor Author

The problem I hit with .prep-src-docs as it was used is that it "satisfied" it's first target (nut.conf.5 in my case), as nut.conf.5 didn't have any explicit recipes... the correct solution would be to have the .txt.txt-prepped rule actually build individual files (so .prep-src-docs isn't needed at all), but you have some fancy business in the .prep-src-docs recipe that I didn't want to mess with...

Reverted... nut.conf.5 will still fail on make distclean; make dist, so the logic for the flag needs to be handled some other way (my recursive make is just what I've seen used for "meta-flags" that handle multiple targets as a batch... but yeah it's probably not universally portable :)

I guess .NOTINTERMEDIATE probably is a GNU thing, would .PRECIOUS be portable?

@jimklimov
Copy link
Member

Actually nut.conf.{5,html} seems to have been a tip of the iceberg, just first in list. A make distcheck -kshowed all (or a lot of) man pages to fail before I reverted that prep part of the fix :\

fail on make distclean; make dist

Aren't you supposed to re-configure in between?

There's also a number of files generated by autogen.sh as templates for configure (so they are EXTRA_DIST'ed but are not in git, and I had a case with files generated from those templates going AWOL at make clean. Possibly the {,DIST,MAINTAINER,...}CLEANFILES lists need a revision if such scenarios fail (helped in that case)...

…ents to help recipe tracing [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…client.la compilation [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov
Copy link
Member

jimklimov commented Mar 11, 2025

Seems the main trick in this regard was about BUILT_SOURCES (fixed in newest commit above). And having the tools to build man pages (when building from git sources), or having them originally (from release/dist tarball).

@jimklimov jimklimov added packaging documentation CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) labels Mar 11, 2025
@jimklimov jimklimov added this to the 2.8.3 milestone Mar 11, 2025
… on top of file [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…OL_MANS definitions [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ist-X (where X in [MAN_MANS, HTML_MANS, SRC_ALL_PAGES])

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… (sources - always)

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…k ALL those we know about (for dist) vs. those we want in this build configuration [networkupstools#2842, networkupstools#2829]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…_VERSION substitutable from templates [networkupstools#722]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…!WITH_MANS !SKIP_MANS, only warn about it [networkupstools#2842]

We may have the pages from tarball, or actually know about the tools needed to build them.

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@AppVeyorBot
Copy link

… on systems without asciidoc (use distcheck-light-DIST_ALL_PAGES to fake pre-built man pages) [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov marked this pull request as draft March 14, 2025 14:49
Fix generation of index.html which on published nut-website was
> Last updated 2023-09-14 14:43:49 UTC -- Network UPS Tools 2.8.0.1

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…re [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…k-fake-man" [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…NUT_REPORT_FEATURE is about the caller request (may be auto, etc.) [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… SUBDIRS of main Makefile; avoid two definitions of "all" goal there [networkupstools#2842, networkupstools#2825]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…NUT_REPORT_FEATURE is about the ability (aligned with caller request) [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ls#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…_SKIPBUILD_LIST [networkupstools#2843]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…med test results [networkupstools#2843]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…TCHECK_FLAGS (if any) [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit to jimklimov/nut that referenced this pull request Mar 15, 2025
…ipes that tolerate placeholders for pre-built man pages [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ipes that tolerate placeholders for pre-built man pages [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…UNABLE_MANS [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…OC_INSTALL_DISTED_MANS [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…or distcheck-ci sub-builds) [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…BLE_MANS [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit to jimklimov/nut that referenced this pull request Mar 15, 2025
…NOWN_UNABLE_MANS [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…NOWN_UNABLE_MANS [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ents for particular document types [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…differentiate from DIST_ALL_HTML_PAGES [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…t-man:DIST_ALL_MAN_PAGES goals [networkupstools#2842]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov merged commit 64137c0 into networkupstools:master Mar 16, 2025
49 checks passed
jimklimov added a commit to jimklimov/nut that referenced this pull request Apr 27, 2025
…` released with NUT v2.8.3

Fallout of networkupstools#2842, used wrong variable name for checking the requested list of doc types

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit that referenced this pull request Apr 29, 2025
Fix fallout from PR #2842 : do fail `configure` when requested doc types can not be built
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) documentation packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants