ibmruntimes / openj9-openjdk-jdk9

Extensions for OpenJDK for Eclipse OpenJ9
GNU General Public License v2.0
67 stars 76 forks source link

Partial version info on recent nightly builds #93

Closed JamesKingdon closed 6 years ago

JamesKingdon commented 6 years ago

I downloaded a recent nightly build from https://adoptopenjdk.net/ and it seems to be missing part of the version information for the OpenJDK line. @mstoodle @jdekonin I believe may already have some ideas on the solution.

$ bin/java -version
openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-adhoc.jenkins.openjdk)
Eclipse OpenJ9 VM (build 2.9, JRE 9 Linux amd64-64 Compressed References 20171127_54 (JIT enabled, AOT enabled)
OpenJ9   - 739f742
OMR      - 796784a
OpenJDK  - e180b84 based on )
jdekonin commented 6 years ago

closed/autoconf/custom-hook.mk attempts to extract the version tag at configure time.

AC_DEFUN_ONCE([OPENJDK_VERSION_DETAILS], [ OPENJDK_SHA=git -C $SRC_ROOT rev-list --tags --abbrev-commit --max-count=1 OPENJDK_TAG=git -C $SRC_ROOT describe --tags "${OPENJDK_SHA}" AC_SUBST(OPENJDK_SHA) AC_SUBST(OPENJDK_TAG) ])

A clone of openj9-openjdk-jdk9 without tags will cause this issue.

jdekonin commented 6 years ago

Looking at an adoptopenjdk build;

Performed manually these steps do produce what is expected. I see this in the output of the job though. "fatal: No tags can describe 'e180b84d88783a41ada24f95deacc28a3e8c9644'."

Could there be an issue in the timing of when the steps are performed in the AdoptOpenJDK build?

mstoodle commented 6 years ago

I remember dorking with these commands once already to get the build tag to show up (see #16 , clearly a failure), and it was exactly because of the shallow clone + tags fetch sequence that makejdk-any-platform.sh was using that made it troublesome

mstoodle commented 6 years ago

Is there any difference in how the Extensions project creates tags compared to how the AdoptOpenJDK OpenJDK mirror repositories create tags, I wonder?

mbvreddy commented 6 years ago

OPENJDK_TAG is determined by fetching the tags on latest revision of openj9-openjdk-jdk9. In this case, revision doesn't has any tags. It appears that tags are created when OpenJDK mirror happens. Any later commits to repo doesn't carry any tags.

I think we can use last added tag rather than tag of each revision. Below change should fix the tag in version output. I will test with this and confirm.

AC_DEFUN_ONCE([OPENJDK_VERSION_DETAILS],
[
  OPENJDK_SHA=git -C $SRC_ROOT rev-list --tags --abbrev-commit --max-count=1
  OPENJDK_TAG=git -C $SRC_ROOT describe --tags "${OPENJDK_SHA}"

  if test "x$OPENJDK_TAG" = x; then
    LAST_TAGGED_REVISION=`git -C $SRC_ROOT rev-list --tags --max-count=1`
    OPENJDK_TAG=`git -C $SRC_ROOT describe --abbrev=0 --tags --match "jdk-9*" "${LAST_TAGGED_REVISION}"`
  fi

  AC_SUBST(OPENJDK_SHA)
  AC_SUBST(OPENJDK_TAG)
])
mbvreddy commented 6 years ago

java -version with the above change

openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-adhoc.bhamaram.openjdk)
Eclipse OpenJ9 VM (build 2.9, JRE 9 Linux amd64-64 Compressed References 20180104_000000 (JIT enabled, AOT enabled)
OpenJ9   - 4cc5b0a
OMR      - 66568c6
OpenJDK  - f1a22d1 based on jdk-9+181)
mbvreddy commented 6 years ago

Same issue exist with 80 OpenJ9 builds as well.

mbvreddy commented 6 years ago

Pull Request - https://github.com/ibmruntimes/openj9-openjdk-jdk9/pull/104

mbvreddy commented 6 years ago

Pull Request for Java 8 - https://github.com/ibmruntimes/openj9-openjdk-jdk8/pull/22

jdekonin commented 6 years ago

While #104 was merged, I believe the correct location for the fix would be in the openjdk-build scripts. I have added comments to ibmruntimes/openj9-openjdk-jdk8/pull/22 with the details as to why. In a nut shell...see my initial comment on Nov 28th; the shallow clone is the reason for the missing tag. This should remain open for tracking the revert on #104 unless investigation proves otherwise.

mbvreddy commented 6 years ago

ibmruntimes/openj9-openjdk-jdk8#22 is merged post investigation.

OpenJ9 for JDK9 version output of latest nightly build is

openjdk version "9-internal" OpenJDK Runtime Environment (build 9-internal+0-adhoc.jenkins.openjdk) Eclipse OpenJ9 VM (build 2.9, JRE 9 Linux amd64-64 Compressed References 20180124_97 (JIT enabled, AOT enabled) OpenJ9 - d7cc8fd OMR - 4badb2f OpenJDK - be5903d based on jdk-9+181)

pshipton commented 6 years ago

I believe this means we can close this Issue.

JamesKingdon commented 6 years ago

Many thanks @mbvreddy