JDK-8195669 : JavaFX: Cross Compile for Arm fails on linux
  • Type: Bug
  • Component: javafx
  • Sub-Component: build
  • Affected Version: 9,10
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86_64
  • Submitted: 2018-01-15
  • Updated: 2018-12-03
  • Resolved: 2018-04-23
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
openjfx11Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Ubuntu 16.04.3 LTS
Linux dell-virtual-machine 4.13.0-26-generic #29~16.04.2-Ubuntu SMP Tue Jan 9 22:00:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


EXTRA RELEVANT SYSTEM CONFIGURATION :
Gradle 4.3
------------------------------------------------------------

Build time:   2017-10-30 15:43:29 UTC
Revision:     c684c202534c4138b51033b52d871939b8d38d72

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          9.0.1 (Oracle Corporation 9.0.1+11)
OS:           Linux 4.13.0-26-generic amd64


A DESCRIPTION OF THE PROBLEM :
Currently use Arm java8 from Oracle and compile Openjfx for Arm and overlay libraries for current product line. Looking to test Java9 on Arm and upgrade product line in next generation release.

Cross Compiling openJdk9 for Arm works fine

Trying to compile openJfx from http://hg.openjdk.java.net/openjfx/jfx-dev/rt
Running gradle -PCOMPILE_TARGETS=armv6hf produces swing errors even though  COMPILE_SWING is false in build.gradle.

Problem seems to be with build.gradle line 2154 which has swing tasks being disabled if COMPILE_SWING is false. This code is commented out.

/* should not be built, but needed in JMX
    tasks.all {
        if (!COMPILE_SWING) it.enabled = false
    }
   */

if I uncomment it these errors go away and the build completes.

The resulting armv6hf-modular-sdk folder created by the build is added to jdk configure script with '-with-import-modules=' option as per build instructions. 
Building the jdk now fails with java.base module FindException, are these 2 problems related?



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Followed insturctions

https://wiki.openjdk.java.net/display/OpenJFX/Building+OpenJFX#BuildingOpenJFX-Ubuntu16.04

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Full JVM produced for Arm which includes JavaFX support
ACTUAL -
Failed builds

ERROR MESSAGES/STACK TRACES THAT OCCUR :

<Building OpenJfx error message>
Task :swing:compileJava FAILED
/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/module-info.java:36: error: file should be on source path, or on patch path for module
module javafx.swing {

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/SwingNodeHelper.java:26: error: file should be on source path, or on patch path for module
package com.sun.javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/Disposer.java:26: error: file should be on source path, or on patch path for module
package com.sun.javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/SwingFXUtilsImpl.java:26: error: file should be on source path, or on patch path for module
package com.sun.javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/DisposerRecord.java:26: error: file should be on source path, or on patch path for module
package com.sun.javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/javafx/embed/swing/SwingFXUtils.java:26: error: file should be on source path, or on patch path for module
package javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/javafx/embed/swing/FXDnD.java:26: error: file should be on source path, or on patch path for module
package javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/javafx/embed/swing/InputMethodSupport.java:26: error: file should be on source path, or on patch path for module
package javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/javafx/embed/swing/JFXPanel.java:26: error: file should be on source path, or on patch path for module
package javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/javafx/embed/swing/CachingTransferable.java:26: error: file should be on source path, or on patch path for module
package javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/javafx/embed/swing/SwingCursors.java:26: error: file should be on source path, or on patch path for module
package javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/javafx/embed/swing/DataFlavorUtils.java:26: error: file should be on source path, or on patch path for module
package javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/javafx/embed/swing/SwingEvents.java:26: error: file should be on source path, or on patch path for module
package javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/javafx/embed/swing/SwingDnD.java:26: error: file should be on source path, or on patch path for module
package javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/javafx/embed/swing/SwingNode.java:26: error: file should be on source path, or on patch path for module
package javafx.embed.swing;

/home/dell/Documents/IwOpenJdk9/src/openjfx/rt/modules/javafx.swing/src/main/java/javafx/embed/swing/SwingDragSource.java:26: error: file should be on source path, or on patch path for module
package javafx.embed.swing;

16 errors

FAILURE: Build failed with an exception.
</Building OpenJfx error message>





<Linking OpenJfx into openJdk build error message>
Error: Module javafx.base not found
java.lang.module.FindException: Module javafx.base not found
at java.base/java.lang.module.Resolver.findFail(Resolver.java:889)
at java.base/java.lang.module.Resolver.resolve(Resolver.java:128)
at java.base/java.lang.module.Configuration.resolve(Configuration.java:357)
at java.base/java.lang.module.Configuration.resolve(Configuration.java:187)
at jdk.jlink/jdk.tools.jlink.internal.Jlink$JlinkConfiguration.resolve(Jlink.java:242)
at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.createImageProvider(JlinkTask.java:439)
at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.createImage(JlinkTask.java:386)
at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.run(JlinkTask.java:263)
at jdk.jlink/jdk.tools.jlink.internal.Main.run(Main.java:54)
at jdk.jlink/jdk.tools.jlink.internal.Main.main(Main.java:33)
make3: *** [/home/dell/Documents/IwOpenJdk9/src/jdk9dev/build/linux-arm-normal-client-release/images/jre/bin/java] Error 1
Images.gmk:144: recipe for target '/home/dell/Documents/IwOpenJdk9/src/jdk9dev/build/linux-arm-normal-client-release/images/jre/bin/java' failed
</Linking OpenJfx into openJdk build error message>


REPRODUCIBILITY :
This bug can be reproduced always.


Comments
Changeset: 40be25ced32b Author: jvos Date: 2018-04-23 09:08 +0200 URL: http://hg.openjdk.java.net/openjfx/jfx-dev/rt/rev/40be25ced32b 8195669: cross compiler on ARM fails Reviewed-by: kcr Contributed-by: mario@datenwort.at, dell.green@ideaworks.co.uk
23-04-2018

committed.
23-04-2018

Yes, that seems best. +1
20-04-2018

Can we tackle that in a follow-up issue? In general, there are a number of things that should be cleaned up in the platform specific buildSrc/platform.gradle I think the change in this PR is the only change in build.gradle required to make it work, and at least on desktop platforms nothing changes (as COMPILE_SWING is true for those platforms).
20-04-2018

Does "gradle test" still work if COMPILE_SWING is false? The ":systemTests" project depends on ":swing"
19-04-2018

webrev here: http://cr.openjdk.java.net/~jvos/8195669/webrev.00/
19-04-2018

Somewhat related to this, I filed JDK-8195788 to track removing the dead JMX code, in case that has any bearing on uncommenting out the build logic in question.
19-01-2018

Uncommenting the commented out build logic so that the swing project is disabled if COMPILE_SWING = false seems fine to get the build of FX working. The errors in compiling the JDK are likely a different issue. Assigning this to Johan since he builds FX for linux-arm and might have an idea how best to fix this.
19-01-2018