← Back to team overview

openjdk team mailing list archive

Bug#806421: FTBFS when the Build ID of a shared library starts with 00...

 

Source: openjdk-8
Version: 8u72-b05-1
Severity: serious
Tags: patch
Justification: fails to build from source (but built successfully in the past)

A funny thing happened while building openjdk-8 8u72-b05-1. I've included the
relevant tail of the build log below, but the reason is that one of the shared
libs has a Build ID of
00640740dbc66eb41e0ad49c39fc04c03bd61efb (not the leading double-0)

$ expr substr 00640740dbc66eb41e0ad49c39fc04c03bd61efb 1 2 ; echo "=> $?"
00
1

Since this is running under "set -e" the recipe bombs out.
Suggested fix (since debian/rules uses SHELL=/bin/bash): use shell variable
substrings instead of expr. Patch attached.

Cheers, Roderich



....
dh_link -s  -Nopenjdk-8-jre-cacao
dh_link: skipping link from usr/lib/jvm/java-8-openjdk-amd64 to self
DH_COMPAT=9 dh_strip -s \
         -Nopenjdk-8-jre-cacao   \
        -Xlibjvm.so -X.debuginfo --dbg-package=openjdk-8-dbg
set -ex; \
for i in {debian/openjdk-8-jre-headless,debian/openjdk-8-jre,debian/openjdk-8
-jre-cacao,debian/openjdk-8-jre-zero}/usr/lib/jvm/java-8-openjdk-
amd64/jre/lib/amd64/*/libjvm.so; do \
  [ -f $i ] || continue; \
  b_id=$(LC_ALL=C readelf -n $i | sed -n 's/ *Build ID:
*\([0-9a-f][0-9a-f]*\)/\1/p'); \
  if [ -z "$b_id" ] || [ "9" -lt 9 ]; then \
    id=$(echo $i | sed -r
's,debian/[^/]+,debian/openjdk-8-dbg/usr/lib/debug,'); \
    echo strip $i; \
    mkdir -p $(dirname $id); \
    objcopy --only-keep-debug $i $id; \
    chmod 644 $id; \
    strip --remove-section=.comment --remove-section=.note \
      --strip-debug $i; \
    objcopy --add-gnu-debuglink $id $i; \
  else \
    d=debian/openjdk-8-dbg/usr/lib/debug/.build-id/$(expr substr $b_id 1 2); \
    mkdir -p $d; \
    objcopy --only-keep-debug --compress-debug-sections \
      $i $d/$b_id.debug; \
    chmod 644 $d/$b_id.debug; \
    strip --remove-section=.comment --remove-section=.note \
      $i; \
    objcopy --add-gnu-debuglink \
      $d/$b_id.debug $i; \
  fi; \
done
+ for i in '{debian/openjdk-8-jre-
headless,debian/openjdk-8-jre,debian/openjdk-8-jre-cacao,debian/openjdk-8-jre-
zero}/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/*/libjvm.so'
+ '[' -f debian/openjdk-8-jre-headless/usr/lib/jvm/java-8-openjdk-
amd64/jre/lib/amd64/server/libjvm.so ']'
++ LC_ALL=C
++ readelf -n debian/openjdk-8-jre-headless/usr/lib/jvm/java-8-openjdk-
amd64/jre/lib/amd64/server/libjvm.so
++ sed -n 's/ *Build ID: *\([0-9a-f][0-9a-f]*\)/\1/p'
+ b_id=d50c9388894e515c183f0f5e1e4504013ece9ecf
+ '[' -z d50c9388894e515c183f0f5e1e4504013ece9ecf ']'
+ '[' 9 -lt 9 ']'
++ expr substr d50c9388894e515c183f0f5e1e4504013ece9ecf 1 2
+ d=debian/openjdk-8-dbg/usr/lib/debug/.build-id/d5
+ mkdir -p debian/openjdk-8-dbg/usr/lib/debug/.build-id/d5
+ objcopy --only-keep-debug --compress-debug-sections debian/openjdk-8-jre-
headless/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so
debian/openjdk-8-dbg/usr/lib/debug/.build-
id/d5/d50c9388894e515c183f0f5e1e4504013ece9ecf.debug
+ chmod 644 debian/openjdk-8-dbg/usr/lib/debug/.build-
id/d5/d50c9388894e515c183f0f5e1e4504013ece9ecf.debug
+ strip --remove-section=.comment --remove-section=.note debian/openjdk-8-jre-
headless/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so
+ objcopy --add-gnu-debuglink debian/openjdk-8-dbg/usr/lib/debug/.build-
id/d5/d50c9388894e515c183f0f5e1e4504013ece9ecf.debug debian/openjdk-8-jre-
headless/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so
+ for i in '{debian/openjdk-8-jre-
headless,debian/openjdk-8-jre,debian/openjdk-8-jre-cacao,debian/openjdk-8-jre-
zero}/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/*/libjvm.so'
+ '[' -f 'debian/openjdk-8-jre/usr/lib/jvm/java-8-openjdk-
amd64/jre/lib/amd64/*/libjvm.so' ']'
+ continue
+ for i in '{debian/openjdk-8-jre-
headless,debian/openjdk-8-jre,debian/openjdk-8-jre-cacao,debian/openjdk-8-jre-
zero}/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/*/libjvm.so'
+ '[' -f 'debian/openjdk-8-jre-cacao/usr/lib/jvm/java-8-openjdk-
amd64/jre/lib/amd64/*/libjvm.so' ']'
+ continue
+ for i in '{debian/openjdk-8-jre-
headless,debian/openjdk-8-jre,debian/openjdk-8-jre-cacao,debian/openjdk-8-jre-
zero}/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/*/libjvm.so'
+ '[' -f debian/openjdk-8-jre-zero/usr/lib/jvm/java-8-openjdk-
amd64/jre/lib/amd64/zero/libjvm.so ']'
++ LC_ALL=C
++ readelf -n debian/openjdk-8-jre-zero/usr/lib/jvm/java-8-openjdk-
amd64/jre/lib/amd64/zero/libjvm.so
++ sed -n 's/ *Build ID: *\([0-9a-f][0-9a-f]*\)/\1/p'
+ b_id=00640740dbc66eb41e0ad49c39fc04c03bd61efb
+ '[' -z 00640740dbc66eb41e0ad49c39fc04c03bd61efb ']'
+ '[' 9 -lt 9 ']'
++ expr substr 00640740dbc66eb41e0ad49c39fc04c03bd61efb 1 2
+ d=debian/openjdk-8-dbg/usr/lib/debug/.build-id/00
debian/rules:2216: recipe for target 'binary-arch' failed
make: *** [binary-arch] Error 1
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
Command exited with non-zero status 2



-- System Information:
Debian Release: stretch/sid
  APT prefers xenial
  APT policy: (500, 'xenial'), (500, 'buildd-unstable'), (500, 'unstable'), (1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.3.0 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
--- openjdk-8-8u72-b05-ORIG/debian/rules	2015-11-27 09:05:58.000000000 +0100
+++ openjdk-8-8u72-b05/debian/rules	2015-11-27 11:23:13.071752757 +0100
@@ -2268,7 +2268,7 @@
 	      --strip-debug $$i; \
 	    objcopy --add-gnu-debuglink $$id $$i; \
 	  else \
-	    d=$(d_dbg)/usr/lib/debug/.build-id/$$(expr substr $$b_id 1 2); \
+	  d=$(d_dbg)/usr/lib/debug/.build-id/$${b_id:0:2}; \
 	    mkdir -p $$d; \
 	    objcopy --only-keep-debug --compress-debug-sections \
 	      $$i $$d/$$b_id.debug; \

Follow ups