Skip to contentSkip to conversation

openocd: avoid documentation rebuild to fix build issues

PATCH Superseded Thomas Petazzoni 3 participants 4 messages Feb 26, 2017 – Feb 28, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 openocd: avoid documentation rebuild to fix build issues

On PowerPC64(le), we patch all configure scripts. Due to this, the version.texi in OpenOCD files gets regenerated, and then since it has a newer date than openocd.info, openocd build system rebuilds the documentation. Unfortunately, this documentation rebuild fails on old machines.

We work around this by faking the date of the generated version.texi file, to make the build system believe the documentation doesn't need to be regenerated.

Fixes:

http://autobuild.buildroot.net/results/3cbe65a46e75b8e67846d593884c96df97dec7a4

---
Changes since v1: fix commit title

This is an alternative proposal to:

https://patchwork.ozlabs.org/patch/724932/

and to:

https://github.com/ntfreak/openocd/pull/4/commits/2c0cc66d5388e07679ac9f07c1ce0f8469931f02

which was submitted upstream but not accepted.

---
 package/openocd/openocd.mk | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
package/openocd/openocd.mk +15 -0
index 21a302f..0d18365 100644
@@ -99,5 +99,20 @@ HOST_OPENOCD_CONF_OPTS = \
 
 HOST_OPENOCD_DEPENDENCIES = host-libftdi host-libusb host-libusb-compat
 
+# Avoid documentation rebuild. On PowerPC64(le), we patch the
+# configure script. Due to this, the version.texi files gets
+# regenerated, and then since it has a newer date than openocd.info,
+# openocd build system rebuilds the documentation. Unfortunately, this
+# documentation rebuild fails on old machines. We work around this by
+# faking the date of the generated version.texi file, to make the
+# build system believe the documentation doesn't need to be
+# regenerated.
+define OPENOCD_FIX_VERSION_TEXI
+       touch -r $(@D)/doc/openocd.info $(@D)/doc/version.texi
+endef
+OPENOCD_POST_BUILD_HOOKS += OPENOCD_FIX_VERSION_TEXI
+HOST_OPENOCD_POST_BUILD_HOOKS += OPENOCD_FIX_VERSION_TEXI
+
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 openocd: avoid documentation rebuild to fix build issues

Quoted 9 lines · Thomas Petazzoni

On PowerPC64(le), we patch all configure scripts. Due to this, the version.texi in OpenOCD files gets regenerated, and then since it has a newer date than openocd.info, openocd build system rebuilds the documentation. Unfortunately, this documentation rebuild fails on old machines.

We work around this by faking the date of the generated version.texi file, to make the build system believe the documentation doesn't need to be regenerated.

Looks good to me.

I just have a comment about your comment:

I don't think modifying the configure script is sufficient to cause version.texi to be rebuilt, it just causes the timestamp file to be checked. It's the timezone issue that actually causes the rebuild and it happens even though version.texi isn't out of date. (That's why I couldn't reproduce the autobuilder failure, it doesn't happen in my TZ.)

i.e. This causes a doc rebuild on my system (with freshly unpacked source):
touch configure && ./configure && env TZ="US/Eastern" make -C doc

But this doesn't:
touch configure && ./configure && env TZ="Australia/Sydney" make -C doc

(So it's actually a bug in their build system, maybe they'd fix it upstream? ;-))

Cheers,
Sam.

Quoted 48 lines

Fixes:

http://autobuild.buildroot.net/results/3cbe65a46e75b8e67846d593884c96df97dec7a4

---
Changes since v1: fix commit title

This is an alternative proposal to:

https://patchwork.ozlabs.org/patch/724932/

and to:

https://github.com/ntfreak/openocd/pull/4/commits/2c0cc66d5388e07679ac9f07c1ce0f8469931f02

which was submitted upstream but not accepted.

---
 package/openocd/openocd.mk | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
package/openocd/openocd.mk +15 -0
index 21a302f..0d18365 100644
@@ -99,5 +99,20 @@ HOST_OPENOCD_CONF_OPTS = \
 
 HOST_OPENOCD_DEPENDENCIES = host-libftdi host-libusb host-libusb-compat
 
+# Avoid documentation rebuild. On PowerPC64(le), we patch the
+# configure script. Due to this, the version.texi files gets
+# regenerated, and then since it has a newer date than openocd.info,
+# openocd build system rebuilds the documentation. Unfortunately, this
+# documentation rebuild fails on old machines. We work around this by
+# faking the date of the generated version.texi file, to make the
+# build system believe the documentation doesn't need to be
+# regenerated.
+define OPENOCD_FIX_VERSION_TEXI
+       touch -r $(@D)/doc/openocd.info $(@D)/doc/version.texi
+endef
+OPENOCD_POST_BUILD_HOOKS += OPENOCD_FIX_VERSION_TEXI
+HOST_OPENOCD_POST_BUILD_HOOKS += OPENOCD_FIX_VERSION_TEXI
+
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 1/1 openocd: avoid documentation rebuild to fix build issues

Hello,

Quoted 9 lines · Sam Bobroff

i.e. This causes a doc rebuild on my system (with freshly unpacked source):
touch configure && ./configure && env TZ="US/Eastern" make -C doc

But this doesn't:
touch configure && ./configure && env TZ="Australia/Sydney" make -C doc

(So it's actually a bug in their build system, maybe they'd fix it upstream? ;-))

I'm not sure it's really a bug.

The version.texi file contains a date, which will be 17 May 2015 or 18 May 2015 depending on your time zone.

In one case, the version.texi file generated will be the same as the one in the tarball, and in this case, it is careful not to change the timestamp. In other case, the version.texi file really has changed, and therefore its timestamp is updated, causing the rebuild.

That's my explanation of the issue. Of course, there's always the possibility that I did not fully understand the origin of the issue.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH v2 1/1 openocd: avoid documentation rebuild to fix build issues

In reply to Thomas Petazzoni
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

On PowerPC64(le), we patch all configure scripts. Due to this, the version.texi in OpenOCD files gets regenerated, and then since it has a newer date than openocd.info, openocd build system rebuilds the documentation. Unfortunately, this documentation rebuild fails on old machines.

We work around this by faking the date of the generated version.texi file, to make the build system believe the documentation doesn't need to be regenerated.

Quoted 7 lines

Fixes:

http://autobuild.buildroot.net/results/3cbe65a46e75b8e67846d593884c96df97dec7a4

---
Changes since v1: fix commit title

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard