All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Makefile: Fix in-tree builds when Sphinx is available
@ 2019-09-19 15:59 Peter Maydell
  2019-09-19 17:12 ` Alex Bennée
  2019-09-20 12:27 ` Eric Blake
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Maydell @ 2019-09-19 15:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée

In commit 27a296fce9821e we switched the qemu-ga manpage over to
being built from Sphinx.  The makefile rules for this were correct
for an out-of-tree build, but break for in-tree builds if Sphinx is
present and we're trying to build the documentation.

Specifically, because Sphinx refuses to build output files into
the same directory as its sources, for an in-tree build we tell
it to build into a subdirectory docs/built, and set up a makefile
variable MANUAL_BUILDDIR indicating where the docs are going.
The makefile rule telling Make how to build qemu-ga.8 correctly
used this variable, but the lines adding qemu-ga.8 to the list
of DOCS to be built and the 'make install' rune did not. The
effect was that for an in-tree build we told Make to build
'docs/interop/qemu-ga.8' but did not provide a specific rule for
doing so, which caused Make to fall back to the old rules.make
rule for building any "%.8" file. Make tried to invoke texi2pod
with a bogus command line, resulting in the error:

  GEN     docs/interop/qemu-ga.8
No filename or title
make: *** [rules.mak:394: docs/interop/qemu-ga.8]

Fix this by using $(MANUAL_BUILDDIR) when constructing the
list of DOCS files we want to build and also in the source
file name we install for 'make install'.

(Among other things, this broke the Shippable CI builds.)

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 Makefile | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile
index 111082ce545..a0c1430b407 100644
--- a/Makefile
+++ b/Makefile
@@ -324,8 +324,19 @@ endif
 endif
 endif
 
+# Sphinx does not allow building manuals into the same directory as
+# the source files, so if we're doing an in-tree QEMU build we must
+# build the manuals into a subdirectory (and then install them from
+# there for 'make install'). For an out-of-tree build we can just
+# use the docs/ subdirectory in the build tree as normal.
+ifeq ($(realpath $(SRC_PATH)),$(realpath .))
+MANUAL_BUILDDIR := docs/built
+else
+MANUAL_BUILDDIR := docs
+endif
+
 ifdef BUILD_DOCS
-DOCS=qemu-doc.html qemu-doc.txt qemu.1 qemu-img.1 qemu-nbd.8 docs/interop/qemu-ga.8
+DOCS=qemu-doc.html qemu-doc.txt qemu.1 qemu-img.1 qemu-nbd.8 $(MANUAL_BUILDDIR)/interop/qemu-ga.8
 DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7
 DOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7
 DOCS+=docs/qemu-block-drivers.7
@@ -699,17 +710,6 @@ dist: qemu-$(VERSION).tar.bz2
 qemu-%.tar.bz2:
 	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
 
-# Sphinx does not allow building manuals into the same directory as
-# the source files, so if we're doing an in-tree QEMU build we must
-# build the manuals into a subdirectory (and then install them from
-# there for 'make install'). For an out-of-tree build we can just
-# use the docs/ subdirectory in the build tree as normal.
-ifeq ($(realpath $(SRC_PATH)),$(realpath .))
-MANUAL_BUILDDIR := docs/built
-else
-MANUAL_BUILDDIR := docs
-endif
-
 define clean-manual =
 rm -rf $(MANUAL_BUILDDIR)/$1/_static
 rm -f $(MANUAL_BUILDDIR)/$1/objects.inv $(MANUAL_BUILDDIR)/$1/searchindex.js $(MANUAL_BUILDDIR)/$1/*.html
@@ -819,7 +819,7 @@ ifdef CONFIG_TRACE_SYSTEMTAP
 	$(INSTALL_DATA) scripts/qemu-trace-stap.1 "$(DESTDIR)$(mandir)/man1"
 endif
 ifneq (,$(findstring qemu-ga,$(TOOLS)))
-	$(INSTALL_DATA) docs/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
+	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
 	$(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)"
 	$(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)"
 	$(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7"
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Makefile: Fix in-tree builds when Sphinx is available
  2019-09-19 15:59 [PATCH] Makefile: Fix in-tree builds when Sphinx is available Peter Maydell
@ 2019-09-19 17:12 ` Alex Bennée
  2019-09-19 17:14   ` Peter Maydell
  2019-09-20 12:27 ` Eric Blake
  1 sibling, 1 reply; 6+ messages in thread
From: Alex Bennée @ 2019-09-19 17:12 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel


Peter Maydell <peter.maydell@linaro.org> writes:

> In commit 27a296fce9821e we switched the qemu-ga manpage over to
> being built from Sphinx.  The makefile rules for this were correct
> for an out-of-tree build, but break for in-tree builds if Sphinx is
> present and we're trying to build the documentation.
>
> Specifically, because Sphinx refuses to build output files into
> the same directory as its sources, for an in-tree build we tell
> it to build into a subdirectory docs/built, and set up a makefile
> variable MANUAL_BUILDDIR indicating where the docs are going.
> The makefile rule telling Make how to build qemu-ga.8 correctly
> used this variable, but the lines adding qemu-ga.8 to the list
> of DOCS to be built and the 'make install' rune did not. The
> effect was that for an in-tree build we told Make to build
> 'docs/interop/qemu-ga.8' but did not provide a specific rule for
> doing so, which caused Make to fall back to the old rules.make
> rule for building any "%.8" file. Make tried to invoke texi2pod
> with a bogus command line, resulting in the error:
>
>   GEN     docs/interop/qemu-ga.8
> No filename or title
> make: *** [rules.mak:394: docs/interop/qemu-ga.8]
>
> Fix this by using $(MANUAL_BUILDDIR) when constructing the
> list of DOCS files we want to build and also in the source
> file name we install for 'make install'.
>
> (Among other things, this broke the Shippable CI builds.)
>
> Reported-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

heh I'd manually rebuilt the patch from your last email. I guess you can
apply this one directly though and I'll clean-up when I rebase for the PR.

> ---
>  Makefile | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 111082ce545..a0c1430b407 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -324,8 +324,19 @@ endif
>  endif
>  endif
>
> +# Sphinx does not allow building manuals into the same directory as
> +# the source files, so if we're doing an in-tree QEMU build we must
> +# build the manuals into a subdirectory (and then install them from
> +# there for 'make install'). For an out-of-tree build we can just
> +# use the docs/ subdirectory in the build tree as normal.
> +ifeq ($(realpath $(SRC_PATH)),$(realpath .))
> +MANUAL_BUILDDIR := docs/built
> +else
> +MANUAL_BUILDDIR := docs
> +endif
> +
>  ifdef BUILD_DOCS
> -DOCS=qemu-doc.html qemu-doc.txt qemu.1 qemu-img.1 qemu-nbd.8 docs/interop/qemu-ga.8
> +DOCS=qemu-doc.html qemu-doc.txt qemu.1 qemu-img.1 qemu-nbd.8 $(MANUAL_BUILDDIR)/interop/qemu-ga.8
>  DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7
>  DOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7
>  DOCS+=docs/qemu-block-drivers.7
> @@ -699,17 +710,6 @@ dist: qemu-$(VERSION).tar.bz2
>  qemu-%.tar.bz2:
>  	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
>
> -# Sphinx does not allow building manuals into the same directory as
> -# the source files, so if we're doing an in-tree QEMU build we must
> -# build the manuals into a subdirectory (and then install them from
> -# there for 'make install'). For an out-of-tree build we can just
> -# use the docs/ subdirectory in the build tree as normal.
> -ifeq ($(realpath $(SRC_PATH)),$(realpath .))
> -MANUAL_BUILDDIR := docs/built
> -else
> -MANUAL_BUILDDIR := docs
> -endif
> -
>  define clean-manual =
>  rm -rf $(MANUAL_BUILDDIR)/$1/_static
>  rm -f $(MANUAL_BUILDDIR)/$1/objects.inv $(MANUAL_BUILDDIR)/$1/searchindex.js $(MANUAL_BUILDDIR)/$1/*.html
> @@ -819,7 +819,7 @@ ifdef CONFIG_TRACE_SYSTEMTAP
>  	$(INSTALL_DATA) scripts/qemu-trace-stap.1 "$(DESTDIR)$(mandir)/man1"
>  endif
>  ifneq (,$(findstring qemu-ga,$(TOOLS)))
> -	$(INSTALL_DATA) docs/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
> +	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
>  	$(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)"
>  	$(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)"
>  	$(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7"


--
Alex Bennée


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Makefile: Fix in-tree builds when Sphinx is available
  2019-09-19 17:12 ` Alex Bennée
@ 2019-09-19 17:14   ` Peter Maydell
  2019-09-19 18:30     ` Alex Bennée
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2019-09-19 17:14 UTC (permalink / raw)
  To: Alex Bennée; +Cc: QEMU Developers

On Thu, 19 Sep 2019 at 18:12, Alex Bennée <alex.bennee@linaro.org> wrote:
>
>
> Peter Maydell <peter.maydell@linaro.org> writes:
>
> > In commit 27a296fce9821e we switched the qemu-ga manpage over to
> > being built from Sphinx.  The makefile rules for this were correct
> > for an out-of-tree build, but break for in-tree builds if Sphinx is
> > present and we're trying to build the documentation.
> >
> > Specifically, because Sphinx refuses to build output files into
> > the same directory as its sources, for an in-tree build we tell
> > it to build into a subdirectory docs/built, and set up a makefile
> > variable MANUAL_BUILDDIR indicating where the docs are going.
> > The makefile rule telling Make how to build qemu-ga.8 correctly
> > used this variable, but the lines adding qemu-ga.8 to the list
> > of DOCS to be built and the 'make install' rune did not. The
> > effect was that for an in-tree build we told Make to build
> > 'docs/interop/qemu-ga.8' but did not provide a specific rule for
> > doing so, which caused Make to fall back to the old rules.make
> > rule for building any "%.8" file. Make tried to invoke texi2pod
> > with a bogus command line, resulting in the error:
> >
> >   GEN     docs/interop/qemu-ga.8
> > No filename or title
> > make: *** [rules.mak:394: docs/interop/qemu-ga.8]
> >
> > Fix this by using $(MANUAL_BUILDDIR) when constructing the
> > list of DOCS files we want to build and also in the source
> > file name we install for 'make install'.
> >
> > (Among other things, this broke the Shippable CI builds.)
> >
> > Reported-by: Eric Blake <eblake@redhat.com>
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>
> heh I'd manually rebuilt the patch from your last email. I guess you can
> apply this one directly though and I'll clean-up when I rebase for the PR.

Yeah; I plan to apply it directly once it's accumulated some
tested-by/reviewed-by tags.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Makefile: Fix in-tree builds when Sphinx is available
  2019-09-19 17:14   ` Peter Maydell
@ 2019-09-19 18:30     ` Alex Bennée
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Bennée @ 2019-09-19 18:30 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers


Peter Maydell <peter.maydell@linaro.org> writes:

> On Thu, 19 Sep 2019 at 18:12, Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>>
>> Peter Maydell <peter.maydell@linaro.org> writes:
>>
>> > In commit 27a296fce9821e we switched the qemu-ga manpage over to
>> > being built from Sphinx.  The makefile rules for this were correct
>> > for an out-of-tree build, but break for in-tree builds if Sphinx is
>> > present and we're trying to build the documentation.
>> >
>> > Specifically, because Sphinx refuses to build output files into
>> > the same directory as its sources, for an in-tree build we tell
>> > it to build into a subdirectory docs/built, and set up a makefile
>> > variable MANUAL_BUILDDIR indicating where the docs are going.
>> > The makefile rule telling Make how to build qemu-ga.8 correctly
>> > used this variable, but the lines adding qemu-ga.8 to the list
>> > of DOCS to be built and the 'make install' rune did not. The
>> > effect was that for an in-tree build we told Make to build
>> > 'docs/interop/qemu-ga.8' but did not provide a specific rule for
>> > doing so, which caused Make to fall back to the old rules.make
>> > rule for building any "%.8" file. Make tried to invoke texi2pod
>> > with a bogus command line, resulting in the error:
>> >
>> >   GEN     docs/interop/qemu-ga.8
>> > No filename or title
>> > make: *** [rules.mak:394: docs/interop/qemu-ga.8]
>> >
>> > Fix this by using $(MANUAL_BUILDDIR) when constructing the
>> > list of DOCS files we want to build and also in the source
>> > file name we install for 'make install'.
>> >
>> > (Among other things, this broke the Shippable CI builds.)
>> >
>> > Reported-by: Eric Blake <eblake@redhat.com>
>> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>>
>> heh I'd manually rebuilt the patch from your last email. I guess you can
>> apply this one directly though and I'll clean-up when I rebase for the PR.
>
> Yeah; I plan to apply it directly once it's accumulated some
> tested-by/reviewed-by tags.

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

>
> thanks
> -- PMM


--
Alex Bennée


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Makefile: Fix in-tree builds when Sphinx is available
  2019-09-19 15:59 [PATCH] Makefile: Fix in-tree builds when Sphinx is available Peter Maydell
  2019-09-19 17:12 ` Alex Bennée
@ 2019-09-20 12:27 ` Eric Blake
  2019-09-20 12:56   ` Peter Maydell
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Blake @ 2019-09-20 12:27 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Alex Bennée


[-- Attachment #1.1: Type: text/plain, Size: 1050 bytes --]

On 9/19/19 10:59 AM, Peter Maydell wrote:
> In commit 27a296fce9821e we switched the qemu-ga manpage over to
> being built from Sphinx.  The makefile rules for this were correct
> for an out-of-tree build, but break for in-tree builds if Sphinx is
> present and we're trying to build the documentation.
> 

> Fix this by using $(MANUAL_BUILDDIR) when constructing the
> list of DOCS files we want to build and also in the source
> file name we install for 'make install'.
> 
> (Among other things, this broke the Shippable CI builds.)
> 
> Reported-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  Makefile | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)

Tested in-tree builds both with and without sphinx installed:

Tested-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Makefile: Fix in-tree builds when Sphinx is available
  2019-09-20 12:27 ` Eric Blake
@ 2019-09-20 12:56   ` Peter Maydell
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2019-09-20 12:56 UTC (permalink / raw)
  To: Eric Blake; +Cc: Alex Bennée, QEMU Developers

On Fri, 20 Sep 2019 at 13:27, Eric Blake <eblake@redhat.com> wrote:
>
> On 9/19/19 10:59 AM, Peter Maydell wrote:
> > In commit 27a296fce9821e we switched the qemu-ga manpage over to
> > being built from Sphinx.  The makefile rules for this were correct
> > for an out-of-tree build, but break for in-tree builds if Sphinx is
> > present and we're trying to build the documentation.
> >
>
> > Fix this by using $(MANUAL_BUILDDIR) when constructing the
> > list of DOCS files we want to build and also in the source
> > file name we install for 'make install'.
> >
> > (Among other things, this broke the Shippable CI builds.)
> >
> > Reported-by: Eric Blake <eblake@redhat.com>
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> > ---
> >  Makefile | 26 +++++++++++++-------------
> >  1 file changed, 13 insertions(+), 13 deletions(-)
>
> Tested in-tree builds both with and without sphinx installed:
>
> Tested-by: Eric Blake <eblake@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks; applied patch to master as a buildfix.

-- PMM


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-09-20 12:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-19 15:59 [PATCH] Makefile: Fix in-tree builds when Sphinx is available Peter Maydell
2019-09-19 17:12 ` Alex Bennée
2019-09-19 17:14   ` Peter Maydell
2019-09-19 18:30     ` Alex Bennée
2019-09-20 12:27 ` Eric Blake
2019-09-20 12:56   ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.