Skip to contentSkip to conversation

build: fix tentative generation of nft.8 after disabled doc

PATCH Applied Laura Garcia Liebana 3 participants 6 messages May 15, 2020 – May 18, 2020 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: fix tentative generation of nft.8 after disabled doc

Despite doc generation is disabled, the makefile is trying to build it.

$ ./configure --disable-man-doc
$ make
Making all in doc
make[2]: Entering directory '/workdir/build-pkg/workdir/doc'
make[2]: *** No rule to make target 'nft.8', needed by 'all-am'.  Stop.
make[2]: Leaving directory '/workdir/build-pkg/workdir/doc'
make[1]: *** [Makefile:479: all-recursive] Error 1
make[1]: Leaving directory '/workdir/build-pkg/workdir'
make: *** [Makefile:388: all] Error 2
Fixes 4f2813a313ae0 ("build: Include generated man pages in dist tarball")
---
 doc/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
doc/Makefile.am +1 -1
index 6bd90aa6..21482320 100644
@@ -1,3 +1,4 @@
+if BUILD_MAN
 man_MANS = nft.8 libnftables-json.5 libnftables.3
 
 A2X_OPTS_MANPAGE = -L --doctype manpage --format manpage -D ${builddir}
@@ -16,7 +17,6 @@ EXTRA_DIST = ${ASCIIDOCS} ${man_MANS} libnftables-json.adoc libnftables.adoc
 CLEANFILES = \
 	*~
 
-if BUILD_MAN
 nft.8: ${ASCIIDOCS}
 	${AM_V_GEN}${A2X} ${A2X_OPTS_MANPAGE} $<
 
Signature · 1 line
2.20.1
reviewer
#1 lore raw

Hi Laura,

Quoted 25 lines · Laura Garcia Liebana

Despite doc generation is disabled, the makefile is trying to build it.

$ ./configure --disable-man-doc
$ make
Making all in doc
make[2]: Entering directory '/workdir/build-pkg/workdir/doc'
make[2]: *** No rule to make target 'nft.8', needed by 'all-am'.  Stop.
make[2]: Leaving directory '/workdir/build-pkg/workdir/doc'
make[1]: *** [Makefile:479: all-recursive] Error 1
make[1]: Leaving directory '/workdir/build-pkg/workdir'
make: *** [Makefile:388: all] Error 2
Fixes 4f2813a313ae0 ("build: Include generated man pages in dist tarball")
---
 doc/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
doc/Makefile.am +0 -0
index 6bd90aa6..21482320 100644

doc/Makefile.am line 2

Quoted 2 lines
doc/Makefile.am +1 -0
@@ -1,3 +1,4 @@
+if BUILD_MAN
 man_MANS = nft.8 libnftables-json.5 libnftables.3

Did you make sure that dist tarball still contains the generated man pages after your change? Because that's what commit 4f2813a313ae0 ("build: Include generated man pages in dist tarball") tried to fix and apparently broke what you're fixing for.

Cheers, Phil

#2 lore raw
Quoted 24 lines · Phil Sutter

Hi Laura,

Quoted 20 lines · Laura Garcia Liebana

Despite doc generation is disabled, the makefile is trying to build it.

$ ./configure --disable-man-doc
$ make
Making all in doc
make[2]: Entering directory '/workdir/build-pkg/workdir/doc'
make[2]: *** No rule to make target 'nft.8', needed by 'all-am'.  Stop.
make[2]: Leaving directory '/workdir/build-pkg/workdir/doc'
make[1]: *** [Makefile:479: all-recursive] Error 1
make[1]: Leaving directory '/workdir/build-pkg/workdir'
make: *** [Makefile:388: all] Error 2
Fixes 4f2813a313ae0 ("build: Include generated man pages in dist tarball")
---
 doc/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

doc/Makefile.am line 2

Quoted 7 lines
doc/Makefile.am +1 -0
index 6bd90aa6..21482320 100644
@@ -1,3 +1,4 @@
+if BUILD_MAN
 man_MANS = nft.8 libnftables-json.5 libnftables.3

Did you make sure that dist tarball still contains the generated man pages after your change? Because that's what commit 4f2813a313ae0 ("build: Include generated man pages in dist tarball") tried to fix and apparently broke what you're fixing for.

Hi Phil, I tested these cases:
- if the nft.8 already exists it won't be generated
- if it doesn't exist it will be generated
- if disable-man-doc then it won't be generated

I'm missing something?

Thanks!

maintainer Applied
#5 lore raw
In reply to Laura Garcia Liebana
Quoted 12 lines · Laura Garcia Liebana

Despite doc generation is disabled, the makefile is trying to build it.

$ ./configure --disable-man-doc
$ make
Making all in doc
make[2]: Entering directory '/workdir/build-pkg/workdir/doc'
make[2]: *** No rule to make target 'nft.8', needed by 'all-am'.  Stop.
make[2]: Leaving directory '/workdir/build-pkg/workdir/doc'
make[1]: *** [Makefile:479: all-recursive] Error 1
make[1]: Leaving directory '/workdir/build-pkg/workdir'
make: *** [Makefile:388: all] Error 2
Quoted 1 line
Fixes 4f2813a313ae0 ("build: Include generated man pages in dist tarball")

Applied, thanks.

reviewer Acked-by
#3 lore raw
In reply to Laura García Liébana

Hi Laura,

Quoted 36 lines · Laura García Liébana
Quoted 21 lines · Phil Sutter
Quoted 20 lines · Laura Garcia Liebana

Despite doc generation is disabled, the makefile is trying to build it.

$ ./configure --disable-man-doc
$ make
Making all in doc
make[2]: Entering directory '/workdir/build-pkg/workdir/doc'
make[2]: *** No rule to make target 'nft.8', needed by 'all-am'.  Stop.
make[2]: Leaving directory '/workdir/build-pkg/workdir/doc'
make[1]: *** [Makefile:479: all-recursive] Error 1
make[1]: Leaving directory '/workdir/build-pkg/workdir'
make: *** [Makefile:388: all] Error 2
Fixes 4f2813a313ae0 ("build: Include generated man pages in dist tarball")
---
 doc/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

doc/Makefile.am line 2

Quoted 7 lines
doc/Makefile.am +1 -0
index 6bd90aa6..21482320 100644
@@ -1,3 +1,4 @@
+if BUILD_MAN
 man_MANS = nft.8 libnftables-json.5 libnftables.3

Did you make sure that dist tarball still contains the generated man pages after your change? Because that's what commit 4f2813a313ae0 ("build: Include generated man pages in dist tarball") tried to fix and apparently broke what you're fixing for.

Quoted 6 lines

Hi Phil, I tested these cases:
- if the nft.8 already exists it won't be generated
- if it doesn't exist it will be generated
- if disable-man-doc then it won't be generated

I'm missing something?

No, I think your patch is fine. I wasn't sure what happens if man_MANS, EXTRA_DIST, etc. get enclosed by the conditional. Matt's patch explicitly removed the conditionals around man_MANS.

I tried 'make dist' after configure with --enable-man-doc and the generated tarball's build system seems to behave fine (man pages are included, not built again and also installed from 'make install').

So for your patch:

Thanks, Phil

#4 lore raw
Quoted 51 lines · Phil Sutter

Hi Laura,

Quoted 36 lines · Laura García Liébana
Quoted 21 lines · Phil Sutter
Quoted 20 lines · Laura Garcia Liebana

Despite doc generation is disabled, the makefile is trying to build it.

$ ./configure --disable-man-doc
$ make
Making all in doc
make[2]: Entering directory '/workdir/build-pkg/workdir/doc'
make[2]: *** No rule to make target 'nft.8', needed by 'all-am'.  Stop.
make[2]: Leaving directory '/workdir/build-pkg/workdir/doc'
make[1]: *** [Makefile:479: all-recursive] Error 1
make[1]: Leaving directory '/workdir/build-pkg/workdir'
make: *** [Makefile:388: all] Error 2
Fixes 4f2813a313ae0 ("build: Include generated man pages in dist tarball")
---
 doc/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

doc/Makefile.am line 2

Quoted 7 lines
doc/Makefile.am +1 -0
index 6bd90aa6..21482320 100644
@@ -1,3 +1,4 @@
+if BUILD_MAN
 man_MANS = nft.8 libnftables-json.5 libnftables.3

Did you make sure that dist tarball still contains the generated man pages after your change? Because that's what commit 4f2813a313ae0 ("build: Include generated man pages in dist tarball") tried to fix and apparently broke what you're fixing for.

Quoted 6 lines

Hi Phil, I tested these cases:
- if the nft.8 already exists it won't be generated
- if it doesn't exist it will be generated
- if disable-man-doc then it won't be generated

I'm missing something?

No, I think your patch is fine. I wasn't sure what happens if man_MANS, EXTRA_DIST, etc. get enclosed by the conditional. Matt's patch explicitly removed the conditionals around man_MANS.

Quoted 8 lines

I tried 'make dist' after configure with --enable-man-doc and the generated tarball's build system seems to behave fine (man pages are included, not built again and also installed from 'make install').

So for your patch:

Ok, great.

Thank you for your checking.