-
Notifications
You must be signed in to change notification settings - Fork 19
Update README and put CI in place #22
Comments
Thanks! I've seen discussions on IRC about CI (but not the details); a problem are build times are too long for Travis. |
We've recently been having problems with travis as our buid gets bigger/more complex. It will kill processes that spend too long above single thread. I suspect that this CI build will suffer from similar issues. http://docs.travis-ci.com/user/common-build-problems/#My-build-script-is-killed-without-any-error Right now I''m considering setting up a VPS jenkins instance to do main and PR builds (there are plugins to support all of it). |
Hi Roy, I did it already with Lars help : Please see the mailing list for more details
|
Awesome. |
We now have http://typelevel-ci.orexio.org/job/typelevel-scala-pr/ and it's working pretty well. We might have some better stuff coming soon but I'm happy to close this general issue. I have a PR for a better README. I'll make it better and get it merged. |
In Scala 2.8.2, an optimization was added to create a static cache for Symbol literals (ie, the results of `Symbol.apply("foo"))`. This saves the map lookup on the second pass through code. This actually was broken somewhere during the Scala 2.10 series, after the addition of an overloaded `apply` method to `Symbol`. The cache synthesis code was made aware of the overload and brought back to working condition recently, in scala#3149. However, this has uncovered a latent bug when the Symbol literals are defined with traits. One of the enclosed tests failed with: jvm > t8933b-run.log java.lang.IllegalAccessError: tried to access field MotherClass.symbol$1 from class MixinWithSymbol$class at MixinWithSymbol$class.symbolFromTrait(A.scala:3) at MotherClass.symbolFromTrait(Test.scala:1) This commit simply disables the optimization if we are in a trait. Alternative fixes might be: a) make the static Symbol cache field public / b) "mixin" the static symbol cache. Neither of these seem worth the effort and risk for an already fairly situational optimization. Here's how the optimization looks in a class: % cat sandbox/test.scala; qscalac sandbox/test.scala && echo ":javap C" | qscala; class C { 'a; 'b } Welcome to Scala version 2.11.5-20141106-145558-aa558dce6d (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_20). Type in expressions to have them evaluated. Type :help for more information. scala> :javap C Size 722 bytes MD5 checksum 6bb00189166917254e8d40499ee7c887 Compiled from "test.scala" public class C { public static {}; descriptor: ()V flags: ACC_PUBLIC, ACC_STATIC Code: stack=2, locals=0, args_size=0 0: getstatic typelevel#16 // Field scala/Symbol$.MODULE$:Lscala/Symbol$; 3: ldc typelevel#18 // String a 5: invokevirtual typelevel#22 // Method scala/Symbol$.apply:(Ljava/lang/String;)Lscala/Symbol; 8: putstatic typelevel#26 // Field symbol$1:Lscala/Symbol; 11: getstatic typelevel#16 // Field scala/Symbol$.MODULE$:Lscala/Symbol$; 14: ldc typelevel#28 // String b 16: invokevirtual typelevel#22 // Method scala/Symbol$.apply:(Ljava/lang/String;)Lscala/Symbol; 19: putstatic typelevel#31 // Field symbol$2:Lscala/Symbol; 22: return public C(); descriptor: ()V flags: ACC_PUBLIC Code: stack=1, locals=1, args_size=1 0: aload_0 1: invokespecial typelevel#34 // Method java/lang/Object."<init>":()V 4: getstatic typelevel#26 // Field symbol$1:Lscala/Symbol; 7: pop 8: getstatic typelevel#31 // Field symbol$2:Lscala/Symbol; 11: pop 12: return } fixup
Rather than in implementation of the abstract method in the expanded anonymous class. This leads to more more efficient use of the constant pool, code shapes more amenable to SAM inlining, and is compatible with the old behaviour of `-Xexperimental` in Scala 2.11, which ScalaJS now relies upon. Manual test: ``` scala> :paste -raw // Entering paste mode (ctrl-D to finish) package p1; trait T { val x = 0; def apply(): Any }; class DelambdafyInline { def t: T = (() => "") } // Exiting paste mode, now interpreting. scala> :javap -c p1.DelambdafyInline Compiled from "<pastie>" public class p1.DelambdafyInline { public p1.T t(); Code: 0: new scala#10 // class p1/DelambdafyInline$$anonfun$t$1 3: dup 4: aload_0 5: invokespecial scala#16 // Method p1/DelambdafyInline$$anonfun$t$1."<init>":(Lp1/DelambdafyInline;)V 8: areturn public final java.lang.Object p1$DelambdafyInline$$$anonfun$1(); Code: 0: ldc scala#22 // String 2: areturn public p1.DelambdafyInline(); Code: 0: aload_0 1: invokespecial scala#25 // Method java/lang/Object."<init>":()V 4: return } scala> :javap -c p1.DelambdafyInline$$anonfun$t$1 Compiled from "<pastie>" public final class p1.DelambdafyInline$$anonfun$t$1 implements p1.T,scala.Serializable { public static final long serialVersionUID; public int x(); Code: 0: aload_0 1: getfield scala#25 // Field x:I 4: ireturn public void p1$T$_setter_$x_$eq(int); Code: 0: aload_0 1: iload_1 2: putfield scala#25 // Field x:I 5: return public final java.lang.Object apply(); Code: 0: aload_0 1: getfield scala#34 // Field $outer:Lp1/DelambdafyInline; 4: invokevirtual scala#37 // Method p1/DelambdafyInline.p1$DelambdafyInline$$$anonfun$1:()Ljava/lang/Object; 7: areturn public p1.DelambdafyInline$$anonfun$t$1(p1.DelambdafyInline); Code: 0: aload_1 1: ifnonnull 6 4: aconst_null 5: athrow 6: aload_0 7: aload_1 8: putfield scala#34 // Field $outer:Lp1/DelambdafyInline; 11: aload_0 12: invokespecial scala#42 // Method java/lang/Object."<init>":()V 15: aload_0 16: invokespecial scala#45 // Method p1/T.$init$:()V 19: return } scala> :quit ``` Adriaan is to `git blame` for `reflection-mem-typecheck.scala`.
It would be great if you updated the README with practical details about this fork and also used a lot of the supporting infrastructure to get a CI up and running.
We recently did a review of what is out there to assist community dev in https://github.com/ensime/ensime-server so please feel free to take our ideas.
The text was updated successfully, but these errors were encountered: