RFR: 8327389: Remove use of HOTSPOT_BUILD_USER
Magnus Ihse Bursie
ihse at openjdk.org
Wed Mar 6 17:19:47 UTC 2024
On Wed, 6 Mar 2024 11:57:27 GMT, Andrew John Hughes <andrew at openjdk.org> wrote:
> The HotSpot code has inserted the value of `HOTSPOT_BUILD_USER` into the internal version string since before the JDK was open-sourced, so the reasoning for this is not in the public history. See https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/abstract_vm_version.cpp#L284
>
> ~~~
> $ /usr/lib/jvm/java-21-openjdk/bin/java -Xinternalversion
> OpenJDK 64-Bit Server VM (21.0.2+13) for linux-amd64 JRE (21.0.2+13), built on 2024-01-19T16:39:52Z by "mockbuild" with gcc 8.5.0 20210514 (Red Hat 8.5.0-20)
> ~~~
>
> It is not clear what value this provides. By default, the value is set to the system username, but it can be set to a static value using `--with-build-user`.
>
> In trying to compare builds, this is a source of difference if the builds are produced under different usernames and `--with-build-user` is not set to the same value.
>
> It may also be a source of information leakage from the host system. It is not clear what value it provides to the end user of the build.
>
> This patch proposes removing it altogether, but at least knowing why it needs to be there would be progress from where we are now. We could also consider a middle ground of only setting it for "adhoc" builds, those without set version information, as is the case with the overall version output.
>
> With this patch:
>
> ~~~
> $ ~/builder/23/images/jdk/bin/java -Xinternalversion
> OpenJDK 64-Bit Server VM (fastdebug 23-internal-adhoc.andrew.jdk) for linux-amd64 JRE (23-internal-adhoc.andrew.jdk), built on 2024-03-06T00:23:37Z with gcc 13.2.1 20230826
>
> $ ~/builder/23/images/jdk/bin/java -XX:ErrorHandlerTest=1
> <vm crashes>
> $ grep '^vm_info' /localhome/andrew/projects/openjdk/upstream/jdk/hs_err_pid1119824.log
> vm_info: OpenJDK 64-Bit Server VM (fastdebug 23-internal-adhoc.andrew.jdk) for linux-amd64 JRE (23-internal-adhoc.andrew.jdk), built on 2024-03-06T00:23:37Z with gcc 13.2.1 20230826
> ~~~
>
> The above are from a fastdebug build but I also built a product build with no issues.
I agree that it is good to get rid of this. However, the reason it has stuck around for so long is, eh, that it has been around for so long, so it is a bit unclear what or who could be relying on this.
Let's not be too eager to push this, and collect a bit more information about this.
-------------
Marked as reviewed by ihse (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18136#pullrequestreview-1920369274
More information about the build-dev
mailing list