On Sun, May 31, 2020 at 8:52 AM Alan Bateman <alan.bate...@oracle.com> wrote:
> > > On 30/05/2020 17:40, Christian Stein wrote: > > Hi, > > > > the modular [bach-demo-99] I generated to check my build tool > > against, failed to create a custom runtime image using jlink > > via itsToolProvider-based service entry-point. > > > > The project consists of 100 module descriptors. No other Java > > source files (for classes and interfaces) are part of that demo. > > Each descriptor ball${i}n declares a "requires ball${j}n;" with j > > set to a number from 0 to i-1 ... in words, all lower modules. > > > > javac compiles this project with problems. > > > > Arguments passed to jlink (as an array of string) reads: > > > > jlink > > --add-modules ball27n,ball43n,ball88n,[...],ball77n,ball93n > > --module-path .bach\workspace\modules > > --output .bach\workspace\image > > --compress 2 > > --no-header-files > > --no-man-pages > > > > The error message reads: > > > > jdk.internal.org.objectweb.asm.MethodTooLargeException: Method too large: > > jdk/internal/module/SystemModules$all.moduleDescriptors > > ()[Ljava/lang/module/ModuleDescriptor; > > > > Is there a limitation of supported modules that can be linked? > > Is the module graph of this conceived project too far out of scope? > > > > Shall I open an issue at JBS? > > > Yeah, this is an issue with the jlink system modules plugin where it > needs to split the initialization when it results in a method size more > than 64k. It it tracked by JDK-8240567. Can you add `--disable-plugin > system-modules` to the jlink command as workaround until this is fixed? > Thanks for the heads-up, Alan. Didn't find the issue you linked by a brief search. Working workarounds: - add `--disable-plugin system-modules` works with 100 modules. - use only 90 modules instead of 100 modules as described above. Cheers, Christian