diff --git a/job/macro-paradise-2112/run b/job/macro-paradise-2112/run new file mode 100755 index 0000000..7a92894 --- /dev/null +++ b/job/macro-paradise-2112/run @@ -0,0 +1,44 @@ +#!/bin/bash -ex + +# STEP 1: INITIALIZE +script_dir="$( cd "$( dirname "$0" )" && pwd )" +scriptsDir="$( cd "$( dirname "$0" )/../.." && pwd )" +. $scriptsDir/common +runSbt () { + sbt -Dmaven.settings.file="$maven_settings_file" -no-colors -no-share -sbt-launch-dir "$script_dir/project/launcher" "$@" +} +git clean -dfx +if [[ -d paradise ]]; then rm -rf paradise; fi +git clone git@github.com:scalamacros/paradise.git -b 2.11.2 paradise +if [[ -d scala ]]; then rm -rf scala; fi +git clone git@github.com:scala/scala.git -b master scala + +# STEP 2: RUN THE TESTS +cd "$script_dir/paradise" +runSbt "project tests" test +plugin=( $(pwd)/plugin/target/scala-2.11/paradise_*.jar ) +[[ ! -f "$plugin" ]] && exit 1 + +# STEP 3: SELECT SCALAC BRANCH AND APPLY OUR PATCHES +# TODO: make all the tests pass +# current failures are quite minor, but it's still annoying +cd "$script_dir/scala" +git checkout v2.11.2 +git apply "$script_dir/test_fixup.patch" + +# STEP 4: BOOTSTRAP SCALAC USING THE PARADISE PLUGIN +cd "$script_dir/scala" +./pull-binary-libs.sh +ant locker.done # we might be binary incompatible with starr, so no plugin when building locker +# TODO: don't know what's going on, but with the plugin enabled Universe.reify stops being recognized as a macro +# well, I actually I have a suspicion that hijacking fastTrack might lead to Universe.reify not being marked as MACRO +# but I've disabled the hijack when compiling scala-reflect.jar, and the problem still persists +# ant "-Dscalac.args=\"-Xplugin:$plugin\"" build-opt test.bc +ant build partest.task +# TODO: make all the tests pass +# current failures are quite minor, but it's still annoying +ant "-Dscalac.args.optimise=\"-Xplugin:$plugin\"" test.suite + +# STEP 4: PUBLISH TO SONATYPE +cd "$script_dir/paradise" +runSbt "project paradise" publish diff --git a/job/macro-paradise-2112/test_fixup.patch b/job/macro-paradise-2112/test_fixup.patch new file mode 100644 index 0000000..e760d55 --- /dev/null +++ b/job/macro-paradise-2112/test_fixup.patch @@ -0,0 +1,254 @@ +From fd17dfeaec6f665715c2db21736c62d188ded540 Mon Sep 17 00:00:00 2001 +From: Eugene Burmako +Date: Sat, 11 Jan 2014 00:05:25 +0100 +Subject: [PATCH] tests that currently fail for macro paradise + +--- + test/files/neg/t6446-list.check | 1 + + test/files/neg/t6666.scala | 121 -------------------------------- + test/files/neg/t800.check | 3 +- + test/files/pos/t7426.scala | 3 - + test/files/run/t6259.scala | 56 --------------- + test/files/scalap/typeAnnotations.check | 2 +- + 6 files changed, 3 insertions(+), 183 deletions(-) + delete mode 100644 test/files/neg/t6666.scala + delete mode 100644 test/files/pos/t7426.scala + delete mode 100644 test/files/run/t6259.scala + +diff --git a/test/files/neg/t6446-list.check b/test/files/neg/t6446-list.check +index fa5c581941..3b08e6480a 100755 +--- a/test/files/neg/t6446-list.check ++++ b/test/files/neg/t6446-list.check +@@ -1 +1,2 @@ ++macroparadise - Empowers production Scala compiler with latest macro developments + ploogin - A sample plugin for testing. +diff --git a/test/files/neg/t6666.scala b/test/files/neg/t6666.scala +deleted file mode 100644 +index 58c5be5405..0000000000 +--- a/test/files/neg/t6666.scala ++++ /dev/null +@@ -1,121 +0,0 @@ +-class C(a: Any) +-object F { +- def byname(a: => Any) = println(a) +- def hof(a: () => Any) = println(a()) +-} +- +-class COkay extends C(0) { +- def this(a: Any) { +- this() +- def x = "".toString +- F.byname(x) +- } +-} +- +-// +-// The thunk's apply method accesses the MODULE$ +-// field before it is set. +-// +-// 0: getstatic #23; //Field O1$.MODULE$:LO1$; +-// 3: invokevirtual #26; //Method O1$.O1$$x$1:()Ljava/lang/String; +-object O1 extends C({ +- def x = "".toString +- F.byname(x) +-}) +- +-// java.lang.NullPointerException +-// at O2$$anonfun$$init$$1.apply(:11) +-object O2 extends C({ +- lazy val x = "".toString +- F.byname(x) +-}) +- +-// java.lang.NullPointerException +-// at O3$$anonfun$$init$$1.apply(:11) +-object O3 extends C({ +- def x = "".toString +- F.hof(() => x) +-}) +- +-// Okay, the nested classes don't get an outer pointer passed, +-// just an extra param for `x: String`. +-object O6 extends C({ +- val x = "".toString +- F.byname(x); F.hof(() => x); (new { val xx = x }.xx) +-}) +- +- +-class C1 extends C({ +- def x = "".toString +- F.byname(x) +-}) +-class C2 extends C({ +- lazy val x = "".toString +- F.byname(x) +-}) +-class C3 extends C({ +- def x = "".toString +- F.hof(() => x) +-}) +-class C4 extends C({ +- def x = "".toString +- object Nested { def xx = x} +- Nested.xx +-}) +- +-// okay, for same reason as O6 +-class C6 extends C({ +- val x = "".toString +- F.byname(x); F.hof(() => x); (new { val xx = x }.xx) +-}) +- +-class C11(a: Any) { +- def this() = { +- this({ +- def x = "".toString +- F.byname(x) +- }) +- } +-} +- +-// Crashes earlier in lazyVals. +-// class C12(a: Any) { +-// def this() = { +-// this({ +-// lazy val x = "".toString +-// F.byname(x) +-// }) +-// } +-// } +- +-class C13(a: Any) { +- def this() = { +- this({ +- def x = "".toString +- F.hof(() => x) +- }) +- } +-} +- +-class C14(a: Any) { +- def this() = { +- this({ +- def x = "".toString +- object Nested { def xx = x} +- Nested.xx +- }) +- } +-} +- +-class COuter extends C({ +- def foo = 0 +- class CInner extends C({foo}) +-}) +- +- +-class CEarly(a: Any) extends { +- val early = {def x = "".toString +- object Nested { def xx = x} +- Nested.xx +- } +-} with AnyRef +\ No newline at end of file +diff --git a/test/files/neg/t800.check b/test/files/neg/t800.check +index 8ba95fddde..37a0c6f324 100644 +--- a/test/files/neg/t800.check ++++ b/test/files/neg/t800.check +@@ -5,8 +5,7 @@ t800.scala:8: error: method qualification is defined twice + conflicting symbols both originated in file 't800.scala' + val qualification = false; + ^ +-t800.scala:12: error: value qualification is defined twice +- conflicting symbols both originated in file 't800.scala' ++t800.scala:12: error: qualification is already defined as value qualification + var qualification = false; + ^ + t800.scala:16: error: method qualification is defined twice +diff --git a/test/files/pos/t7426.scala b/test/files/pos/t7426.scala +deleted file mode 100644 +index 8e42ad1812..0000000000 +--- a/test/files/pos/t7426.scala ++++ /dev/null +@@ -1,3 +0,0 @@ +-class foo(x: Any) extends annotation.StaticAnnotation +- +-@foo(new AnyRef { }) trait A +diff --git a/test/files/run/t6259.scala b/test/files/run/t6259.scala +deleted file mode 100644 +index b2c27df51f..0000000000 +--- a/test/files/run/t6259.scala ++++ /dev/null +@@ -1,56 +0,0 @@ +-import scala.reflect.runtime.universe._ +- +-class A[X](implicit val tt: TypeTag[X]) {} +-object B extends A[String] +- +-object C { +- object D extends A[String] +-} +- +-trait E { +- object F extends A[String] +-} +- +-class G { +- object H extends A[String] +-} +- +-object HasX { +- val x = { +- object InVal extends A[String] +- InVal +- 5 +- } +- +-} +- +-trait NeedsEarly { +- val x: AnyRef +-} +- +-object Early extends { +- // Drops to this.getClass and is not ok... +- val x = { object EarlyOk extends A[String]; EarlyOk } +-} with NeedsEarly +- +- +-class DoubleTrouble[X](x: AnyRef)(implicit override val tt: TypeTag[X]) extends A[X] +- +-object DoubleOk extends DoubleTrouble[String]({ +- // Drops to this.getClass and is an issue +- object InnerTrouble extends A[String]; +- InnerTrouble +-}) +- +-object Test extends App { +- B +- C.D +- val e = new E {}; e.F +- val g = new G; g.H +- +- locally(HasX.x) +- // locally(Early.x) TODO sort out VerifyError in Early$. +- // DoubleOk TODO sort out VerifyError in DoubleOk$. +-} +- +- +diff --git a/test/files/scalap/typeAnnotations.check b/test/files/scalap/typeAnnotations.check +index cba69f8e41..d72817a725 100644 +--- a/test/files/scalap/typeAnnotations.check ++++ b/test/files/scalap/typeAnnotations.check +@@ -1,8 +1,8 @@ + abstract class TypeAnnotations[@scala.specialized R] extends scala.AnyRef { + def this() = { /* compiled code */ } + @scala.specialized +- val x: scala.Int = { /* compiled code */ } + @scala.specialized + type T + def compose[@scala.specialized A](x: A, y: R): A = { /* compiled code */ } ++ val x: scala.Int = { /* compiled code */ } + } +-- +1.8.5.2 +