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

Update Scala versions #258

Merged
merged 1 commit into from Mar 21, 2023
Merged

Conversation

mdedetrich
Copy link
Contributor

@mdedetrich mdedetrich commented Mar 21, 2023

This PR updates the Scala versions of Akka.

References: #6

Copy link
Contributor

@nvollmar nvollmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mdedetrich mdedetrich force-pushed the update-scala-versions branch 2 times, most recently from 0d5dddf to d3ed65f Compare March 21, 2023 13:06
@mdedetrich
Copy link
Contributor Author

@mdedetrich
Copy link
Contributor Author

mdedetrich commented Mar 21, 2023

So one thing to note on this PR is that the workaround with using -target described in akka/akka#27079 has been removed. because -target is now deprecated in the latest versions of Scala 2.12/Scala 2.13 and more importantly -release has since been fixed so this specific workaround is not necessary anymore. The original problem with -release was that it didn't properly link the JDK 8 runtime library however this has since been solved. As stated in https://github.com/apache/incubator-pekko/blob/main/project/JdkOptions.scala#L60-L67 this can be verified, and I can at least confirm on my end that -release has indeed been fixed, i.e.

<@incubator-pekko/r/t/s/c/o/a/p/r/artery>-<⎇ update-scala-versions>-<±>-<*>-2-> javap -c EnvelopeBuffer.class | grep "java/nio/ByteBuffer.clear:()Ljava/nio/Buffer"
       9: invokevirtual #121                // Method java/nio/ByteBuffer.clear:()Ljava/nio/Buffer;

works for both Scala 2.12 and Scala 2.13.

Aside from that the newer versions of Scala 2.12 and Scala 2.13 have improved/added/updated various warnings which explains the the various changes to @nowarn annotation.

@mdedetrich
Copy link
Contributor Author

mdedetrich commented Mar 21, 2023

@raboof @He-Pin @jrudolph Since you are more familiar with the internals do you want to have a look if there is anything out of place on this PR? #258 (comment) is of importance. Also https://discord.com/channels/632150470000902164/632150470000902166/1087731784990605402 is relevant here.

project/JdkOptions.scala Show resolved Hide resolved
project/JdkOptions.scala Show resolved Hide resolved
project/JdkOptions.scala Outdated Show resolved Hide resolved
scripts/link-validator.conf Show resolved Hide resolved
@He-Pin
Copy link
Member

He-Pin commented Mar 21, 2023

I was submitted a pr in akka/akka for this
akka/akka#31648
akka/akka#31652

and for compiling scala with 3.2 & 3.1 akka/akka#31578

@mdedetrich Would you like to check if there is something missing?

@mdedetrich
Copy link
Contributor Author

@He-Pin I checked the relevant PR's and it doesn't appear that I have missed anything (the Scala 3.2 one I ignored because thats a separate concern). There can be further simplification but would make sense to do this in context of Scala 3.

@mdedetrich mdedetrich merged commit 85c2a46 into apache:main Mar 21, 2023
@mdedetrich mdedetrich deleted the update-scala-versions branch March 21, 2023 20:56
@@ -164,7 +164,7 @@ object PekkoDisciplinePlugin extends AutoPlugin {
"-Ywarn-numeric-widen",
"-Yno-adapted-args",
"-deprecation",
"-Xlint",
"-Xlint:-infer-any",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This enables no lints. -Xlint -Xlint:-infer-any or -Xlint:-infer-any,_ with underscore to mean all. (Not sure if that was intended here.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixing now

// EnvelopeBuffer.class with 'javap -c': it should refer to
// ""java/nio/ByteBuffer.clear:()Ljava/nio/Buffer" and not
// "java/nio/ByteBuffer.clear:()Ljava/nio/ByteBuffer". Issue #27079
(java8home: File) => Seq("-release", "8", "-javabootclasspath", java8home + "/jre/lib/rt.jar"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of -javabootclasspath breaks building with JDK 11 for me, also reproducible in Docker containers. I know I investigated before, if it could be removed and I ran into issues before.

I wonder how it works on Github CI and other machines.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, seems to work on my machine - what does it break on for you?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrudolph we have a release candidate (1.0.1-RC1) at https://repository.apache.org/content/groups/staging/org/apache/pekko/

Would you be able to see if there is anything missing in the jars?

The RCs have been built on my Mac. I use sdkman to manage my JDK installs.

The CI builds all seem fine.

I have no objection to putting back the javabootclasspath if it makes the build work for you. In the short term, I would be worried that there is something up with RC and the 1.0.0 release.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at this conversation, but FYI there was a bug fix to prefer javabootclasspath, someone needed to compile against a specific version of rt.jar. This PR scala/scala#10336

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RC1 pekko-remote jar: I ran the javap -c on the EnvelopeBuffer class and got

      9: invokevirtual #121                // Method java/nio/ByteBuffer.clear:()Ljava/nio/Buffer;

Which I think means that the RC1 jar is not affected by Issue #27079

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at this conversation, but FYI there was a bug fix to prefer javabootclasspath, someone needed to compile against a specific version of rt.jar. This PR scala/scala#10336

Thanks @som-snytt - the Pekko build uses Scala 2.13.11 so we might be benefitting from the scala/scala#10336 change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants