RFR: 7903604: Provide Build.java to (eventually) replace `build.sh`

Jonathan Gibbons jjg at openjdk.org
Thu Apr 11 16:07:54 UTC 2024


On Thu, 18 Jan 2024 17:30:57 GMT, Iris Clark <iris at openjdk.org> wrote:

>> Please review a new, alternative way to download the dependencies needed to build `jtreg`.
>> 
>> Currently, the generally recommended way to download or otherwise find the dependencies is to use the `make/build.sh` script.  This PR provides an essentially equivalent alternative written in Java: `make/Build.java`, which is a single source file and so can be run with the standard support for running single source file programs in the Java launcher.
>> 
>>     old: sh make/build.sh options...
>>     new: path/to/java make/Build.java options...
>> 
>> The configuration values are essentially the same; in particular, the default configuration values in `make/build-support/version-numbers` are exactly the same as for `build.sh`.  Configuration values may now also be given on the command-line or in a file specified on the command line. The primary configuration difference is that there is no longer support for downloading a version of JDK to build jtreg; the default is to use the same version of JDK as is used to run `Build.java` although an alternate version of JDK to build `jtreg` itself can be specified as an option to `Build.java`.
>> 
>> As with `build.sh`, the new `Build.java` writes and optionally executes a shell script to run `make` with variables set up to point to the local version of the dependencies. 
>> 
>> There is no change to the makefiles, or to the functionality of `jtreg` itself.
>> 
>> There are minor internal changes to the organization of the dependencies in the `build/deps` directory, and minor changes to the logging output written by the program.
>> 
>> The old `build.sh` and related shell files remain in place for now, but may be removed at some point in the future.
>
> make/Build.java line 32:
> 
>> 30: #
>> 31: # The program can be executed directly as a single source-file program
>> 32: # by the Java launcher, using JDK 12 or later.
> 
> Just curious... why JDK 12?  I presume there's a goal to use the oldest release possible and there's a feature you need in 12?

IIRC, it was rounding up from a bug fix required in a JDK 11 update.

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

PR Review Comment: https://git.openjdk.org/jtreg/pull/177#discussion_r1561274686


More information about the jtreg-dev mailing list