JDK-8336002 : Support gradle --parallel option
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: build
  • Affected Version: jfx20,jfx21,jfx22,jfx23
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2024-07-04
  • Updated: 2024-07-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Description
ADDITIONAL SYSTEM INFORMATION :
ArchLinux, OpenJDK 22

A DESCRIPTION OF THE PROBLEM :
When building using gradle with the org.gradle.parallel option set to true or the "--parallel" command line option, the build quickly fails.

However, not setting the parallel option allows the project to be built properly.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
On a fresh cloning of OpenJFX's source code, launch a build with:
gradle zips --parallel

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
OpenJFX should build properly with or without gradle's parallel option.
ACTUAL -
The build fails quickly, which could point to a dependency not handled properly between subprojectfs. First to fail is controls complaining about javafx.base not found:
---
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details

> Configure project :
*****************************************************************
Unsupported gradle version 8.8 in use.
Only version 8.5 is supported. Use this version at your own risk
*****************************************************************
gradle.gradleVersion: 8.8
OS_NAME: linux
OS_ARCH: amd64
JAVA_HOME: /usr/lib/jvm/java-22-openjdk
JDK_HOME: /usr/lib/jvm/java-22-openjdk
java.runtime.version: 22
java version: 22
java build number: 0
jdk.runtime.version: 22
jdk version: 22
jdk build number: 0
minimum jdk version: 17
minimum jdk build number: 35
Java target version: 17
GCC version: gcc13.2.0-OL6.4+1.0
cmake version: 3.22.3
ninja version: 1.8.2
ant version: 1.10.5
HAS_JAVAFX_MODULES: false
STUB_RUNTIME: /usr/lib/jvm/java-22-openjdk
CONF: Release
NUM_COMPILE_THREADS: 16
COMPILE_TARGETS: linux
COMPILE_FLAGS_FILES: buildSrc/linux.gradle
HUDSON_JOB_NAME: not_hudson
HUDSON_BUILD_NUMBER: 0000
PROMOTED_BUILD_NUMBER: 0
PRODUCT_NAME: OpenJFX
BUILD_TIMESTAMP: 2024-07-04-024630
RELEASE_VERSION: 22.0.1
RELEASE_SUFFIX: -internal
RELEASE_VERSION_SHORT: 22.0.1-internal
RELEASE_VERSION_LONG: 22.0.1-internal+0-2024-07-04-024630
RELEASE_VERSION_PADDED: 22.0.1.0
MAVEN_PUBLISH: false
MAVEN_VERSION: 
UPDATE_STUB_CACHE: false
Building Webkit configuration /Release/ into /home/ademers/projects/Arch/java-openjfx/src/jfx22u-22.0.1-7/modules/javafx.web/build/linux
module: project ':apps' (buildModule=NO)
module: project ':base' (buildModule=YES)
module: project ':controls' (buildModule=YES)
module: project ':fxml' (buildModule=YES)
module: project ':graphics' (buildModule=YES)
module: project ':media' (buildModule=YES)
module: project ':swing' (buildModule=YES)
module: project ':swt' (buildModule=NO)
module: project ':systemTests' (buildModule=NO)
module: project ':web' (buildModule=YES)

> Task :controls:processResources FAILED
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.base not found

CUSTOMER SUBMITTED WORKAROUND :
Build without any parallel work.

FREQUENCY : always



Comments
I'm changing this issue type to Enhancement. As noted, the JavaFX build.gradle script does not work with the "gradle --parallel" option. It would be a fairly large effort to allow this to work, and something we would only consider doing in connection with an even larger effort to clean up and modernize build.gradle.
09-07-2024

The issue is reproducible. I tried to build on Ubunutu x64 i7 machine. $ sh gradlew zips --parallel Starting a Gradle Daemon (subsequent builds will be faster) > Configure project : gradle.gradleVersion: 8.5 OS_NAME: linux OS_ARCH: amd64 JAVA_HOME: /usr/lib/jvm/jdk-21-oracle-x64 JDK_HOME: /usr/lib/jvm/jdk-21-oracle-x64 java.runtime.version: 21.0.2+13-LTS-58 java version: 21.0.2 java build number: 13 jdk.runtime.version: 21.0.2+13-LTS-58 jdk version: 21.0.2 jdk build number: 13 minimum jdk version: 21 minimum jdk build number: 35 Java target version: 21 GCC version: gcc13.2.0-OL6.4+1.0 cmake version: 3.22.3 ninja version: 1.8.2 ant version: 1.10.5 HAS_JAVAFX_MODULES: false STUB_RUNTIME: /usr/lib/jvm/jdk-21-oracle-x64 CONF: Debug NUM_COMPILE_THREADS: 4 COMPILE_TARGETS: linux COMPILE_FLAGS_FILES: buildSrc/linux.gradle HUDSON_JOB_NAME: not_hudson HUDSON_BUILD_NUMBER: 0000 PROMOTED_BUILD_NUMBER: 0 PRODUCT_NAME: OpenJFX BUILD_TIMESTAMP: 2024-07-09-114824 RELEASE_VERSION: 23 RELEASE_SUFFIX: -internal RELEASE_VERSION_SHORT: 23-internal RELEASE_VERSION_LONG: 23-internal+0-2024-07-09-114824 RELEASE_VERSION_PADDED: 23.0.0.0 MAVEN_PUBLISH: false MAVEN_VERSION: UPDATE_STUB_CACHE: false Building Webkit configuration /Release/ into /home/anupam/Documents/openjfx/jfx/modules/javafx.web/build/linux module: project ':apps' (buildModule=NO) module: project ':base' (buildModule=YES) module: project ':controls' (buildModule=YES) module: project ':fxml' (buildModule=YES) module: project ':graphics' (buildModule=YES) module: project ':media' (buildModule=YES) module: project ':swing' (buildModule=YES) module: project ':swt' (buildModule=NO) module: project ':systemTests' (buildModule=NO) module: project ':web' (buildModule=YES) > Task :controls:processResources Error occurred during initialization of boot layer java.lang.module.FindException: Module javafx.base not found > Task :controls:processResources FAILED > Task :base:compileJava You specified both --module-source-path and a sourcepath. These options are mutually exclusive. Ignoring sourcepath. > Task :graphics:generateGrammarSource warning(131): com/sun/scenario/effect/compiler/JSL.g4:482:19: greedy block ()* contains wildcard; the non-greedy syntax ()*? may be preferred > Task :base:compileJava Note: /home/anupam/Documents/openjfx/jfx/modules/javafx.base/src/main/java/com/sun/javafx/PlatformUtil.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API that is marked for removal. Note: Recompile with -Xlint:removal for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. FAILURE: Build failed with an exception. * Where: Build file '/home/anupam/Documents/openjfx/jfx/build.gradle' line: 2728 * What went wrong: Execution failed for task ':controls:processResources'. > Process 'command '/usr/lib/jvm/jdk-21-oracle-x64/bin/java'' finished with non-zero exit value 1 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD FAILED in 55s 17 actionable tasks: 17 executed
09-07-2024