Error building from source on Mac
Kevin Rushforth
kevin.rushforth at oracle.com
Sat May 17 14:06:05 UTC 2025
I presume this is Xcode 16? This is a bug in our code that we will need
to fix.
GlassTouches is currently dead code and will either be removed or
reworked at some point. See JDK-8238435, [2] which also has a comment
from Martin Fox pointing out that this will no longer compile with Xcode
16. This might be a good reason to do that.
As an FYI, we currently use Xcode 14 (14.3.1 to be precise) for our
production builds and are in the final testing stages of updating to
Xcode 15.4 to match JDK 25. See Draft PR 1798 [1], which I plan to take
out of Draft early next week. We will at some point want to start
building with Xcode 16, so we do want to fix this bug.
-- Kevin
[1] https://github.com/openjdk/jfx/pull/1798
[2] https://bugs.openjdk.org/browse/JDK-8238435
On 5/17/2025 2:26 AM, Peter Hull wrote:
> If I checkout from git and attempt to build with `sh gradlew` I get this error:
>
> /Projects/jfx/modules/javafx.graphics/src/main/native-glass/mac/GlassTouches.m:122:14:
> error: comparison of different enumeration types ('CGEventType' (aka
> 'enum CGEventType') and 'enum NSEventType') [-Werror,-Wenum-compare]
> 122 | if (type == NSEventTypeGesture)
> | ~~~~ ^ ~~~~~~~~~~~~~~~~~~
> 1 error generated.
>
>> Task :graphics:ccMacGlass FAILED
> FAILURE: Build failed with an exception.
>
> * What went wrong:
> Execution failed for task ':graphics:ccMacGlass'.
>
> Is this a bug? I am not sure of the purpose of this code but as far as
> I know CGEventType is not 'toll-free bridged' to NSEventType and I
> don't see a CGEventType that corresponds to NSEventTypeGesture. So
> potentially this branch could be taken incorrectly - or it may be
> absolutely fine.
>
> Peter
>
> For info I am using these versions:
>
> % javac -version
> javac 23.0.2
>
> % cc --version
> Apple clang version 17.0.0 (clang-1700.0.13.3)
> Target: arm64-apple-darwin24.5.0
> Thread model: posix
> InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
>
> % sw_vers
> ProductName: macOS
> ProductVersion: 15.5
> BuildVersion: 24F74
>
> % git show --oneline -s
> 5b659f58e5 (HEAD -> master, upstream/master) 8354631: [macos]
> OpenURIHandler events not received by AWT when JavaFX is primary
> toolkit
>
> (I know I should ideally be using JDK24 for this but it's not in
> homebrew yet and I don't think this problem in the native code is
> caused by a Java version mismatch)
More information about the openjfx-dev
mailing list