RFR: gradle buildscript improvements

Athijegannathan Sundararajan sundar at openjdk.java.net
Wed Apr 27 09:38:11 UTC 2022


On Wed, 27 Apr 2022 09:12:58 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> build.gradle line 102:
>> 
>>> 100: // build the jextract image when the build or assemble task is run
>>> 101: assemble.dependsOn(jextractapp)
>>> 102: 
>> 
>> Not sure of this change. Basically what we want is only three targets to use "clean", "verify" and "jtreg"
>> 
>> "verify" is for just create minimal jextract JDK image and run simple 'integration test' on it.
>> 'jtreg' is for really running all tests
>> 
>> Note that we cannot use usual lifecycle of Gradle projects. Out tests are run a separate JDK image containing jextract tool in it - because this is how we expect users to deploy/use.
>> 
>> "verify" creates a minimal jextract image (which won't have compiler and other things needed for jtreg test run and so we create two JRE images) and runs a simple jextract on a simple test.h.
>
> I guess I understand both concerns: on one hand, what @sundararajana says it's true: our tests do not fit in the gradle workflow nicely, as they can only be run after an integration step (e.g. the build of the image used to run jextract).
> 
> That said, I also get the spirit of the changes here: we're asking developers to say "verify" when in reality what they'd like to be able to say is probably "build". So, if we just s/verify/build and keep "jtreg" as an optional task, what would go wrong?

"jtreg" target requires additional toolset (cmake, C compiler, jtreg) at the user end. This is not the usual pure Java project "tests" which don't need any of these. Already "verify" doesn't depend on "jtreg" (verify is just build of jextract image + a simple integration test to extract a test.h). "jtreg" perhaps can skip the "project jextract image" + "integration test" step. i.e., after jar straight build test JDK image with jextract and run all jextract tests. But, not sure how much is saved by that.

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

PR: https://git.openjdk.java.net/jextract/pull/25


More information about the jextract-dev mailing list