JDK-8169683 : Incremental build of WebKit native library is broken
  • Type: Bug
  • Component: javafx
  • Sub-Component: build
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-11-15
  • Updated: 2016-11-15
  • Resolved: 2016-11-15
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.
JDK 9
9Fixed
Related Reports
Relates :  
Description
Following the change to build with a Jigsaw-aware JDK, an incremental build of WebKit native library no longer works. If you make a change in a native source code file and build with:

gradle -PCOMPILE_WEBKIT=true

The :web:compileNativeXxxxx task is not run and the library is not rebuilt.

To reproduce:

1. Compile with:

gradle -PCOMPILE_WEBKIT=true


2. change a file, for example, modules/javafx.web/src/main/native/Source/WebCore/platform/java/WebPage.cpp, to add a print statement.


3. Compile again with:

gradle -PCOMPILE_WEBKIT=true

Note that :web:compileNativeXxxx is listed as up to date


4. Run a test program and note that your print statement doesn't show up.
Comments
Changeset: bd16088b7c04 Author: kcr Date: 2016-11-15 09:43 -0800 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/bd16088b7c04 8169683: Incremental build of WebKit native library is broken Reviewed-by: ddhill
15-11-2016

+1
15-11-2016

Here is the diff that fixes this. I verified that this behaves as before. If gradle is run with the "-PCOMPILE_WEBKIT=true" option then it will always call CMake, which will compile those files (if any) that are needed. diff --git a/build.gradle b/build.gradle --- a/build.gradle +++ b/build.gradle @@ -3119,6 +3119,7 @@ println "Building Webkit configuration /$webkitConfig/ into $webkitOutputDir" enabled = (IS_COMPILE_WEBKIT) + outputs.upToDateWhen { false } outputs.dir("$webkitOutputDir/$webkitConfig/DerivedSources/WebCore/nativeJava/java") doLast {
15-11-2016

This was caused by a (necessary) change in the :web:compileNativeXxx task as part of JDK-8161704 to configure the "outputs" parameter; the directory containing the generated java sources was added as an output. The problem is that there are no inputs defined, so once the build runs once and creates the directory of generated sources, the task is considered up-to-date after that regardless of any source code changes. Since all of the build logic for native webkit is in the CMake files, the right fix is to restore the previous behavior and always run this task.
15-11-2016

Workaround: do a clean build (there may be other less expensive workarounds)
15-11-2016