changeset 1907:bd1235460fae

Include derivative name and version (e.g IcedTea6 1.7) in crash dump. Obtain Mercurial revisions at configure time. 2010-01-20 Andrew John Hughes <ahughes@redhat.com> * Makefile.am: Pass DERIVATIVE_ID and HOTSPOT_BUILD_VERSION to build (later only when the HotSpot Mercurial revision is available). (patch.stamp): Move revision derivation to configure. * acinclude.m4: (IT_GET_LSB_DATA): Report results. (IT_CHECK_FOR_MERCURIAL): Macro wrapper around check for hg. (IT_OBTAIN_HG_REVISIONS): Obtain Mercurial revisions for IcedTea, JDK and HotSpot if available. * configure.ac: Call new macros. * patches/icedtea-version-hotspot.patch: Updated to include DERIVATIVE_ID (IcedTea6 version) in the crash dump output.
author Andrew John Hughes <ahughes@redhat.com>
date Thu, 21 Jan 2010 01:57:01 +0000
parents 91e3d06e1283
children ac7b942245f2
files ChangeLog Makefile.am acinclude.m4 configure.ac patches/icedtea-version-hotspot.patch patches/icedtea-version.patch
diffstat 6 files changed, 112 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jan 20 10:48:37 2010 +0000
+++ b/ChangeLog	Thu Jan 21 01:57:01 2010 +0000
@@ -1,3 +1,21 @@
+2010-01-20  Andrew John Hughes  <ahughes@redhat.com>
+
+	* Makefile.am:
+	Pass DERIVATIVE_ID and HOTSPOT_BUILD_VERSION
+	to build (later only when the HotSpot Mercurial
+	revision is available).
+	(patch.stamp): Move revision derivation to configure.
+	* acinclude.m4:
+	(IT_GET_LSB_DATA): Report results.
+	(IT_CHECK_FOR_MERCURIAL): Macro wrapper around check for hg.
+	(IT_OBTAIN_HG_REVISIONS): Obtain Mercurial revisions for
+	IcedTea, JDK and HotSpot if available.
+	* configure.ac:
+	Call new macros.
+	* patches/icedtea-version-hotspot.patch:
+	Updated to include DERIVATIVE_ID (IcedTea6 version)
+	in the crash dump output.
+
 2010-01-19 Man Lung Wong  <mwong@redhat.com>
 
 	* rt/net/sourceforge/jnlp/JNLPFile.java
--- a/Makefile.am	Wed Jan 20 10:48:37 2010 +0000
+++ b/Makefile.am	Thu Jan 21 01:57:01 2010 +0000
@@ -378,6 +378,11 @@
 
 JDK_UPDATE_VERSION = $(shell echo $(OPENJDK_VERSION) | sed -e "s/^b//")
 COMBINED_VERSION = $(JDK_UPDATE_VERSION)-$(OPENJDK_VERSION)
+
+if HAS_ICEDTEA_REVISION
+ICEDTEA_REV="+${ICEDTEA_REVISION}"
+endif
+
 ICEDTEA_ENV = \
 	IMPORT_BINARY_PLUGS=true \
 	ALT_JDK_IMPORT_PATH="$(ICEDTEA_BOOT_DIR)" \
@@ -418,6 +423,7 @@
 	JDK_HOME="" \
 	RHINO_JAR="$(RHINO_JAR)" \
 	DISTRIBUTION_ID="$(DIST_ID)" \
+	DERIVATIVE_ID="IcedTea6 $(PACKAGE_VERSION)$(ICEDTEA_REV)" \
 	DEBUG_CLASSFILES="true" \
 	DEBUG_BINARIES="true" \
 	ALT_DROPS_DIR="$(abs_top_builddir)/drops"
@@ -449,6 +455,11 @@
 	ALT_JAR_CMD="$(ALT_JAR_CMD)"
 endif
 
+if HAS_HOTSPOT_REVISION
+ICEDTEA_ENV += \
+	HOTSPOT_BUILD_VERSION="$(HOTSPOT_REVISION)" 
+endif
+
 # OpenJDK ecj build environment.
 # FIXME (bootstrap): Remove duplication
 ICEDTEA_ENV_ECJ = \
@@ -499,6 +510,8 @@
 	JAR_KNOWS_ATFILE="$(JAR_KNOWS_ATFILE)" \
 	JAR_KNOWS_J_OPTIONS="$(JAR_KNOWS_J_OPTIONS)" \
 	JAR_ACCEPTS_STDIN_LIST="$(JAR_ACCEPTS_STDIN_LIST)" \
+	DISTRIBUTION_ID="$(DIST_ID)" \
+	DERIVATIVE_ID="IcedTea6 $(PACKAGE_VERSION)$(ICEDTEA_REV)" \
 	DEBUG_CLASSFILES="true" \
 	DEBUG_BINARIES="true" \
 	DISABLE_NIMBUS="true" \
@@ -527,6 +540,11 @@
 	CROSS_TARGET_ARCH="$(CROSS_TARGET_ARCH)"
 endif
 
+if HAS_HOTSPOT_REVISION
+ICEDTEA_ENV_ECJ += \
+	HOTSPOT_BUILD_VERSION="$(HOTSPOT_REVISION)"
+endif
+
 # Source files
 # FIXME (distclean): Add generated file list
 # FIXME (distclean): Add jtreg sources
@@ -1021,18 +1039,7 @@
 	  exit 2; \
 	fi
 
-	if which $(HG) >/dev/null; then \
-	  if [ -e $(abs_top_srcdir)/.hg ] ; then \
-	    revision="+r`(cd $(abs_top_srcdir); $(HG) tip --template '{node|short}')`" ; \
-	  fi ; \
-	  if [ -e openjdk/jdk/.hg ] ; then \
-	    jdk_rev="r`(cd openjdk/jdk; $(HG) tip --template '{node|short}')`" ; \
-	  fi ; \
-	  if [ -e openjdk/hotspot/.hg ] ; then \
-	    hotspot_rev="r`(cd openjdk/hotspot; $(HG) tip --template '{node|short}')`" ; \
-	  fi ; \
-	fi ; \
-	icedtea_version="$(PACKAGE_VERSION)$${revision}" ; \
+	icedtea_version="$(PACKAGE_VERSION)$(ICEDTEA_REV)" ; \
 	if ! test "x$(WITH_CACAO)" = "xno"; then \
 	  echo "JDK_DERIVATIVE_NAME=$${icedtea_version}" \
 	    >>openjdk/jdk/make/common/shared/Defs.gmk ; \
@@ -1041,9 +1048,12 @@
 	else \
 	  echo "JDK_DERIVATIVE_NAME=IcedTea6 $${icedtea_version}" \
 	    >>openjdk/jdk/make/common/shared/Defs.gmk ; \
-	fi ; \
-	echo "JDK_REVID=$${jdk_rev}" >>openjdk/jdk/make/common/shared/Defs.gmk ; \
-	echo "HOTSPOT_REVID=$${hotspot_rev}" >>openjdk/jdk/make/common/shared/Defs.gmk ; \
+	fi ; 
+
+if HAS_JDK_REVISION
+	echo "JDK_REVID=$(JDK_REVISION)" >>openjdk/jdk/make/common/shared/Defs.gmk ;
+endif
+
 	echo "DISTRO_NAME=$(DIST_NAME)" >>openjdk/jdk/make/common/shared/Defs.gmk ; \
 	if [ -n "$(PKGVERSION)" ]; then \
 	  echo "DISTRO_PACKAGE_VERSION=$(PKGVERSION)" \
--- a/acinclude.m4	Wed Jan 20 10:48:37 2010 +0000
+++ b/acinclude.m4	Thu Jan 21 01:57:01 2010 +0000
@@ -1270,6 +1270,7 @@
 
 AC_DEFUN([IT_GET_LSB_DATA],
 [
+AC_MSG_CHECKING([build identification])
 if test -n "$LSB_RELEASE"; then
   lsb_info="$($LSB_RELEASE -ds | sed 's/^"//;s/"$//')"
   if test -n "$PKGVERSION"; then
@@ -1282,6 +1283,46 @@
   DIST_ID="Custom build ($(date))"
   DIST_NAME="$build_os"
 fi
+AC_MSG_RESULT([${DIST_ID}])
 AC_SUBST(DIST_ID)
 AC_SUBST(DIST_NAME)
 ])
+
+
+AC_DEFUN_ONCE([IT_CHECK_FOR_MERCURIAL],
+[
+  AC_PATH_TOOL([HG],[hg])
+  AC_SUBST([HG])
+])
+
+AC_DEFUN_ONCE([IT_OBTAIN_HG_REVISIONS],
+[
+  AC_REQUIRE([IT_CHECK_FOR_MERCURIAL])
+  AC_REQUIRE([WITH_OPENJDK_SRC_DIR])
+  ICEDTEA_REVISION="none";
+  JDK_REVISION="none";
+  HOTSPOT_REVISION="none";
+  if which ${HG} >/dev/null; then
+    AC_MSG_CHECKING([for IcedTea Mercurial revision ID])
+    if test -e ${abs_top_srcdir}/.hg ; then 
+      ICEDTEA_REVISION="r`(cd ${abs_top_srcdir}; ${HG} tip --template '{node|short}')`" ; 
+    fi ;
+    AC_MSG_RESULT([${ICEDTEA_REVISION}])
+    AC_SUBST([ICEDTEA_REVISION])
+    AC_MSG_CHECKING([for JDK Mercurial revision ID])
+    if test -e ${OPENJDK_SRC_DIR}/jdk/.hg ; then
+      JDK_REVISION="r`(cd ${OPENJDK_SRC_DIR}/jdk; ${HG} tip --template '{node|short}')`" ;
+    fi ;
+    AC_MSG_RESULT([${JDK_REVISION}])
+    AC_SUBST([JDK_REVISION])
+    AC_MSG_CHECKING([for HotSpot Mercurial revision ID])
+    if test -e ${OPENJDK_SRC_DIR}/hotspot/.hg ; then \
+      HOTSPOT_REVISION="r`(cd ${OPENJDK_SRC_DIR}/hotspot; ${HG} tip --template '{node|short}')`" ;
+    fi ; 
+    AC_MSG_RESULT([${HOTSPOT_REVISION}])
+    AC_SUBST([HOTSPOT_REVISION])
+  fi;
+  AM_CONDITIONAL([HAS_ICEDTEA_REVISION], test "x${ICEDTEA_REVISION}" != xnone)
+  AM_CONDITIONAL([HAS_JDK_REVISION], test "x${JDK_REVISION}" != xnone)
+  AM_CONDITIONAL([HAS_HOTSPOT_REVISION], test "x${HOTSPOT_REVISION}" != xnone)
+])
--- a/configure.ac	Wed Jan 20 10:48:37 2010 +0000
+++ b/configure.ac	Thu Jan 21 01:57:01 2010 +0000
@@ -40,8 +40,8 @@
 dnl OpenJDK's README-builds.html lists gawk as a build dependency so we
 dnl check for it explicitly rather than using AC_PROG_AWK.
 FIND_TOOL([GAWK], [gawk])
-AC_PATH_TOOL([HG],[hg])
-AC_SUBST([HG])
+IT_CHECK_FOR_MERCURIAL
+IT_OBTAIN_HG_REVISIONS
 AC_PATH_TOOL([LSB_RELEASE],[lsb_release])
 AC_CHECK_WITH_GCJ
 AC_CHECK_WITH_HOTSPOT_BUILD
--- a/patches/icedtea-version-hotspot.patch	Wed Jan 20 10:48:37 2010 +0000
+++ b/patches/icedtea-version-hotspot.patch	Thu Jan 21 01:57:01 2010 +0000
@@ -1,10 +1,14 @@
 diff -Nru openjdk.orig/hotspot/make/linux/makefiles/vm.make openjdk/hotspot/make/linux/makefiles/vm.make
---- openjdk.orig/hotspot/make/linux/makefiles/vm.make	2008-11-06 08:40:50.000000000 +0000
-+++ openjdk/hotspot/make/linux/makefiles/vm.make	2008-11-19 12:15:54.000000000 +0000
-@@ -86,6 +86,10 @@
+--- openjdk.orig/hotspot/make/linux/makefiles/vm.make	2010-01-18 22:58:55.000000000 +0000
++++ openjdk/hotspot/make/linux/makefiles/vm.make	2010-01-20 17:26:22.000000000 +0000
+@@ -86,6 +86,14 @@
    ${JRE_VERSION}     \
    ${VM_DISTRO}
  
++ifdef DERIVATIVE_ID
++CPPFLAGS += -DDERIVATIVE_ID="\"$(DERIVATIVE_ID)\""
++endif
++
 +ifdef DISTRIBUTION_ID
 +CPPFLAGS += -DDISTRIBUTION_ID="\"$(DISTRIBUTION_ID)\""
 +endif
@@ -12,9 +16,21 @@
  # CFLAGS_WARN holds compiler options to suppress/enable warnings.
  CFLAGS += $(CFLAGS_WARN/BYFILE)
  
+diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp	2010-01-18 23:00:22.000000000 +0000
++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2010-01-20 17:24:22.000000000 +0000
+@@ -25,7 +25,7 @@
+ #include "incls/_precompiled.incl"
+ #include "incls/_arguments.cpp.incl"
+ 
+-#define DEFAULT_VENDOR_URL_BUG "http://java.sun.com/webapps/bugreport/crash.jsp"
++#define DEFAULT_VENDOR_URL_BUG "http://icedtea.classpath.org/bugzilla"
+ #define DEFAULT_JAVA_LAUNCHER  "generic"
+ 
+ char**  Arguments::_jvm_flags_array             = NULL;
 diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/vmError.cpp openjdk/hotspot/src/share/vm/utilities/vmError.cpp
---- openjdk.orig/hotspot/src/share/vm/utilities/vmError.cpp	2008-11-06 08:40:58.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/utilities/vmError.cpp	2008-11-19 12:15:54.000000000 +0000
+--- openjdk.orig/hotspot/src/share/vm/utilities/vmError.cpp	2010-01-18 22:56:40.000000000 +0000
++++ openjdk/hotspot/src/share/vm/utilities/vmError.cpp	2010-01-20 17:25:15.000000000 +0000
 @@ -165,7 +165,8 @@
  
  static void print_bug_submit_message(outputStream *out, Thread *thread) {
@@ -25,24 +41,16 @@
    out->print_raw   ("#   ");
    out->print_raw_cr(Arguments::java_vendor_url_bug());
    // If the crash is in native code, encourage user to submit a bug to the
-@@ -339,6 +340,9 @@
+@@ -341,6 +342,12 @@
                     Abstract_VM_Version::vm_platform_string(),
                     UseCompressedOops ? "compressed oops" : ""
                   );
++#ifdef DERIVATIVE_ID
++     st->print_cr("# Derivative: %s", DERIVATIVE_ID);
++#endif
 +#ifdef DISTRIBUTION_ID
 +     st->print_cr("# Distribution: %s", DISTRIBUTION_ID);
 +#endif
  
    STEP(60, "(printing problematic frame)")
  
---- arguments.cpp       2008-12-15 12:25:14.000000000 -0500
-+++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp  2008-12-15 12:25:32.000000000 -0500
-@@ -25,7 +25,7 @@
- #include "incls/_precompiled.incl"
- #include "incls/_arguments.cpp.incl"
-
--#define DEFAULT_VENDOR_URL_BUG "http://java.sun.com/webapps/bugreport/crash.jsp"
-+#define DEFAULT_VENDOR_URL_BUG "http://icedtea.classpath.org/bugzilla"
- #define DEFAULT_JAVA_LAUNCHER  "generic"
-
- char**  Arguments::_jvm_flags_array             = NULL;
--- a/patches/icedtea-version.patch	Wed Jan 20 10:48:37 2010 +0000
+++ b/patches/icedtea-version.patch	Thu Jan 21 01:57:01 2010 +0000
@@ -51,7 +51,7 @@
      static {
          init();
      }
-@@ -81,14 +96,36 @@
+@@ -81,14 +96,34 @@
          /* First line: platform version. */
          ps.println(launcher_name + " version \"" + java_version + "\"");
  
@@ -86,8 +86,6 @@
 -        String java_vm_name    = System.getProperty("java.vm.name");
          String java_vm_version = System.getProperty("java.vm.version");
          String java_vm_info    = System.getProperty("java.vm.info");
-+        if (hotspot_revid.length() > 0)
-+            java_vm_version += "+" + hotspot_revid;
          ps.println(java_vm_name + " (build " + java_vm_version + ", " +
                     java_vm_info + ")");
      }