Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project compilation fails when using OpenJDK 23 on Mac M2 #3462

Closed
arman-yekkehkhani opened this issue Oct 14, 2024 · 10 comments · Fixed by #3473
Closed

Project compilation fails when using OpenJDK 23 on Mac M2 #3462

arman-yekkehkhani opened this issue Oct 14, 2024 · 10 comments · Fixed by #3473
Assignees
Labels
bug Something isn't working
Milestone

Comments

@arman-yekkehkhani
Copy link
Contributor

Describe the bug

When using Java 23

$ java --verison
openjdk 23 2024-09-17
OpenJDK Runtime Environment (build 23+37-2369)
OpenJDK 64-Bit Server VM (build 23+37-2369, mixed mode, sharing)

compilation fails with the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project jkube-kit-common: Compilation failure: Compilation failure: 
[ERROR] /Users/snapp/IdeaProjects/jkube/jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/access/ClusterConfiguration.java:[156,17] cannot find symbol
[ERROR]   symbol:   class ClusterConfigurationBuilder
[ERROR]   location: class org.eclipse.jkube.kit.common.access.ClusterConfiguration
[ERROR] /Users/snapp/IdeaProjects/jkube/jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/access/ClusterConfiguration.java:[179,17] cannot find symbol
.
.
.
[ERROR] /Users/snapp/IdeaProjects/jkube/jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/util/SpringBootUtil.java:[121,18] invalid method reference
[ERROR]   cannot find symbol
[ERROR]     symbol:   method getExecutions()
[ERROR]     location: class org.eclipse.jkube.kit.common.Plugin
[ERROR] /Users/snapp/IdeaProjects/jkube/jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/util/SpringBootUtil.java:[142,54] cannot find symbol
[ERROR]   symbol:   method getBuildDirectory()
[ERROR]   location: variable project of type org.eclipse.jkube.kit.common.JavaProject
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :jkube-kit-common

switching to Java 21, everything goes back to normal.

Eclipse JKube version

SNAPSHOT

Component

JKube Kit

Apache Maven version

None

Gradle version

None

Steps to reproduce

  1. Use Java version 23 using sdk
$ sdk use java 23-open
  1. Try running
$ ./mvnw clean install -DskipTests

Expected behavior

Should compile normally like previous versions of Java

Runtime

other (please specify in additional context)

Kubernetes API Server version

1.25.3

Environment

macOS

Eclipse JKube Logs

No response

Sample Reproducer Project

No response

Additional context

No response

@arman-yekkehkhani arman-yekkehkhani added the bug Something isn't working label Oct 14, 2024
@manusa
Copy link
Member

manusa commented Oct 14, 2024

That looks like an issue with lombok. Does Lombok support Java 23?

@arman-yekkehkhani
Copy link
Contributor Author

@manusa Yeah, you are right! Lombok has not added support for JDK 23.

@manusa
Copy link
Member

manusa commented Oct 14, 2024

@rohanKanojia
Copy link
Member

It's not just on JDK23, I see some test failures on MacOS when built against JDK17.

I tested it via GitHub actions, see logs.

@arman-yekkehkhani
Copy link
Contributor Author

@rohanKanojia I can confirm the same thing. The issue seems similar to #3001 and #3006. I will make a PR to fix that!

@manusa
Copy link
Member

manusa commented Oct 21, 2024

It's not just on JDK23, I see some test failures on MacOS when built against JDK17.

I tested it via GitHub actions, see logs.

Note that the failures are for different reasons, ones can be fixed others can't unless lombok provides a new release or we move away from lombok

arman-yekkehkhani added a commit to arman-yekkehkhani/jkube that referenced this issue Oct 21, 2024
…lRequirementsShouldStartWatcherProcess, issue eclipse-jkube#3462

Signed-off-by: arman-yekkehkhani <[email protected]>
@manusa manusa added this to the 1.18.0 milestone Oct 21, 2024 — with automated-tasks
manusa pushed a commit that referenced this issue Oct 21, 2024
…tcherProcess to fix macOS compilation #3462

Signed-off-by: arman-yekkehkhani <[email protected]>
@rohanKanojia
Copy link
Member

I can see the jkube build successful on MacOS. Thanks a lot!

Maybe we can add a ci pipeline to make sure we don't break it in future.

However, sometimes I see an intermittent failure for WatchServiceTest

Error:    WatchServiceTest$Build.buildsImage:144 
buildService.buildImage(
    org.eclipse.jkube.kit.config.image.ImageConfiguration@ae82ea04,
    null,
    org.eclipse.jkube.kit.common.JKubeConfiguration@99d014ba
);
Wanted 1 time:
-> at org.eclipse.jkube.kit.build.service.docker.BuildService.buildImage(BuildService.java:67)
But was 39 times:
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)
-> at org.eclipse.jkube.kit.build.service.docker.WatchService.lambda$createBuildWatchTask$1(WatchService.java:160)

Are you able to reproduce this issue on your machine?

@arman-yekkehkhani
Copy link
Contributor Author

@rohanKanojia Hi Rohan. I tested on my machine and unfortunately I was not able to reproduce this error. It looks quite peculiar. Maybe look into that when the ci/cd pipeline is in place and we can investigate the root cause.

@rohanKanojia
Copy link
Member

@arman-yekkehkhani : I think Marc fixed this issue in #3484

@manusa
Copy link
Member

manusa commented Oct 25, 2024

The intermittent failure is not fixed, we'll have to look into it and probably replace the mock with something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants