Shepherd parallel make help2man issue

  • Open
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Simon Josefsson
Owner
unassigned
Submitted by
Simon Josefsson
Severity
normal

Debbugs page

Simon Josefsson wrote 1 weeks ago
(address . bug-guix@gnu.org)
87tt89z2e1.fsf@josefsson.org
Hi

I got the build error below. Presumably it happens because the jobs to
create the tools has not finished before the help2man jobs has started.

I will patch around this in the Debian packaging to serialize the build:

override_dh_auto_build:
# build tools that help2man needs first
dh_auto_build $(DH_BUILD_OPTS) -- shepherd herd halt reboot
dh_auto_build $(DH_BUILD_OPTS)

But it seems like a upstream problem. I know how annoying these kind of
bugs are, sorry for another report of this type :)

/Simon

dh_auto_build
make -j42
make[1]: Entering directory '/build/reproducible-path/shepherd-1.0.2'
/usr/bin/mkdir -p "`dirname modules/shepherd/config.scm`"
/usr/bin/sed -e 's,%PREFIX%,/usr,g' -e 's,%modsrcdir%,/build/reproducible-path/shepherd-1.0.2/modules,g' -e 's,%modbuilddir%,/build/reproducible-path/shepherd-1.0.2/modules,g' -e 's,%localstatedir%,/var,g' -e 's,%runstatedir%,/run,g' -e 's,%pkglibdir%,/usr/lib/x86_64-linux-gnu/shepherd,g' -e 's,%sysconfdir%,/etc,g' -e 's,%localedir%,/usr/share/locale,g' -e 's,%VERSION%,1.0.2,g' -e 's,%PACKAGE_BUGREPORT%,bug-guix@gnu.org,g' -e 's,%PACKAGE_NAME%,GNU Shepherd,g' -e 's,%PACKAGE_URL%,https://www.gnu.org/software/shepherd/,g'-e 's,%FIBERS_SOURCE_DIRECTORY%,/usr/share/guile/site/3.0,g' -e 's,%FIBERS_OBJECT_DIRECTORY%,/usr/lib/x86_64-linux-gnu/guile/3.0/site-ccache,g' -e 's,%GUILE%,/usr/bin/guile-3.0,g' modules/shepherd/config.scm.in modules/shepherd/config.scm
make all-recursive
make[2]: Entering directory '/build/reproducible-path/shepherd-1.0.2'
Making all in po
make[3]: Entering directory '/build/reproducible-path/shepherd-1.0.2/po'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/build/reproducible-path/shepherd-1.0.2/po'
make[3]: Entering directory '/build/reproducible-path/shepherd-1.0.2'
/usr/bin/mkdir -p "`dirname shepherd`" ; \
/usr/bin/sed -e 's,%PREFIX%,/usr,g' -e 's,%modsrcdir%,/build/reproducible-path/shepherd-1.0.2/modules,g' -e 's,%modbuilddir%,/build/reproducible-path/shepherd-1.0.2/modules,g' -e 's,%localstatedir%,/var,g' -e 's,%runstatedir%,/run,g' -e 's,%pkglibdir%,/usr/lib/x86_64-linux-gnu/shepherd,g' -e 's,%sysconfdir%,/etc,g' -e 's,%localedir%,/usr/share/locale,g' -e 's,%VERSION%,1.0.2,g' -e 's,%PACKAGE_BUGREPORT%,bug-guix@gnu.org,g' -e 's,%PACKAGE_NAME%,GNU Shepherd,g' -e 's,%PACKAGE_URL%,https://www.gnu.org/software/shepherd/,g'-e 's,%FIBERS_SOURCE_DIRECTORY%,/usr/share/guile/site/3.0,g' -e 's,%FIBERS_OBJECT_DIRECTORY%,/usr/lib/x86_64-linux-gnu/guile/3.0/site-ccache,g' -e 's,%GUILE%,/usr/bin/guile-3.0,g' shepherd.in shepherd ; \
chmod +x shepherd
/usr/bin/mkdir -p "`dirname herd`" ; \
/usr/bin/sed -e 's,%PREFIX%,/usr,g' -e 's,%modsrcdir%,/build/reproducible-path/shepherd-1.0.2/modules,g' -e 's,%modbuilddir%,/build/reproducible-path/shepherd-1.0.2/modules,g' -e 's,%localstatedir%,/var,g' -e 's,%runstatedir%,/run,g' -e 's,%pkglibdir%,/usr/lib/x86_64-linux-gnu/shepherd,g' -e 's,%sysconfdir%,/etc,g' -e 's,%localedir%,/usr/share/locale,g' -e 's,%VERSION%,1.0.2,g' -e 's,%PACKAGE_BUGREPORT%,bug-guix@gnu.org,g' -e 's,%PACKAGE_NAME%,GNU Shepherd,g' -e 's,%PACKAGE_URL%,https://www.gnu.org/software/shepherd/,g'-e 's,%FIBERS_SOURCE_DIRECTORY%,/usr/share/guile/site/3.0,g' -e 's,%FIBERS_OBJECT_DIRECTORY%,/usr/lib/x86_64-linux-gnu/guile/3.0/site-ccache,g' -e 's,%GUILE%,/usr/bin/guile-3.0,g' herd.in herd ; \
chmod +x herd
/usr/bin/mkdir -p "`dirname halt`" ; \
/usr/bin/sed -e 's,%PREFIX%,/usr,g' -e 's,%modsrcdir%,/build/reproducible-path/shepherd-1.0.2/modules,g' -e 's,%modbuilddir%,/build/reproducible-path/shepherd-1.0.2/modules,g' -e 's,%localstatedir%,/var,g' -e 's,%runstatedir%,/run,g' -e 's,%pkglibdir%,/usr/lib/x86_64-linux-gnu/shepherd,g' -e 's,%sysconfdir%,/etc,g' -e 's,%localedir%,/usr/share/locale,g' -e 's,%VERSION%,1.0.2,g' -e 's,%PACKAGE_BUGREPORT%,bug-guix@gnu.org,g' -e 's,%PACKAGE_NAME%,GNU Shepherd,g' -e 's,%PACKAGE_URL%,https://www.gnu.org/software/shepherd/,g'-e 's,%FIBERS_SOURCE_DIRECTORY%,/usr/share/guile/site/3.0,g' -e 's,%FIBERS_OBJECT_DIRECTORY%,/usr/lib/x86_64-linux-gnu/guile/3.0/site-ccache,g' -e 's,%GUILE%,/usr/bin/guile-3.0,g' halt.in halt ; \
chmod +x halt
/usr/bin/mkdir -p "`dirname reboot`" ; \
/usr/bin/sed -e 's,%PREFIX%,/usr,g' -e 's,%modsrcdir%,/build/reproducible-path/shepherd-1.0.2/modules,g' -e 's,%modbuilddir%,/build/reproducible-path/shepherd-1.0.2/modules,g' -e 's,%localstatedir%,/var,g' -e 's,%runstatedir%,/run,g' -e 's,%pkglibdir%,/usr/lib/x86_64-linux-gnu/shepherd,g' -e 's,%sysconfdir%,/etc,g' -e 's,%localedir%,/usr/share/locale,g' -e 's,%VERSION%,1.0.2,g' -e 's,%PACKAGE_BUGREPORT%,bug-guix@gnu.org,g' -e 's,%PACKAGE_NAME%,GNU Shepherd,g' -e 's,%PACKAGE_URL%,https://www.gnu.org/software/shepherd/,g'-e 's,%FIBERS_SOURCE_DIRECTORY%,/usr/share/guile/site/3.0,g' -e 's,%FIBERS_OBJECT_DIRECTORY%,/usr/lib/x86_64-linux-gnu/guile/3.0/site-ccache,g' -e 's,%GUILE%,/usr/bin/guile-3.0,g' reboot.in reboot ; \
chmod +x reboot
LANGUAGE= /bin/bash '/build/reproducible-path/shepherd-1.0.2/build-aux/missing' help2man --source=GNU --info-page=shepherd --output="doc/shepherd.1" "./`basename "doc/shepherd.1" .1`"
LANGUAGE= /bin/bash '/build/reproducible-path/shepherd-1.0.2/build-aux/missing' help2man --source=GNU --info-page=shepherd --output="doc/herd.1" "./`basename "doc/herd.1" .1`"
make[4]: Entering directory '/build/reproducible-path/shepherd-1.0.2'
help2man: can't get `--help' info from ./herd
Try `--no-discard-stderr' if option outputs to stderr
help2man: can't get `--help' info from ./shepherd
Try `--no-discard-stderr' if option outputs to stderr
WARNING: 'help2man' is missing on your system.
You should only need it if you modified a dependency of a man page.
You may want to install the GNU Help2man package:
WARNING: 'help2man' is missing on your system.
You should only need it if you modified a dependency of a man page.
You may want to install the GNU Help2man package:
make[3]: *** [Makefile:2252: doc/shepherd.1] Error 127
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:2255: doc/herd.1] Error 127
make[4]: Leaving directory '/build/reproducible-path/shepherd-1.0.2'
Updating ./doc/version.texi
make[3]: Leaving directory '/build/reproducible-path/shepherd-1.0.2'
make[2]: *** [Makefile:1470: all-recursive] Error 1
make[2]: Leaving directory '/build/reproducible-path/shepherd-1.0.2'
make[1]: *** [Makefile:871: all] Error 2
make[1]: Leaving directory '/build/reproducible-path/shepherd-1.0.2'
dh_auto_build: error: make -j42 returned exit code 2
-----BEGIN PGP SIGNATURE-----

iQNoBAEWCAMQFiEEo8ychwudMQq61M8vUXIrCP5HRaIFAmfGqicUHHNpbW9uQGpv
c2Vmc3Nvbi5vcmfCHCYAmDMEXJLOtBYJKwYBBAHaRw8BAQdACIcrZIvhrxDBkK9f
V+QlTmXxo2naObDuGt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 3 days ago
(name . Simon Josefsson)(address . simon@josefsson.org)(address . 76735@debbugs.gnu.org)
87bjuaq71c.fsf@gnu.org
Hi Simon,

Simon Josefsson <simon@josefsson.org> skribis:

Toggle quote (3 lines)
> I got the build error below. Presumably it happens because the jobs to
> create the tools has not finished before the help2man jobs has started.

Am I right that you’re building from a Git checkout?

The problem is that the Makefile rules for man pages are meant for
developers building the tarball; the tarball already includes man pages,
so someone building from the tarball doesn’t trigger any of these rules.

The changes below fix dependencies, but it also means that now everyone
will be building man pages from source, even if they’re already included
in the tarball. That’s probably the right thing to do longer term, but
I’d rather not do it in the middle of a stable series.

WDYT?

Ludo’.
Toggle diff (92 lines)
diff --git a/Makefile.am b/Makefile.am
index 23d1360..9d5e053 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -131,15 +131,18 @@ AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;
HELP2MANFLAGS = --source=GNU --info-page=$(PACKAGE_TARNAME)
gen_man = $(AM_V_HELP2MAN)LANGUAGE= $(HELP2MAN) $(HELP2MANFLAGS)
-doc/shepherd.1: modules/shepherd.scm configure.ac
+doc/shepherd.1: shepherd $(nodist_shepherdsub_DATA) modules/shepherd.scm configure.ac
+ $(MKDIR_P) doc
$(gen_man) --name="Service manager for the GNU system" \
--output="$@" "$(top_builddir)/`basename "$@" .1`"
-doc/herd.1: modules/shepherd/scripts/herd.scm configure.ac
+doc/herd.1: herd $(nodist_shepherdsub_DATA) modules/shepherd/scripts/herd.scm configure.ac
+ $(MKDIR_P) doc
$(gen_man) --name="Control the shepherd(1) service manager" \
--output="$@" "$(top_builddir)/`basename "$@" .1`"
-doc/%.8: modules/shepherd/scripts/%.scm configure.ac
+doc/%.8: % $(nodist_shepherdsub_DATA) modules/shepherd/scripts/%.scm configure.ac
+ $(MKDIR_P) doc
$(gen_man) --section=8 --output="$@" \
"$(top_builddir)/`basename "$@" .8`"
@@ -223,13 +226,13 @@ instantiate = \
# Emit a 'chmod +x' command only if $@ matches one of the scripts.
maybe_executable = \
- $(subst $@,chmod +x $@, \
+ $(subst $@,chmod +x "$@.tmp", \
$(findstring $@,$(bin_SCRIPTS) $(sbin_SCRIPTS)))
%: %.in Makefile
$(AM_V_GEN)$(MKDIR_P) "`dirname $@`" ; \
- $(SED) $(instantiate) < $< >$@ ; \
- $(maybe_executable)
+ $(SED) $(instantiate) < "$<" > "$@.tmp" ; \
+ $(maybe_executable) ; mv "$@.tmp" "$@"
modules/shepherd/config.scm: modules/shepherd/config.scm.in Makefile
$(MKDIR_P) "`dirname $@`"
diff --git a/halt.in b/halt.in
index 93ac83c..6516cf2 100644
--- a/halt.in
+++ b/halt.in
@@ -2,6 +2,6 @@
-*- scheme -*-
!#
-(set! %load-path (cons "%modsrcdir%" %load-path))
+(set! %load-path (append '("%modbuilddir%" "%modsrcdir%") %load-path))
(set! %load-compiled-path (cons "%modbuilddir%" %load-compiled-path))
(apply (@ (shepherd scripts halt) main) (cdr (command-line)))
diff --git a/herd.in b/herd.in
index e61d26b..09e2fd7 100644
--- a/herd.in
+++ b/herd.in
@@ -3,7 +3,7 @@
!#
(set! %load-path
- (append '("%modsrcdir%" "%FIBERS_SOURCE_DIRECTORY%") %load-path))
+ (append '("%modbuilddir%" "%modsrcdir%" "%FIBERS_SOURCE_DIRECTORY%") %load-path))
(set! %load-compiled-path
(append '("%modbuilddir%" "%FIBERS_OBJECT_DIRECTORY%") %load-compiled-path))
diff --git a/reboot.in b/reboot.in
index 254b095..7bd93fa 100644
--- a/reboot.in
+++ b/reboot.in
@@ -2,6 +2,6 @@
-*- scheme -*-
!#
-(set! %load-path (cons "%modsrcdir%" %load-path))
+(set! %load-path (append '("%modbuilddir%" "%modsrcdir%") %load-path))
(set! %load-compiled-path (cons "%modbuilddir%" %load-compiled-path))
(apply (@ (shepherd scripts reboot) main) (cdr (command-line)))
diff --git a/shepherd.in b/shepherd.in
index 29a8227..b61fd35 100644
--- a/shepherd.in
+++ b/shepherd.in
@@ -3,7 +3,7 @@
!#
(set! %load-path
- (append '("%modsrcdir%" "%FIBERS_SOURCE_DIRECTORY%") %load-path))
+ (append '("%modbuilddir%" "%modsrcdir%" "%FIBERS_SOURCE_DIRECTORY%") %load-path))
(set! %load-compiled-path
(append '("%modbuilddir%" "%FIBERS_OBJECT_DIRECTORY%") %load-compiled-path))
Simon Josefsson wrote 3 days ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 76735@debbugs.gnu.org)
87frjl52sg.fsf@josefsson.org
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (9 lines)
> Hi Simon,
>
> Simon Josefsson <simon@josefsson.org> skribis:
>
>> I got the build error below. Presumably it happens because the jobs to
>> create the tools has not finished before the help2man jobs has started.
>
> Am I right that you’re building from a Git checkout?

This was during build of Debian packages of Shepherd. They use the
tarballs.

Toggle quote (5 lines)
> The problem is that the Makefile rules for man pages are meant for
> developers building the tarball; the tarball already includes man pages,
> so someone building from the tarball doesn’t trigger any of these
> rules.

Ah. The Debian packaging intentionally removes the prebuilt manpages
because we want to know that we can rebuild them from source. That is
what is triggering this problem!

execute_after_dh_auto_clean:
rm -fv doc/shepherd.info doc/herd.1 doc/shepherd.1
rm -fv doc/stamp-vti doc/version.texi

So maybe this is not so much of an upstream problem after all, and my
fault for trying to rebuild the manpages.

Maybe we should build from a 'git-archive' snapshot instead... but those
doesn't come with PGP signatures right now, although you could do that:


essentially just:

git archive --prefix=shepherd-vX.Y/ -o shepherd-vX.Y-src.tar.gz vX.Y
gpg --sign shepherd-vX.Y-src.tar.gz

Toggle quote (5 lines)
> The changes below fix dependencies, but it also means that now everyone
> will be building man pages from source, even if they’re already included
> in the tarball. That’s probably the right thing to do longer term, but
> I’d rather not do it in the middle of a stable series.

Thanks for developing that patch. This problem is complex, and I'm not
sure what the best solution really is. Your patch makes the man pages
depend on the binary, and I've had bad experiences with that. If
someone is cross-compile Shepherd (not sure if that's a realistic
situation) then help2man can't run the binary, and in this situation it
would be preferable to fall back on the prebuilt manpages. That doesn't
sound ideal.

Maybe an uglier solution is to try to run help2man, and if it works,
then fine, but if it doesn't, re-use the prebuilt manpage or fail.

/Simon
-----BEGIN PGP SIGNATURE-----

iQNoBAEWCAMQFiEEo8ychwudMQq61M8vUXIrCP5HRaIFAmfOA6AUHHNpbW9uQGpv
c2Vmc3Nvbi5vcmfCHCYAmDMEXJLOtBYJKwYBBAHaRw8BAQdACIcrZIvhrxDBkK9f
V+QlTmXxo2naObDuGtw58YaxlOu0JVNpbW9uIEpvc2Vmc3NvbiA8c2ltb25Aam9z
ZWZzc29uLm9yZz6IlgQTFggAPgIbAwULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgBYh
BLHSvRN1vst4TPT4xNc89jjFPAa+BQJl/YgIBQkLehFUAAoJENc89jjFPAa+CboA
+wUa06RD5e5VTCxvSWtPS75Wq2qBeYGZnf0jvUMxa2n4AP4xkUeAPPnNuMsTm2fs
FCDIGaEM2Yn6Vb2huzzT1Fw/BLgzBFySz4EWCSsGAQQB2kcPAQEHQOxTCIOaeXAx
I2hIX4HK9bQTpNVei708oNr1Klm8qCGKiPUEGBYIACYCGwIWIQSx0r0Tdb7LeEz0
+MTXPPY4xTwGvgUCZf2IKwUJC3oQqgCBdiAEGRYIAB0WIQSjzJyHC50xCrrUzy9R
cisI/kdFogUCXJLPgQAKCRBRcisI/kdFoqdMAQCgH45aseZgIrwKOvUOA9QfsmeE
8GZHYNuFHmM9FEQS6AD6A4x5aYvoY6lo98pgtw2HPDhmcCXFItjXCrV4A0GmJA4J
ENc89jjFPAa+GcYA/26YQY05bLtnXiIjTiAzrGQrRXxTHPA8Av7TDFHvIetWAP9s
HSoU8OfTwmTiEnGwLlsV7QJclZg3YNz/Ypcp9TqQBrg4BFySz2oSCisGAQQBl1UB
BQEBB0AxlRumDW6nZY7A+VCfek9VpEx6PJmdJyYPt3lNHMd6HAMBCAeIfgQYFggA
JgIbDBYhBLHSvRN1vst4TPT4xNc89jjFPAa+BQJl/YgwBQkLehDGAAoJENc89jjF
PAa+phoA/jrDqIrl/55vUMBhIQv+TP635d2iCTEnyFmbUcP9+gh6APoDsXalVd2c
OGxQtSC+TF8PkZMn1TLkJKAjVxr+xx40AgAKCRBRcisI/kdFotQpAPoDHqUdZrDA
jheardBHpF6qFKTviBdxyV9eddHBdHmNxwEAwKK4wWcPJhqPFm3OuN17gxqQ9Tha
QnsDJBx7ltcJ2ws=
=Kkj3
-----END PGP SIGNATURE-----

Ludovic Courtès wrote 40 hours ago
(name . Simon Josefsson)(address . simon@josefsson.org)(address . 76735@debbugs.gnu.org)
87cyeoodpw.fsf@gnu.org
Hi Simon,

Simon Josefsson <simon@josefsson.org> skribis:

Toggle quote (4 lines)
> Ah. The Debian packaging intentionally removes the prebuilt manpages
> because we want to know that we can rebuild them from source. That is
> what is triggering this problem!

Oh. That makes perfect sense from a reproducible build perspective.

Toggle quote (8 lines)
> Thanks for developing that patch. This problem is complex, and I'm not
> sure what the best solution really is. Your patch makes the man pages
> depend on the binary, and I've had bad experiences with that. If
> someone is cross-compile Shepherd (not sure if that's a realistic
> situation) then help2man can't run the binary, and in this situation it
> would be preferable to fall back on the prebuilt manpages. That doesn't
> sound ideal.

Right, I had forgotten about cross-compilation (we do rely on it in
Guix).

So in practice, we have no choice but to build the tarball natively and
then (cross-)build from the tarball.

Toggle quote (3 lines)
> Maybe an uglier solution is to try to run help2man, and if it works,
> then fine, but if it doesn't, re-use the prebuilt manpage or fail.

Yeah.

Or, longer-term, extract command-line metadata from the Guile modules
and generate man pages without resorting to ‘help2man’.

Ludo’.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 76735@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 76735
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help