OpenJDK/IcedTea naming patch

Andrew John Hughes gnu_andrew at member.fsf.org
Mon Feb 23 10:08:06 PST 2009


2009/2/23 Mark Reinhold <mr at sun.com>:
> A while ago I noticed that the output of java -version on my Ubuntu 8.10
> laptop says:
>
>  java version "1.6.0_0"
>  IcedTea6 1.3.1 (6b12-0ubuntu6.1) Runtime Environment (build 1.6.0_0-b12)
>  OpenJDK Server VM (build 1.6.0_0-b12, mixed mode)
>

Which also has a broken HotSpot build number... :(

> Recent builds for Fedora, similarly, say:
>
>  java version "1.6.0_0"
>  IcedTea6 1.4 (fedora-7.b12.fc10-x86_64) Runtime Environment (build 1.6.0_0-b12)
>  OpenJDK 64-Bit Server VM (build 10.0-b19, mixed mode)
>
> This is a change from releases built with IcedTea6 1.2 and earlier,
> where the version output was of the form:
>
>  java version "1.6.0"
>  OpenJDK (<pkg version>) Runtime Environment (build 1.6.0-b09)
>  OpenJDK Server VM (build 1.6.0-b09, mixed mode)
>
> that is, the first token on the second line was "OpenJDK" rather than
> "IcedTea6".
>
> Now I'll be the first to acknowledge all the fine work that's been done
> in the IcedTea project, but while impressive I don't think it justifies
> the renaming of the built product so as to appear not to give credit to
> the upstream OpenJDK project.  I doubt that doing so was anyone's actual
> intent, and in fact I understand from Andrew Haley that this change was
> made in order to address a couple of purely pragmatic issues.

Indeed.  It was never about accreditation (except indirectly in the
negative form of IcedTea bugs being attributed to OpenJDK).  It was a
purely technical issue of being able to identify the resulting build,
especially for bug reports.  Having just 'OpenJDK' means not only
could we not identify the IcedTea[6] version or changeset being used,
but it wasn't possible to differentiate an IcedTea build from a build
just based on the upstream code.  Some distros may have done a little
to resolve this on their own, but there was no upstream solution (the
<pkg version> you mention for 1.2 was added locally by Fedora AFAIU).

As a side note, I don't remember the switch from IcedTea to OpenJDK
originally being discussed on the list.  Had it been, this issue might
have been resolved earlier.  The change back to IcedTea was discussed
in some detail, and FWIW, IcedTea7 has always used 'IcedTea' in the
second line and 'OpenJDK' is present on the third line in both cases,
except on CACAO builds.

> I'd like
> here to suggest an alternative way of addressing them.
>
> The first issue is the need to avoid violating the OpenJDK Trademark
> Notice [1] when using IcedTea to build the OpenJDK libraries on top of
> a non-HotSpot-based VM, such as CACAO.  IANAL, but the Trademark Notice
> does seem to imply that the "OpenJDK" mark may not be used in such a
> situation.
>

That's my reading of it too.  It's also why the Gentoo packaging uses
IcedTea6.  Being source-based, it is unclear whether the resulting
binary will meet the terms of the trademark license.
Of course, if we're talking accreditation again, it's not very fair
not to use it on a CACAO build given most of the code is still the
class libraries from OpenJDK (and anyone who's worked on GNU Classpath
will know that these are much harder to replace).

> Rather than change the value of PRODUCT_NAME to "IcedTea" in all cases,
> I think a better approach is to revise Makefile.am so that it sets
> PRODUCT_NAME to "OpenJDK" unless doing a CACAO build, in which case it
> uses "IcedTea".
>
> The second issue is the desire to keep the output of java -version
> compact enough to fit into 80 columns.  To achieve that while also
> retaining the IcedTea version number I suggest omitting the FULL_VERSION
> part, i.e., "(build 1.6.0_0-b12)", since that information is already
> available elsewhere in the output, and putting the IcedTea name and
> version number before the package version.  While we're at it, it's
> worth moving "Runtime Environment" back to where it's found in almost
> all other derivatives of this code base, right after the initial token:
>
>  java version "1.6.0_0"
>  OpenJDK Runtime Environment (IcedTea6 1.4) (fedora-7.b12.fc10-x86_64)
>  OpenJDK 64-Bit Server VM (build 10.0-b19, mixed mode)
>
> Attached below is a patch, relative to icedtea6 revision c017a717f617,
> which makes these changes.  I've introduced two new make variables:
> JDK_DERIVATIVE_NAME is now set to "IcedTea6 1.4", or whatever the
> current version is, and DISTRO_PACKAGE_VERSION carries the argument
> given to the --with-pkgversion configure option, if any.  Here's the
> output of java -version for three different configurations:
>
>  $ make clean
>  $ ./configure && make >&make.out
>  $ ./openjdk/control/build/linux-i586/bin/java -version
>  java version "1.6.0_0"
>  OpenJDK Runtime Environment (IcedTea6 pre-1.5-r92c4cc753f06) (build 1.6.0_0-b14)
>  OpenJDK Server VM (build 14.0-b08, mixed mode)
>  $ make clean
>  $ ./configure --with-pkgversion='foo.b14.baz-123' && make >&make.out
>  $ ./openjdk/control/build/linux-i586/bin/java -version
>  java version "1.6.0_0"
>  OpenJDK Runtime Environment (IcedTea6 pre-1.5-r92c4cc753f06) (foo.b14.baz-123)
>  OpenJDK Server VM (build 14.0-b08, mixed mode)
>  $ make clean
>  $ ./configure --enable-cacao --with-pkgversion='foo.b14.baz-123' && make >&make.out
>  $ ./openjdk/control/build/linux-i586/bin/java -version
>  java version "1.6.0_0"
>  IcedTea6 Runtime Environment (pre-1.5-r92c4cc753f06) (foo.b14.baz-123)
>  CACAO (build 0.99.3, JIT mode)
>  $
>
> If this patch is acceptable for IcedTea6 then I'll push the relevant
> changes into the upstream 6 and 7 trees.
>
> Comments?
>

I like this change, it seems to reach a happy medium.  I notice you
also change the version template.  What is the value of the
java.version property as a result?  The same as those listed above?

> - Mark
>
>
> [1] http://openjdk.java.net/legal/openjdk-trademark-notice.html
>
>
> diff -r c017a717f617 Makefile.am
> --- a/Makefile.am       Fri Feb 20 12:21:56 2009 -0500
> +++ b/Makefile.am       Mon Feb 23 09:17:21 2009 -0800
> @@ -758,10 +758,20 @@
>          revision="-r`(cd $(abs_top_srcdir); $(HG) tip --template '{node|short}')`" ; \
>        fi ; \
>        icedtea_version="$(PACKAGE_VERSION)$${revision}" ; \
> +       if ! test "x$(WITH_CACAO)" = "xno"; then \
> +         echo "JDK_DERIVATIVE_NAME=$${icedtea_version}" \
> +           >>openjdk/jdk/make/common/shared/Defs.gmk ; \
> +         echo "PRODUCT_NAME=IcedTea6" \
> +           >>openjdk/jdk/make/common/shared/Defs.gmk ; \
> +       else \
> +         echo "JDK_DERIVATIVE_NAME=IcedTea6 $${icedtea_version}" \
> +           >>openjdk/jdk/make/common/shared/Defs.gmk ; \
> +       fi
> +
>        if [ -n "$(PKGVERSION)" ]; then \
> -         icedtea_version="$${icedtea_version} ($(PKGVERSION))" ; \
> -       fi; \
> -       sed -i "s#OpenJDK#OpenJDK $${icedtea_version}#" openjdk/jdk/make/common/shared/Defs.gmk
> +         echo "DISTRO_PACKAGE_VERSION=$(PKGVERSION)" \
> +           >>openjdk/jdk/make/common/shared/Defs.gmk ; \
> +       fi
>
>  if ENABLE_PLUGIN
>        cp -a $(abs_top_srcdir)/plugin/icedtea/sun/applet/*java openjdk/jdk/src/share/classes/sun/applet/
> diff -r c017a717f617 patches/icedtea-version.patch
> --- a/patches/icedtea-version.patch     Fri Feb 20 12:21:56 2009 -0500
> +++ b/patches/icedtea-version.patch     Mon Feb 23 09:17:21 2009 -0800
> @@ -23,3 +23,49 @@
>    PRODUCT_NAME = OpenJDK
>    PRODUCT_SUFFIX = Runtime Environment
>    JDK_RC_PLATFORM_NAME = Platform
> +--- openjdk/jdk/src/share/classes/sun/misc/Version-template.java.~1~   2008-11-25 01:04:53.000000000 -0800
> ++++ openjdk/jdk/src/share/classes/sun/misc/Version-template.java       2009-02-20 09:03:25.000000000 -0800
> +@@ -41,6 +41,12 @@
> +     private static final String java_runtime_version =
> +         "@@java_runtime_version@@";
> +
> ++    private static final String jdk_derivative_name =
> ++        "@@jdk_derivative_name@@";
> ++
> ++    private static final String distro_package_version =
> ++        "@@distro_package_version@@";
> ++
> +     static {
> +         init();
> +     }
> +@@ -82,8 +88,17 @@
> +         ps.println(launcher_name + " version \"" + java_version + "\"");
> +
> +         /* Second line: runtime version (ie, libraries). */
> +-        ps.println(java_runtime_name + " (build " +
> +-                           java_runtime_version + ")");
> ++      StringBuilder sb = new StringBuilder();
> ++      sb.append(java_runtime_name);
> ++      if (jdk_derivative_name.length() > 0) {
> ++          sb.append(" (").append(jdk_derivative_name).append(")");
> ++      }
> ++      if (distro_package_version.length() > 0) {
> ++          sb.append(" (").append(distro_package_version).append(")");
> ++      } else {
> ++          sb.append(" (build ").append(java_runtime_version).append(")");
> ++      }
> ++      ps.println(sb.toString());
> +
> +         /* Third line: JVM information. */
> +         String java_vm_name    = System.getProperty("java.vm.name");
> +--- openjdk/jdk/make/java/version/Makefile.~1~ 2008-11-25 01:01:15.000000000 -0800
> ++++ openjdk/jdk/make/java/version/Makefile     2009-02-20 09:03:56.000000000 -0800
> +@@ -39,6 +39,8 @@
> +       $(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \
> +           -e 's/@@java_version@@/$(RELEASE)/g' \
> +           -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \
> ++          -e 's/@@jdk_derivative_name@@/$(JDK_DERIVATIVE_NAME)/g' \
> ++          -e 's/@@distro_package_version@@/$(DISTRO_PACKAGE_VERSION)/g' \
> +           -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \
> +       $< > $@.temp
> +       @$(MV) $@.temp $@
>
>


Thanks,
-- 
Andrew :-)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8



More information about the distro-pkg-dev mailing list