diff mbox

[PATCHv3] gdb: prevent building the documentation

Message ID 1441800739-14854-1-git-send-email-Vincent.Riera@imgtec.com
State Superseded
Headers show

Commit Message

Vicente Olivert Riera Sept. 9, 2015, 12:12 p.m. UTC
Force gdb to not build the documentation. This way we avoid depending on
host-texinfo. This is a temporary fix until upstream accepts a proposed
--disable-docs configure option.

Since the documentation will not be build at all, we can remove the
parts related to host-texinfo and MAKEINFO in the gdb.mk file.

Fixes:

  http://autobuild.buildroot.net/results/dd5/dd50ed99abb2c8495def826866b184030953f90e/

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
Changes v2 -> v3:
  - Use the post-patch-hook also for host-gdb (Brendan Heading)
  - Remove unnecessary GDB_FROM_GIT (Romain Naour)
Changes v1 -> v2:
  - Indent the sed command
  - Use a post-patch-hook instead of pre-configure-hook
  - Remove the parts related to host-texinfo and MAKEINFO
  - Ammend the commit log to be more appropriate

 package/gdb/gdb.mk |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

Comments

Brendan Heading Sept. 9, 2015, 12:42 p.m. UTC | #1
> Force gdb to not build the documentation. This way we avoid depending on
> host-texinfo. This is a temporary fix until upstream accepts a proposed
> --disable-docs configure option.
>
> Since the documentation will not be build at all, we can remove the
> parts related to host-texinfo and MAKEINFO in the gdb.mk file.
>
> Fixes:
>
>   http://autobuild.buildroot.net/results/dd5/dd50ed99abb2c8495def826866b184030953f90e/
>
> Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>

Tested host GDB clean rebuild for versions 7.8.x, 7.9.x and 7.10.x as
well as target GDB with and without BR2_PACKAGE_GDB_DEBUGGER - builds
fine in all cases.

Tested-by: Brendan Heading <brendanheading@gmail.com>

regards

Brendan
Thomas Petazzoni Sept. 9, 2015, 1:49 p.m. UTC | #2
Dear Vicente Olivert Riera,

On Wed, 9 Sep 2015 13:12:19 +0100, Vicente Olivert Riera wrote:
> Force gdb to not build the documentation. This way we avoid depending on
> host-texinfo. This is a temporary fix until upstream accepts a proposed
> --disable-docs configure option.
> 
> Since the documentation will not be build at all, we can remove the
> parts related to host-texinfo and MAKEINFO in the gdb.mk file.
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/dd5/dd50ed99abb2c8495def826866b184030953f90e/
> 
> Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>

Maybe we could do a similar thing for the binutils package (which is
the only other user of the host-texinfo package), and then remove the
host-texinfo package altogether. That's obviously a completely separate
set of changes.

Thanks,

Thomas
Brendan Heading Sept. 9, 2015, 1:58 p.m. UTC | #3
> Maybe we could do a similar thing for the binutils package (which is
> the only other user of the host-texinfo package), and then remove the
> host-texinfo package altogether. That's obviously a completely separate
> set of changes.

Why not keep host-texinfo around, even if it is not used by any
package which is included with buildroot ?

It would be useful to people maintaining their own packages within
buildroot, now or in the future, where it's easier for them to add the
dependency rather than figure out how/where to patch the package to
prevent it from building documentation.

Brendan
Thomas Petazzoni Sept. 9, 2015, 2:29 p.m. UTC | #4
Brendan,

On Wed, 9 Sep 2015 14:58:22 +0100, Brendan Heading wrote:
> > Maybe we could do a similar thing for the binutils package (which is
> > the only other user of the host-texinfo package), and then remove the
> > host-texinfo package altogether. That's obviously a completely separate
> > set of changes.
> 
> Why not keep host-texinfo around, even if it is not used by any
> package which is included with buildroot ?

Because we don't like to have host packages that are not used by any
other target packages, as this means this host package is never tested.

This is something that is discussed quite often, recently for the
python-colorama package. I sometimes change my mind a bit on this, it's
hard to be completely clear-cut. For python-colorama, the submitter
came with a potentially interesting use case.

For host-texinfo, if there's nothing that depends on it in Buildroot,
we should simply drop it I believe.

Thomas
Vicente Olivert Riera Sept. 9, 2015, 2:41 p.m. UTC | #5
Dear Thomas Petazzoni,

On 09/09/2015 02:49 PM, Thomas Petazzoni wrote:
> Dear Vicente Olivert Riera,
> 
> On Wed, 9 Sep 2015 13:12:19 +0100, Vicente Olivert Riera wrote:
>> Force gdb to not build the documentation. This way we avoid depending on
>> host-texinfo. This is a temporary fix until upstream accepts a proposed
>> --disable-docs configure option.
>>
>> Since the documentation will not be build at all, we can remove the
>> parts related to host-texinfo and MAKEINFO in the gdb.mk file.
>>
>> Fixes:
>>
>>   http://autobuild.buildroot.net/results/dd5/dd50ed99abb2c8495def826866b184030953f90e/
>>
>> Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
> 
> Maybe we could do a similar thing for the binutils package (which is
> the only other user of the host-texinfo package), and then remove the
> host-texinfo package altogether. That's obviously a completely separate
> set of changes.

according to the binutils.mk file, only the one for ARC architecture
needs host-texinfo:

ifeq ($(BR2_arc),y)
BINUTILS_SITE = $(call
github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION))
BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
BINUTILS_FROM_GIT = y
endif

[snip]

ifeq ($(BINUTILS_FROM_GIT),y)
BINUTILS_DEPENDENCIES += host-texinfo host-flex host-bison
HOST_BINUTILS_DEPENDENCIES += host-texinfo host-flex host-bison
endif

However, I have removed the texinfo package and also removed the
host-texinfo dependencies from binutils.mk, and it worked fine:

$ grep "BR2_arc=y" .config
BR2_arc=y

$ ls package/texinfo
ls: cannot access package/texinfo: No such file or directory

$ ls output/build/host-binutils-arc-2015.06/.stamp_host_installed
output/build/host-binutils-arc-2015.06/.stamp_host_installed

$ ls output/build/binutils-arc-2015.06/.stamp_target_installed
output/build/binutils-arc-2015.06/.stamp_target_installed

So this dependency is unnecessary.

Regards,

Vincent.

> Thanks,
> 
> Thomas
>
Thomas Petazzoni Sept. 9, 2015, 2:45 p.m. UTC | #6
Vicente,

On Wed, 9 Sep 2015 15:41:00 +0100, Vicente Olivert Riera wrote:

> according to the binutils.mk file, only the one for ARC architecture
> needs host-texinfo:
> 
> ifeq ($(BR2_arc),y)
> BINUTILS_SITE = $(call
> github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION))
> BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
> BINUTILS_FROM_GIT = y
> endif
> 
> [snip]
> 
> ifeq ($(BINUTILS_FROM_GIT),y)
> BINUTILS_DEPENDENCIES += host-texinfo host-flex host-bison
> HOST_BINUTILS_DEPENDENCIES += host-texinfo host-flex host-bison
> endif
> 
> However, I have removed the texinfo package and also removed the
> host-texinfo dependencies from binutils.mk, and it worked fine:
> 
> $ grep "BR2_arc=y" .config
> BR2_arc=y
> 
> $ ls package/texinfo
> ls: cannot access package/texinfo: No such file or directory
> 
> $ ls output/build/host-binutils-arc-2015.06/.stamp_host_installed
> output/build/host-binutils-arc-2015.06/.stamp_host_installed
> 
> $ ls output/build/binutils-arc-2015.06/.stamp_target_installed
> output/build/binutils-arc-2015.06/.stamp_target_installed
> 
> So this dependency is unnecessary.

Actually, it is not clear to me when binutils/gdb want to rebuild their
documentation. Some versions of gdb did not try to rebuild their
documentation, some did. I wonder if gdb/binutils don't come with a
pre-generated version of the documentation, which might get
re-generated if the timestamps of the generated doc is older than the
documentation source. This is pure guess.

But in any case, if host-texinfo is no longer needed to build the ARC
binutils, then indeed we can drop the host-texinfo dependency, and drop
the host-texinfo package as well.

Best regards,

Thomas
Vicente Olivert Riera Sept. 9, 2015, 2:49 p.m. UTC | #7
Dear Thomas Petazzoni,

On 09/09/2015 03:45 PM, Thomas Petazzoni wrote:
> Vicente,
> 
> On Wed, 9 Sep 2015 15:41:00 +0100, Vicente Olivert Riera wrote:
> 
>> according to the binutils.mk file, only the one for ARC architecture
>> needs host-texinfo:
>>
>> ifeq ($(BR2_arc),y)
>> BINUTILS_SITE = $(call
>> github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION))
>> BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
>> BINUTILS_FROM_GIT = y
>> endif
>>
>> [snip]
>>
>> ifeq ($(BINUTILS_FROM_GIT),y)
>> BINUTILS_DEPENDENCIES += host-texinfo host-flex host-bison
>> HOST_BINUTILS_DEPENDENCIES += host-texinfo host-flex host-bison
>> endif
>>
>> However, I have removed the texinfo package and also removed the
>> host-texinfo dependencies from binutils.mk, and it worked fine:
>>
>> $ grep "BR2_arc=y" .config
>> BR2_arc=y
>>
>> $ ls package/texinfo
>> ls: cannot access package/texinfo: No such file or directory
>>
>> $ ls output/build/host-binutils-arc-2015.06/.stamp_host_installed
>> output/build/host-binutils-arc-2015.06/.stamp_host_installed
>>
>> $ ls output/build/binutils-arc-2015.06/.stamp_target_installed
>> output/build/binutils-arc-2015.06/.stamp_target_installed
>>
>> So this dependency is unnecessary.
> 
> Actually, it is not clear to me when binutils/gdb want to rebuild their
> documentation. Some versions of gdb did not try to rebuild their
> documentation, some did. I wonder if gdb/binutils don't come with a
> pre-generated version of the documentation, which might get
> re-generated if the timestamps of the generated doc is older than the
> documentation source. This is pure guess.
> 
> But in any case, if host-texinfo is no longer needed to build the ARC
> binutils, then indeed we can drop the host-texinfo dependency, and drop
> the host-texinfo package as well.

Maybe this is the reason why host-texinfo is no longer needed:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=bba33ab1e0f7d2ebd8f8435f92ed12e2a3c558a4

Regards,

Vincent.


> Best regards,
> 
> Thomas
>
Thomas Petazzoni Sept. 9, 2015, 3:14 p.m. UTC | #8
Dear Vicente Olivert Riera,

On Wed, 9 Sep 2015 15:49:07 +0100, Vicente Olivert Riera wrote:

> > But in any case, if host-texinfo is no longer needed to build the ARC
> > binutils, then indeed we can drop the host-texinfo dependency, and drop
> > the host-texinfo package as well.
> 
> Maybe this is the reason why host-texinfo is no longer needed:
> 
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=bba33ab1e0f7d2ebd8f8435f92ed12e2a3c558a4

Very possible indeed. But that would only fix the problem for release
tarballs, as the commit log suggests. In binutils, we were depending on
host-texinfo only for ARC, because for ARC, we are pulling the binutils
sources from git, not from a release tarball.

Best regards,

Thomas
Vicente Olivert Riera Sept. 9, 2015, 3:29 p.m. UTC | #9
Dear Thomas Petazzoni,

On 09/09/2015 04:14 PM, Thomas Petazzoni wrote:
> Dear Vicente Olivert Riera,
> 
> On Wed, 9 Sep 2015 15:49:07 +0100, Vicente Olivert Riera wrote:
> 
>>> But in any case, if host-texinfo is no longer needed to build the ARC
>>> binutils, then indeed we can drop the host-texinfo dependency, and drop
>>> the host-texinfo package as well.
>>
>> Maybe this is the reason why host-texinfo is no longer needed:
>>
>> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=bba33ab1e0f7d2ebd8f8435f92ed12e2a3c558a4
> 
> Very possible indeed. But that would only fix the problem for release
> tarballs, as the commit log suggests. In binutils, we were depending on
> host-texinfo only for ARC, because for ARC, we are pulling the binutils
> sources from git, not from a release tarball.

well, for ARC we are also downloading a tarball:

https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2015.06.tar.gz

But yeah, that tarball doesn't include the fixes introduced by that
commit. However, it includes an interesting comment in
bfs/doc/Makefile.{am,in} (the two files that commit patches):

# We do not depend on chew directly so that we can distribute the info
# files, and permit people to rebuild them, without requiring the makeinfo
# program.  If somebody tries to rebuild info, but none of the .texi files
# have changed, then nothing will be rebuilt.

Regards,

Vincent.

> 
> Best regards,
> 
> Thomas
>
Arnout Vandecappelle Sept. 9, 2015, 7:04 p.m. UTC | #10
On 09-09-15 14:12, Vicente Olivert Riera wrote:
> Force gdb to not build the documentation. This way we avoid depending on
> host-texinfo. This is a temporary fix until upstream accepts a proposed
> --disable-docs configure option.
> 
> Since the documentation will not be build at all, we can remove the
> parts related to host-texinfo and MAKEINFO in the gdb.mk file.
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/dd5/dd50ed99abb2c8495def826866b184030953f90e/
> 
> Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>

[snip]
> +# Prevent gdb to build the documentation
> +define GDB_DISABLE_DOC
> +	$(SED) '/^SUBDIRS =/ s/doc//' $(@D)/gdb/Makefile.in
> +endef
> +GDB_POST_PATCH_HOOKS += GDB_DISABLE_DOC
> +HOST_GDB_POST_PATCH_HOOKS += GDB_DISABLE_DOC

 Sorry to be fickle, but post-patch hooks are not called in the OVERRIDE_SRCDIR
case, so perhaps it's better after all to do it in pre-configure (with
appropriate comment why).

 Or perhaps we should call post-patch hooks in .stamp-rsynced...


 Regards,
 Arnout


[snip]
diff mbox

Patch

diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index 338de20..66640f8 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -11,13 +11,11 @@  GDB_SOURCE = gdb-$(GDB_VERSION).tar.xz
 ifeq ($(BR2_arc),y)
 GDB_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(GDB_VERSION))
 GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
-GDB_FROM_GIT = y
 endif
 
 ifeq ($(BR2_microblaze),y)
 GDB_SITE = $(call github,Xilinx,gdb,$(GDB_VERSION))
 GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
-GDB_FROM_GIT = y
 endif
 
 # Use .tar.bz2 for 7.7.x since there was no .tar.xz release back then
@@ -53,6 +51,13 @@  GDB_PRE_PATCH_HOOKS += GDB_XTENSA_PRE_PATCH
 HOST_GDB_PRE_PATCH_HOOKS += GDB_XTENSA_PRE_PATCH
 endif
 
+# Prevent gdb to build the documentation
+define GDB_DISABLE_DOC
+	$(SED) '/^SUBDIRS =/ s/doc//' $(@D)/gdb/Makefile.in
+endef
+GDB_POST_PATCH_HOOKS += GDB_DISABLE_DOC
+HOST_GDB_POST_PATCH_HOOKS += GDB_DISABLE_DOC
+
 # When gdb sources are fetched from the binutils-gdb repository, they
 # also contain the binutils sources, but binutils shouldn't be built,
 # so we disable it.
@@ -165,15 +170,6 @@  else
 HOST_GDB_CONF_OPTS += --without-python
 endif
 
-ifeq ($(GDB_FROM_GIT),y)
-GDB_DEPENDENCIES += host-texinfo
-HOST_GDB_DEPENDENCIES += host-texinfo
-else
-# don't generate documentation
-GDB_CONF_ENV += ac_cv_prog_MAKEINFO=missing
-HOST_GDB_CONF_ENV += ac_cv_prog_MAKEINFO=missing
-endif
-
 # legacy $arch-linux-gdb symlink
 define HOST_GDB_ADD_SYMLINK
 	cd $(HOST_DIR)/usr/bin && \