raboof commented on code in PR #258:
URL: https://github.com/apache/incubator-pekko/pull/258#discussion_r1143531260


##########
project/JdkOptions.scala:
##########
@@ -57,14 +57,8 @@ object JdkOptions extends AutoPlugin {
       targetSystemJdk,
       jdk8home,
       fullJavaHomes,
-      Seq(if (scalaVersion.startsWith("3.")) "-Xtarget:8" else 
"-target:jvm-1.8"),
-      // '-release 8' is not enough, for some reason we need the 8 rt.jar
-      // explicitly. To test whether this has the desired effect, compile
-      // pekko-remote and check the invocation of 'ByteBuffer.clear()' in
-      // 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"))
+      Seq(if (scalaVersion.startsWith("3.")) "-Xtarget:8" else "release:8"),
+      (java8home: File) => Seq("-release", "8"))

Review Comment:
   Great to finally remove this nasty workaround!



##########
project/JdkOptions.scala:
##########
@@ -57,14 +57,8 @@ object JdkOptions extends AutoPlugin {
       targetSystemJdk,
       jdk8home,
       fullJavaHomes,
-      Seq(if (scalaVersion.startsWith("3.")) "-Xtarget:8" else 
"-target:jvm-1.8"),
-      // '-release 8' is not enough, for some reason we need the 8 rt.jar
-      // explicitly. To test whether this has the desired effect, compile
-      // pekko-remote and check the invocation of 'ByteBuffer.clear()' in
-      // 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"))
+      Seq(if (scalaVersion.startsWith("3.")) "-Xtarget:8" else "release:8"),

Review Comment:
   :+1: 



##########
project/JdkOptions.scala:
##########
@@ -74,9 +68,7 @@ object JdkOptions extends AutoPlugin {
       jdk8home,
       fullJavaHomes,
       Nil,
-      // '-release 8' would be a neater option here, but is currently not an
-      // option because it doesn't provide access to `sun.misc.Unsafe` #27079
-      (java8home: File) => Seq("-source", "8", "-target", "8", 
"-bootclasspath", java8home + "/jre/lib/rt.jar"))
+      (java8home: File) => Seq("-source", "8", "-target", "8"))

Review Comment:
   Unfortunately, I don't think this is equivalent: if a signature would have 
changed between jdk8 and jdk11, `-target 8` would emit jdk8-compatible 
bytecode, but would still use the jdk11 signature - so the jar would not work 
on an actual jdk8.
   
   On the one hand I don't find any instances of that in our current codebase, 
but on the other hand I'm not sure it's worth introducing the risk...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to