On Sat, 21 Oct 2023 07:51:42 GMT, Alan Bateman <al...@openjdk.org> wrote:
>>> > Yes, because of the following code further up in the same method: >>> >>> I think what you are actually doing here is supporting archiving of the >>> boot layer when the main module transitively depends on an incubator >>> module. We might have to add more tests in this area as it doesn't look >>> like this scenario is tested, at least not with CDS. >> >> Just to add to this. The effect of this change is that a warning won't be >> emitted if you archive with a boot layer that contains a main module and an >> incubator module, e.g. main requires jdk.incubator.vector. In other words, >> `java -Xshare:off -m main` will print the expected warning, `java -Xshare:on >> -m main` will not. > > Another effect of the change to note is that incubator modules will now > resolved by default when the initial module is the unnamed module. More > explicitly, if you jlink to create a run-time image that contains a main > module and an incubator module then `java -Xshare:off -version` will not > resolve the incubator moduls (correct behaviour) but `java -Xshare:on > -version` will resolve incubator modules (wrong behavior). I've pushed another update with the following changes: - in the VM code, skip archiving full module graph if there's an incubator module by checking if the ArchivedBootLayer::archivedBootLayer is available; - included your suggested code changes in ModuleBootstrap.java; - added a test scenario with an incubator module. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16016#discussion_r1373816679