RFR: 7902847: Class directory of a test case should be always used to compile a library [v9]
Leonid Mesnik
lmesnik at openjdk.org
Thu Apr 17 22:12:53 UTC 2025
On Thu, 17 Apr 2025 21:38:06 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> The flags should be located in TEST.ROOT or TEST.properties for all libraries that are used by tests. It is not specific for any particular library.
>>
>> This flag is requested by @sormuras to restore original behavior if something goes wrong with new mode.
>>
>> I would like to keep temporary for a couple of releases and remove if it is not needed. I don't like to maintain different execution modes if it is not needed.
>
> I was expecting this text in the tag-spec to describe both behavior(s) controlled by `shareLibraries`.
> And mention the property and clearly define the behavior of each case.
>
> That does not seem to be intended. Instead only the changed behavior is documented and the property will not be documented. I understood the feature to control the destination directory for compiled classes but from this description it controls the source path, not the destination.
>
> Since the behavior is being changed somewhat incompatibly, the text should clearly describe the new behavior and call out the differences and how to get the previous behavior if needed.
>
> It would be clearer the property and its behaviors were documented in `Locations.getLibLcn` .
> The name of the property should more clearly indicate it is for compatibility and the behavior when it is set.
>
> The words "might" and "may" are red flags in any specification.
The property controls only to where compile put compiled classes for `@build` tag. There are no changes related to source paths. It remains completely the same and change shouldn't break any test.
The `might` in this part
A test that relies upon library classes might contain appropriate
<code>@build</code> directives to explicitly compile classes.
This might be useful when a test depends on library classes during runtime only.
just describes when `@build` tag still is useful useful. It might be not evident that testlibrary classes are not compiled if javac can't understand that they are used.
Also, redundant `@build` is not an error, but not useful at all.
Does it looks better?
A test that relies upon library classes that are not implicitly resolved by during compilation should have appropriate
<code>@build</code> directives to explicitly compile required classes.
This is required when a test depends on library classes during runtime only.
-------------
PR Review Comment: https://git.openjdk.org/jtreg/pull/256#discussion_r2049707247
More information about the jtreg-dev
mailing list