-
Notifications
You must be signed in to change notification settings - Fork 154
Cross-build (most projects) for Scala 2.12.0 #253
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
Changes from 9 commits
b3d4d50
99e51a0
c98f80e
97573d3
26e8bd0
c11010f
a17fd8e
3376e7b
3636f1c
25e982b
c99ec53
753f03c
074dc8d
b2ec04e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,7 @@ import scala.collection.mutable.{ | |
|
|
||
| import scala.util.matching.Regex | ||
|
|
||
| import com.esotericsoftware.kryo.serializers.ClosureSerializer | ||
| import com.twitter.chill.java.PackageRegistrar | ||
| import _root_.java.io.Serializable | ||
|
|
||
|
|
@@ -198,8 +199,16 @@ class AllScalaRegistrar extends IKryoRegistrar { | |
| .forSubclass[scala.Enumeration#Value](new EnumerationSerializer) | ||
|
|
||
| // use the singleton serializer for boxed Unit | ||
| val boxedUnit = scala.Unit.box(()) | ||
| val boxedUnit = scala.runtime.BoxedUnit.UNIT | ||
| k.register(boxedUnit.getClass, new SingletonSerializer(boxedUnit)) | ||
| PackageRegistrar.all()(k) | ||
|
|
||
| // Enable Java 8 lambda serialization only if we are running on a Java 8 JRE: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quick question: what's the best place to register this? And what happens if it already happens to have been registered by some other means?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should make a See for instance the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea; will do.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops, forgot about this comment until now. I've created a |
||
| try { | ||
| Class.forName("java.lang.invoke.SerializedLambda") | ||
| k.register(classOf[ClosureSerializer.Closure], new ClosureSerializer()) | ||
| } catch { | ||
| case e: ClassNotFoundException => // not running on Java 8 | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -299,7 +299,7 @@ class KryoSpec extends WordSpec with Matchers with BaseProperties { | |
| toList(rt(qr)) should equal(qrlist) | ||
| } | ||
| "Ranges should be fixed size" in { | ||
| val MAX_RANGE_SIZE = 188 // what seems to be needed. | ||
| val MAX_RANGE_SIZE = 447 // what seems to be needed. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's a bummer.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😦 We could make this constant a function of Scala version if you'd like to keep using the old value for the old build matrix entries. |
||
| serialize((1 to 10000)).size should be < (MAX_RANGE_SIZE) // some fixed size | ||
| serialize((1 to 10000 by 2)).size should be < (MAX_RANGE_SIZE) // some fixed size | ||
| serialize((1 until 10000)).size should be < (MAX_RANGE_SIZE) // some fixed size | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't be necessary in M5, fixed in scala/scala#5100