RFR 8181299/10, Several jdk tests fail with java.lang.NoClassDefFoundError: jdk/test/lib/process/StreamPumper
igor.ignatyev at oracle.com
Thu Jun 1 20:17:25 UTC 2017
> On Jun 1, 2017, at 1:20 AM, Chris Hegarty <chris.hegarty at oracle.com> wrote:
>> On 1 Jun 2017, at 04:32, Igor Ignatyev <igor.ignatyev at oracle.com> wrote:
>> Hi Felix,
>> I have suggested the exact opposite change[1-3] to fix the same problem.
> I’m sorry, but this is all just too confusing. After your change, who, or what, is
> responsible for building/compiling the test library dependencies?
jtreg is responsible, there is an implicit build for each @run, and jtreg will analyze a test class to get transitive closure for static dependencies, hence you have to have @build only for classes which are not in constant pool, e.g. used only by reflection or whose classnames are only used to spawn a new java instance.
> Test library code has no @modules tags, so does not explicitly declare its
> module dependencies. Instead module dependencies, required by test
> library code, are declared in the test using the library. If we wildcard, or
> otherwise leave broad build dependencies, from tests then there is no
> way to know what new module dependencies may be added in the future.
> That is, one of, the reason(s) I asked Felix to be explicit about the build
having explicit builds does not really help w/ module dependency, if someone change a testlibrary class so it starts to depend on another testlibrary class, jtreg will implicitly build it and if this class has some module dependencies, you will have to reflect them in the test.
generally speaking, I don't like having explicit build actions because build actions themselves are implicit, so they don't really help, it's still will be hard to spot missed explicit builds. not having (unneeded) explicit builds is an easy rule to follow and we can easily find all places which don't follow this rule by grep.
>>  https://bugs.openjdk.java.net/browse/JDK-8181391
>>  http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-June/048012.html
>>  http://cr.openjdk.java.net/~iignatyev//8181391/webrev.00/index.html
More information about the core-libs-dev