Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8266405

Fix CMake Generator error building Windows WebKit

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • jfx17
    • javafx
    • None
    • x86_64
    • windows_10

      The build of WebKit on Windows fails with the messages:

        CMake Error at CMakeLists.txt:13 (project):
          Generator

            Visual Studio 15 2017 Win64

          could not find any instance of Visual Studio.

      SYSTEM / OS / JAVA RUNTIME INFORMATION

      Microsoft Windows 10 Pro version 10.0.19042
      Microsoft Visual Studio 2019 version 16.9.4

      Cygwin 3.2.0
        $ uname -srm
        CYGWIN_NT-10.0 3.2.0(0.340/5/3) x86_64

      CMake 3.20.0
        $ cmake --version
        cmake version 3.20.0

      Oracle OpenJDK 15.0.2
        $ java --version
        openjdk 15.0.2 2021-01-19
        OpenJDK Runtime Environment (build 15.0.2+7-27)
        OpenJDK 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)

      Apache Ant 1.10.9
        $ ant -version
        Apache Ant(TM) version 1.10.9 compiled on September 27 2020

      Gradle 6.3
        $ gradle --version

        ------------------------------------------------------------
        Gradle 6.3
        ------------------------------------------------------------

        Build time: 2020-03-24 19:52:07 UTC
        Revision: bacd40b727b0130eeac8855ae3f9fd9a0b207c60

        Kotlin: 1.3.70
        Groovy: 2.5.10
        Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
        JVM: 15.0.2 (Oracle Corporation 15.0.2+7-27)
        OS: Windows 10 10.0 amd64

      STEPS TO REPRODUCE

      Follow the instructions for building JavaFX on Windows found here:

      Building OpenJFX
      https://wiki.openjdk.java.net/display/OpenJFX/Building+OpenJFX

      Run a build that includes WebKit. For example, I ran:

        $ gradle -PCOMPILE_WEBKIT=true sdk

      EXPECTED RESULTS

      The build succeeds:

        BUILD SUCCESSFUL in 1h 10m 37s
        140 actionable tasks: 140 executed

      ACTUAL RESULT

      The build fails:

        > Task :web:compileNativeWin
        + cmake ...
        CMake Error at CMakeLists.txt:13 (project):
          Generator

            Visual Studio 15 2017 Win64

          could not find any instance of Visual Studio.

        -- Configuring incomplete, errors occurred!
        See also "C:/cygwin64/home/john/src/jfx/
          modules/javafx.web/build/win/Release/CMakeFiles/CMakeOutput.log".

        > Task :web:compileNativeWin FAILED

        FAILURE: Build failed with an exception.

        * Where:
        Build file 'C:\cygwin64\home\john\src\jfx\build.gradle' line: 3491

        * What went wrong:
        Execution failed for task ':web:compileNativeWin'.
        > Process 'command 'perl'' finished with non-zero exit value 1

        ...

        BUILD FAILED in 4m 20s
        55 actionable tasks: 55 executed

      SOURCE CODE FOR AN EXECUTABLE TEST CASE

      None.

      WORKAROUND

      I worked around the problem by patching the file:

        modules/javafx.web/src/main/native/Tools/Scripts/webkitdirs.pm

      as shown in the attached file called 'webkitdirs.pm.patch'.

        1. build-webkit.log
          9 kB
        2. cmake-help.txt
          9 kB
        3. webkitdirs.pm.patch
          0.8 kB

            jgneff John Neffenger
            jgneff John Neffenger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: