RFR: 8274980: Improve adhoc build version strings [v8]

Magnus Ihse Bursie ihse at openjdk.java.net
Thu Feb 10 16:09:47 UTC 2022


> Current adhoc version build strings are not ideal. Some of the problems:
>  * A build number of "0" is inserted, which make the version string look like it's an official build, at least when not reading carefully
>  * The version string gives little indication on what source code the build was based
> 
> Also, an error was discovered in how the build system generates version strings without a build number (since this basically never happened before). A version without a build number,  and without a PRE value, but with an OPT value, should have a "+-" separator, according to JEP 223. While this was correctly handled, the "+-" separator was also applied to versions without a build, but with both PRE and OPT. In this case, the "+" should be omitted, according to JEP 223. This bug is fixed by this commit.
> 
> Ideally, the adhoc version string should include something along the lines of the output of `git describe`. However, since the version string is set at configure time, not build time, this will almost immediately become misleading. :-( A substitute is proposed in this patch, where the branch name is included in the OPT string (if it's not `master`).
> 
> Finally, this patch fixes hotspot so it can properly build without a build number. This was the last blocker for why the build system always required the "0" as build number before. To facilitate interoperability with external tools (like jib) that still sets build number to "0" to really signal "no build number", a build number exactly matching "0" will be interpreted as having no build number.

Magnus Ihse Bursie has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revision:

 - Merge branch 'master' into improve-adhoc-version-string
 - Remove "build 0" from GHA builds
 - Warn that build 0 is "no build"
 - Fix incorrect version string format assumption in Basic.java
 - Fix incorrect assumptions about fullVersion in InfoOptsTest
 - Merge branch 'master' into improve-adhoc-version-string
 - IS_EMPTY define did not work on msvc
 - Break long lines
 - Skip setting git branch in adhoc version opt
 - Fix for abtract_vm_version so it really handles empty VERSION_BUILD
 - ... and 1 more: https://git.openjdk.java.net/jdk/compare/655da37e...15216c9a

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/6152/files
  - new: https://git.openjdk.java.net/jdk/pull/6152/files/d433de3a..15216c9a

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6152&range=07
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6152&range=06-07

  Stats: 7108 lines in 181 files changed: 5450 ins; 888 del; 770 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6152.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6152/head:pull/6152

PR: https://git.openjdk.java.net/jdk/pull/6152



More information about the build-dev mailing list