hg: build-infra/jdk8: Linux x86_64 as equal as it is going to get!

Erik Joelsson erik.joelsson at oracle.com
Fri Sep 7 01:35:56 PDT 2012


A clarification on "equality" for this platform. I think we need to be 
more transparent with how we define it and what exceptions we have to 
make. To compare the new build with the old, we have a script where the 
definition is implemented. After configuring a new build, this script 
ends up in (for example):

build/linux-x86_64-normal-server-release/compare.sh

Running it with no args will print the help text. To run the full 
comparison, use "-all". By default it will look for the old build in 
it's default location and compare against that.

What do we compare then? It varies a bit depending on platform, but for 
linux, this is the (current) list:

File and directory structure.

File permissions.

Output of the file command.

"General" files. All files not covered by later special handling are 
just diffed.

Zip and jar files. These are unzipped and the contents is diffed. There 
are a few special cases to take note of:
* Generated java files in the src.zip contain timestamps that are 
filtered out.
* Version.java and version.java contain the version string (which is a 
timestamp) that we filter out.
* Property files are stripped in various ways in the old build. We have 
tried to unify this in the new build and opted not to convert the 
obvious mistakes in some of the old methods, which is causing some 
differences. To make the comparison, we apply the same transformation on 
the old files that we use in the new build.

Native libraries and executables.
These are the most problematic. In some cases we are able to create 
identical binaries, but most often we are not. This is mostly caused by 
debug information. In some cases we have to strip the binaries before 
comparing to make it meaningful. On linux this is done on the jvmti 
demos which are shipped with debug information in the binaries. When we 
don't have identical binaries, we look at a number of other things to 
see how close we are:
* File size. Not always possible, but on linux we have same size.
* Dependencies. (ldd)
* Symbols. (nm)
* Full dump (readelf).

All but three demos are equal in all cases except readelf on linux. I 
suspect debug information is causing alignment differences after being 
stripped out.

In the script, we maintain lists of the known and accepted differences 
for all platforms. That way we keep track of how far along we have 
progressed and we can easily see if we have regressed.

/Erik


On 2012-09-06 17:59, erik.joelsson at oracle.com wrote:
> Changeset: bce1813d53cf
> Author:    erikj
> Date:      2012-09-06 17:58 +0200
> URL:       http://hg.openjdk.java.net/build-infra/jdk8/rev/bce1813d53cf
>
> Linux x86_64 as equal as it is going to get!
>
> ! common/autoconf/basics.m4
> ! common/autoconf/compare.sh.in
> ! common/autoconf/generated-configure.sh
>



More information about the build-infra-dev mailing list