JDK-8306885 : Building WebKit on Windows is not deterministic
  • Type: Bug
  • Component: javafx
  • Sub-Component: build
  • Affected Version: jfx21
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2023-04-26
  • Updated: 2023-05-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
Related Reports
Blocks :  
Description
Building the WebKit native library on Windows is not deterministic. The library, called 'jfxwebkit.dll', differs from one build to the next on the same system with the same project path.

SYSTEM / OS / JAVA RUNTIME INFORMATION

The following build tools were used:

- cmake version 3.26.3
- Visual Studio Build Tools 2022 version 17.1.0, build number 17.1.32210.238
- OpenJDK Runtime Environment (build 19.0.2+7-44)
- Apache Ant(TM) version 1.10.13 compiled on January 4 2023

STEPS TO REPRODUCE

Set the environment variables by sourcing the file called 'jfxbuild.env'. Then run the Bash script called 'release.sh' to build two copies of a simulated JavaFX release and run all of the unit tests.

Both files are included in the SOURCE section below.

EXPECTED RESULTS

When the build script completes, the following command should show no output:

$ diff -qr build5 build6

ACTUAL RESULT

Instead, the command shows differences in the file 'jfxwebkit.dll' and in the archives that include it:

$ diff -qr build5 build6
Files build5/jmods/javafx.web.jmod and build6/jmods/javafx.web.jmod differ
Files build5/modular-sdk/modules_libs/javafx.web/jfxwebkit.dll and build6/modular-sdk/modules_libs/javafx.web/jfxwebkit.dll differ
Files build5/publications/javafx.web-win.jar and build6/publications/javafx.web-win.jar differ
Files build5/sdk/bin/jfxwebkit.dll and build6/sdk/bin/jfxwebkit.dll differ

SOURCE CODE FOR AN EXECUTABLE TEST CASE

The file 'jfxbuild.env' that sets the environment variables:

-----------
#!/bin/bash
# Sets up the environment for building JavaFX

# Path must include 'C:\Windows\System32'
syspath=/usr/sbin:/usr/bin:/sbin:/bin:/cygdrive/c/Windows/System32

# Visual Studio Build Tools 2022
export VS150COMNTOOLS="C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build"

cmake=$HOME/opt/cmake-3.26.3-windows-x86_64
jdk=$HOME/opt/jdk-19.0.2
ant=$HOME/opt/apache-ant-1.10.13

CMAKE_HOME=$(cygpath -m "$cmake")
JAVA_HOME=$(cygpath -m "$jdk")
ANT_HOME=$(cygpath -m "$ant")
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)

export CMAKE_HOME
export JAVA_HOME
export ANT_HOME
export SOURCE_DATE_EPOCH

# JDK_HOME and PATH are required by the build
export JDK_HOME="$JAVA_HOME"
export PATH=$ant/bin:$jdk/bin:$cmake/bin:$syspath
-----------

The file 'release.sh' that runs the two builds and the unit tests:

-----------
#!/bin/bash
# Creates two production builds and runs unit tests
trap exit INT TERM
set -o errexit

dir1=build5
dir2=build6

if [ -d $dir1 ] || [ -d $dir2 ]; then
    printf "Target directories exist: %s %s\n" $dir1 $dir2 >&2
    exit 1
fi

gradle () (
    set -o xtrace
    bash gradlew --no-daemon \
        -PCONF=Release -PPROMOTED_BUILD_NUMBER=12 \
        -PHUDSON_BUILD_NUMBER=101 -PHUDSON_JOB_NAME=jfx \
        -PCOMPILE_WEBKIT=true -PCOMPILE_MEDIA=true -PBUILD_LIBAV_STUBS=true \
        "$@"
)

printf "SOURCE_DATE_EPOCH=%s\n" "$SOURCE_DATE_EPOCH"
for dir in $dir1 $dir2; do
    gradle cleanAll
    gradle sdk jmods javadoc
    mv build "$dir"
done
gradle sdk jmods javadoc test
-----------

WORKAROUND

None.