Closed nemphys closed 1 year ago
No idea, but it is definitely there in my case.
PS. I also have the notion that JDK 15 broke the "reproducible builds" feature; after switching to JDK15 jlink, all pseudo-jars that are created for non-modular jars + the merged modules jar are always different than the previous build, even if nothing has changed.
PS. I also have the notion that JDK 15 broke the "reproducible builds" feature; after switching to JDK15 jlink, all pseudo-jars that are created for non-modular jars + the merged modules jar are always different than the previous build, even if nothing has changed.
After doing some more testing concerning this secondary issue, it seems that it has nothing to do with JDK15 after all; I would like to create a separate issue for it, but I have no idea of how to properly describe it, so maybe you can help me:
My application has a total of 9 modules (+ the merged module created by this plugin and proper modular dependencies), for which I use separate versioning. The whole gradle build setup (and all jlink related properties) lives in the "ui" module's build.gradle file. If I keep all dependencies intact and change the version of any of the application modules except the "ui" module, the jlink delegating modules and the merged module remain exactly the same (= reproducible build).
However, if I change the "ui" module's version, all jlink delegating modules and the merged module have changes (different checksum) and therefore the build is not reproducible. After decompiling and comparing one of the delegating module's jar before and after the above version change, the difference seems to reside in module-info.class. This file should not contain anything related to the "ui" module's version, but just a "open module XXXXX { requires transitive XXXXXX; }" entry, BUT just doing a cat on the (compiled) files, I can see the version of the "ui" module inside the (binary) data, which of course differs.
Any idea why this is happening? Is it by design, or can I somehow avoid it (since it effectively does not allow changing the "ui" module's version without having to replace the whole list of otherwise unchanged dependencies)?
EDIT: I just debugged the gradle build itself and realised that CreateMergedModuleTaskImpl's getVersionOpts() did not find a "version" property in mergedModule configuration (I hadn't set that, since I thought mergedModuleJarVersion was all that was needed), so it used the "main" module's version (= "ui" module's version). I suppose this explains everything (and solves my problem by setting the correct version property).
Maybe you should consider removing the mergedModuleJarVersion altogether and name the jar file according to this mergedModule version property, so that the version is set in one place avoiding confusion.
In 2.22.1 mergedModuleJarVersion and mergedModule.version have the same meaning: they configure both the module version of the merged module and the suffix of its jar name.
However, mergedModuleJarVersion is now deprecated and marked for removal. (I didn't remove it in order to avoid breaking changes.)
If both mergedModuleJarVersion and the version property of the mergedModule block are set, mergedModule.version takes precedence.
Nice! Thank you for this, now we are left with just this issue...
When I execute jlink under jdk15 with version 2.22.2 I get the following error on graalvm module: 2.22.1 works fine Task :createMergedModule FAILED
/Users/xxx/workspace/jabref/build/jlinkbase/tmpjars/org.jabref.merged.module/module-info.java:1536: error: module not found: org.objectweb.asm
requires org.objectweb.asm;
^
/Users/xxx/workspace/jabref/build/jlinkbase/tmpjars/org.jabref.merged.module/module-info.java:1549: error: module not found: com.oracle.truffle.regex
requires com.oracle.truffle.regex;
^
/Users/xxx/workspace/jabref/build/jlinkbase/tmpjars/org.jabref.merged.module/module-info.java:1553: error: module not found: org.objectweb.asm.util
requires org.objectweb.asm.util;
^
/Users/xxx/workspace/jabref/build/jlinkbase/tmpjars/org.jabref.merged.module/module-info.java:1555: error: module not found: org.objectweb.asm.commons
requires org.objectweb.asm.commons;
^
/Users/xxxx/workspace/jabref/build/jlinkbase/tmpjars/org.jabref.merged.module/module-info.java:1556: error: module not found: org.graalvm.truffle
requires org.graalvm.truffle;
Oh, right, version 2.22.2 was really broken. I now released 2.22.3, which should fix the error.
Thanks, that works now!
I'm seeing this problem with 2.22.3 when I try to enable Dcom.sun.management.jmxremote
by adding customImage
as follows:
customImage {
jdkAdditive = true
jdkModules = ['java.management','java.instrument','jdk.management.agent','jdk.crypto.ec'] // debug only
}
I'm adding this to support the below jvmArgs
setting:
launcher {
name = appName
jvmArgs = ['-Dcom.sun.management.jmxremote']
}
@msgilligan What error do you get?
Basically the same error as @nemphys -- It can't find my main/application module.
> Task :portfolio-omnimarketcap:jpackageImage FAILED
WARNING: Using incubator modules: jdk.incubator.jpackage
jdk.incubator.jpackage.internal.ConfigException: "Failed to find omnimarketcap module in module path"
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.LauncherData.createModular(LauncherData.java:154)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.LauncherData.create(LauncherData.java:115)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.StandardBundlerParam.lambda$static$0(StandardBundlerParam.java:93)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.BundlerParamInfo.fetchFrom(BundlerParamInfo.java:114)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.BundlerParamInfo.fetchFrom(BundlerParamInfo.java:88)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.AppImageBundler.validate(AppImageBundler.java:65)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.generateBundle(Arguments.java:679)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.processArguments(Arguments.java:549)
at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.execute(Main.java:98)
at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.main(Main.java:52)
jdk.incubator.jpackage.internal.PackagerException: Bundler Mac Application Image skipped because of a configuration problem: "Failed to find omnimarketcap module in module path"
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.generateBundle(Arguments.java:696)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.processArguments(Arguments.java:549)
at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.execute(Main.java:98)
at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.main(Main.java:52)
Caused by: jdk.incubator.jpackage.internal.ConfigException: "Failed to find omnimarketcap module in module path"
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.LauncherData.createModular(LauncherData.java:154)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.LauncherData.create(LauncherData.java:115)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.StandardBundlerParam.lambda$static$0(StandardBundlerParam.java:93)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.BundlerParamInfo.fetchFrom(BundlerParamInfo.java:114)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.BundlerParamInfo.fetchFrom(BundlerParamInfo.java:88)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.AppImageBundler.validate(AppImageBundler.java:65)
at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.generateBundle(Arguments.java:679)
... 3 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':portfolio-omnimarketcap:jpackageImage'.
> Process 'command '/Users/sean/.sdkman/candidates/java/15.0.1.hs-adpt/bin/jpackage'' finished with non-zero exit value 1
Sorry for not responding sooner.
The customImage
block was not compatible with jpackage. I fixed this in 2.23.1.
Any news on this one? The customImage block change had no effect (I have been using the customImage block along with jpackage since forever, btw, and it works fine with jpackage versions < 15). Furthermore, I just updated the JLink plugin to the latest version and it now fails even with jpackage 14... Some kind of regression maybe? The new error (with jpackage 14, that used to work up until 2.22.2) is: "Input directory specified is not a directory: /xxx/build/image/app"
@nemphys What error do you get when using jpackage 16?
Hoping you meant jpackage 15, the error is the same (the one on the initial description of this issue). Looks like the changes you made were not relevant to this specific problem.
No, I really meant jpackage 16. You can download an Early-Access Build and use one of the methods described here to configure your project to use the jpackage tool from this distribution.
OK, will try that tomorrow, but I wonder why you want to test this. Is there a change in v.16?
They fixed a couple of bugs in jpackage 16. I'm curious if you get the same error.
Also, when testing with jpackage 16, please add the --verbose option:
jlink {
...
jpackage {
...
imageOptions += '--verbose'
installerOptions += '--verbose'
}
}
Then, run gradle with the -i option and post here the output of the jpackageImage and jpackage tasks.
Nothing changes with jpackage from JDK 16, here is the log:
Task :ui:jpackageImage FAILED [17:49:27.023] java.nio.file.NoSuchFileException: /Users/xxxx/git/java/xxxx/ui/build/image/xxxxx/release at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219) at java.base/java.nio.file.Files.newByteChannel(Files.java:375) at java.base/java.nio.file.Files.newByteChannel(Files.java:426) at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420) at java.base/java.nio.file.Files.newInputStream(Files.java:160) at java.base/java.nio.file.Files.newBufferedReader(Files.java:2916) at java.base/java.nio.file.Files.newBufferedReader(Files.java:2948) at jdk.jpackage/jdk.jpackage.internal.LauncherData$ModuleInfo.fromCookedRuntime(LauncherData.java:365) at jdk.jpackage/jdk.jpackage.internal.LauncherData.createModular(LauncherData.java:149) at jdk.jpackage/jdk.jpackage.internal.LauncherData.create(LauncherData.java:115) at jdk.jpackage/jdk.jpackage.internal.StandardBundlerParam.lambda$static$0(StandardBundlerParam.java:84) at jdk.jpackage/jdk.jpackage.internal.BundlerParamInfo.fetchFrom(BundlerParamInfo.java:114) at jdk.jpackage/jdk.jpackage.internal.BundlerParamInfo.fetchFrom(BundlerParamInfo.java:88) at jdk.jpackage/jdk.jpackage.internal.AppImageBundler.validate(AppImageBundler.java:66) at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:663) at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:538) at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:98) at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52) [17:49:27.028] jdk.jpackage.internal.ConfigException: "Failed to find xx.xxxxxxx.xx.ui module in module path" at jdk.jpackage/jdk.jpackage.internal.LauncherData.createModular(LauncherData.java:154) at jdk.jpackage/jdk.jpackage.internal.LauncherData.create(LauncherData.java:115) at jdk.jpackage/jdk.jpackage.internal.StandardBundlerParam.lambda$static$0(StandardBundlerParam.java:84) at jdk.jpackage/jdk.jpackage.internal.BundlerParamInfo.fetchFrom(BundlerParamInfo.java:114) at jdk.jpackage/jdk.jpackage.internal.BundlerParamInfo.fetchFrom(BundlerParamInfo.java:88) at jdk.jpackage/jdk.jpackage.internal.AppImageBundler.validate(AppImageBundler.java:66) at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:663) at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:538) at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:98) at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52) [17:49:27.034] jdk.jpackage.internal.PackagerException: Bundler Mac Application Image skipped because of a configuration problem: "Failed to find xx.xxxxxxx.xx.ui module in module path" at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:680) at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:538) at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:98) at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52) Caused by: jdk.jpackage.internal.ConfigException: "Failed to find xx.xxxxxxx.xx.ui module in module path" at jdk.jpackage/jdk.jpackage.internal.LauncherData.createModular(LauncherData.java:154) at jdk.jpackage/jdk.jpackage.internal.LauncherData.create(LauncherData.java:115) at jdk.jpackage/jdk.jpackage.internal.StandardBundlerParam.lambda$static$0(StandardBundlerParam.java:84) at jdk.jpackage/jdk.jpackage.internal.BundlerParamInfo.fetchFrom(BundlerParamInfo.java:114) at jdk.jpackage/jdk.jpackage.internal.BundlerParamInfo.fetchFrom(BundlerParamInfo.java:88) at jdk.jpackage/jdk.jpackage.internal.AppImageBundler.validate(AppImageBundler.java:66) at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:663) ... 3 more
Can you also post the complete output of the jpackageImage
task? It should include a dump of the taskData
and the jpackage command.
Closing due to inactivity.
Trying to run the jpackage task using the JDK binary produces the following error:
Bundler Mac Application Image skipped because of a configuration problem: "Failed to find [xxx.xxx.xxx] module in module path" (where xxx.xxx.xxx => my main module name).
Since the same configuration works just fine with JDK14, I supposed something changed with the parameters required by the new version.