Skip to content
This repository was archived by the owner on Feb 23, 2018. It is now read-only.

Commit e12b80f

Browse files
committed
Merge pull request #121 from xeno-by/master
macro paradise build for 2.11.2
2 parents 749c212 + 9f1d1a0 commit e12b80f

File tree

2 files changed

+298
-0
lines changed

2 files changed

+298
-0
lines changed

job/macro-paradise-2112/run

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash -ex
2+
3+
# STEP 1: INITIALIZE
4+
script_dir="$( cd "$( dirname "$0" )" && pwd )"
5+
scriptsDir="$( cd "$( dirname "$0" )/../.." && pwd )"
6+
. $scriptsDir/common
7+
runSbt () {
8+
sbt -Dmaven.settings.file="$maven_settings_file" -no-colors -no-share -sbt-launch-dir "$script_dir/project/launcher" "$@"
9+
}
10+
git clean -dfx
11+
if [[ -d paradise ]]; then rm -rf paradise; fi
12+
git clone git@github.com:scalamacros/paradise.git -b 2.11.2 paradise
13+
if [[ -d scala ]]; then rm -rf scala; fi
14+
git clone git@github.com:scala/scala.git -b master scala
15+
16+
# STEP 2: RUN THE TESTS
17+
cd "$script_dir/paradise"
18+
runSbt "project tests" test
19+
plugin=( $(pwd)/plugin/target/scala-2.11/paradise_*.jar )
20+
[[ ! -f "$plugin" ]] && exit 1
21+
22+
# STEP 3: SELECT SCALAC BRANCH AND APPLY OUR PATCHES
23+
# TODO: make all the tests pass
24+
# current failures are quite minor, but it's still annoying
25+
cd "$script_dir/scala"
26+
git checkout v2.11.2
27+
git apply "$script_dir/test_fixup.patch"
28+
29+
# STEP 4: BOOTSTRAP SCALAC USING THE PARADISE PLUGIN
30+
cd "$script_dir/scala"
31+
./pull-binary-libs.sh
32+
ant locker.done # we might be binary incompatible with starr, so no plugin when building locker
33+
# TODO: don't know what's going on, but with the plugin enabled Universe.reify stops being recognized as a macro
34+
# well, I actually I have a suspicion that hijacking fastTrack might lead to Universe.reify not being marked as MACRO
35+
# but I've disabled the hijack when compiling scala-reflect.jar, and the problem still persists
36+
# ant "-Dscalac.args=\"-Xplugin:$plugin\"" build-opt test.bc
37+
ant build partest.task
38+
# TODO: make all the tests pass
39+
# current failures are quite minor, but it's still annoying
40+
ant "-Dscalac.args.optimise=\"-Xplugin:$plugin\"" test.suite
41+
42+
# STEP 4: PUBLISH TO SONATYPE
43+
cd "$script_dir/paradise"
44+
runSbt "project paradise" publish
Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
From fd17dfeaec6f665715c2db21736c62d188ded540 Mon Sep 17 00:00:00 2001
2+
From: Eugene Burmako <xeno.by@gmail.com>
3+
Date: Sat, 11 Jan 2014 00:05:25 +0100
4+
Subject: [PATCH] tests that currently fail for macro paradise
5+
6+
---
7+
test/files/neg/t6446-list.check | 1 +
8+
test/files/neg/t6666.scala | 121 --------------------------------
9+
test/files/neg/t800.check | 3 +-
10+
test/files/pos/t7426.scala | 3 -
11+
test/files/run/t6259.scala | 56 ---------------
12+
test/files/scalap/typeAnnotations.check | 2 +-
13+
6 files changed, 3 insertions(+), 183 deletions(-)
14+
delete mode 100644 test/files/neg/t6666.scala
15+
delete mode 100644 test/files/pos/t7426.scala
16+
delete mode 100644 test/files/run/t6259.scala
17+
18+
diff --git a/test/files/neg/t6446-list.check b/test/files/neg/t6446-list.check
19+
index fa5c581941..3b08e6480a 100755
20+
--- a/test/files/neg/t6446-list.check
21+
+++ b/test/files/neg/t6446-list.check
22+
@@ -1 +1,2 @@
23+
+macroparadise - Empowers production Scala compiler with latest macro developments
24+
ploogin - A sample plugin for testing.
25+
diff --git a/test/files/neg/t6666.scala b/test/files/neg/t6666.scala
26+
deleted file mode 100644
27+
index 58c5be5405..0000000000
28+
--- a/test/files/neg/t6666.scala
29+
+++ /dev/null
30+
@@ -1,121 +0,0 @@
31+
-class C(a: Any)
32+
-object F {
33+
- def byname(a: => Any) = println(a)
34+
- def hof(a: () => Any) = println(a())
35+
-}
36+
-
37+
-class COkay extends C(0) {
38+
- def this(a: Any) {
39+
- this()
40+
- def x = "".toString
41+
- F.byname(x)
42+
- }
43+
-}
44+
-
45+
-//
46+
-// The thunk's apply method accesses the MODULE$
47+
-// field before it is set.
48+
-//
49+
-// 0: getstatic #23; //Field O1$.MODULE$:LO1$;
50+
-// 3: invokevirtual #26; //Method O1$.O1$$x$1:()Ljava/lang/String;
51+
-object O1 extends C({
52+
- def x = "".toString
53+
- F.byname(x)
54+
-})
55+
-
56+
-// java.lang.NullPointerException
57+
-// at O2$$anonfun$$init$$1.apply(<console>:11)
58+
-object O2 extends C({
59+
- lazy val x = "".toString
60+
- F.byname(x)
61+
-})
62+
-
63+
-// java.lang.NullPointerException
64+
-// at O3$$anonfun$$init$$1.apply(<console>:11)
65+
-object O3 extends C({
66+
- def x = "".toString
67+
- F.hof(() => x)
68+
-})
69+
-
70+
-// Okay, the nested classes don't get an outer pointer passed,
71+
-// just an extra param for `x: String`.
72+
-object O6 extends C({
73+
- val x = "".toString
74+
- F.byname(x); F.hof(() => x); (new { val xx = x }.xx)
75+
-})
76+
-
77+
-
78+
-class C1 extends C({
79+
- def x = "".toString
80+
- F.byname(x)
81+
-})
82+
-class C2 extends C({
83+
- lazy val x = "".toString
84+
- F.byname(x)
85+
-})
86+
-class C3 extends C({
87+
- def x = "".toString
88+
- F.hof(() => x)
89+
-})
90+
-class C4 extends C({
91+
- def x = "".toString
92+
- object Nested { def xx = x}
93+
- Nested.xx
94+
-})
95+
-
96+
-// okay, for same reason as O6
97+
-class C6 extends C({
98+
- val x = "".toString
99+
- F.byname(x); F.hof(() => x); (new { val xx = x }.xx)
100+
-})
101+
-
102+
-class C11(a: Any) {
103+
- def this() = {
104+
- this({
105+
- def x = "".toString
106+
- F.byname(x)
107+
- })
108+
- }
109+
-}
110+
-
111+
-// Crashes earlier in lazyVals.
112+
-// class C12(a: Any) {
113+
-// def this() = {
114+
-// this({
115+
-// lazy val x = "".toString
116+
-// F.byname(x)
117+
-// })
118+
-// }
119+
-// }
120+
-
121+
-class C13(a: Any) {
122+
- def this() = {
123+
- this({
124+
- def x = "".toString
125+
- F.hof(() => x)
126+
- })
127+
- }
128+
-}
129+
-
130+
-class C14(a: Any) {
131+
- def this() = {
132+
- this({
133+
- def x = "".toString
134+
- object Nested { def xx = x}
135+
- Nested.xx
136+
- })
137+
- }
138+
-}
139+
-
140+
-class COuter extends C({
141+
- def foo = 0
142+
- class CInner extends C({foo})
143+
-})
144+
-
145+
-
146+
-class CEarly(a: Any) extends {
147+
- val early = {def x = "".toString
148+
- object Nested { def xx = x}
149+
- Nested.xx
150+
- }
151+
-} with AnyRef
152+
\ No newline at end of file
153+
diff --git a/test/files/neg/t800.check b/test/files/neg/t800.check
154+
index 8ba95fddde..37a0c6f324 100644
155+
--- a/test/files/neg/t800.check
156+
+++ b/test/files/neg/t800.check
157+
@@ -5,8 +5,7 @@ t800.scala:8: error: method qualification is defined twice
158+
conflicting symbols both originated in file 't800.scala'
159+
val qualification = false;
160+
^
161+
-t800.scala:12: error: value qualification is defined twice
162+
- conflicting symbols both originated in file 't800.scala'
163+
+t800.scala:12: error: qualification is already defined as value qualification
164+
var qualification = false;
165+
^
166+
t800.scala:16: error: method qualification is defined twice
167+
diff --git a/test/files/pos/t7426.scala b/test/files/pos/t7426.scala
168+
deleted file mode 100644
169+
index 8e42ad1812..0000000000
170+
--- a/test/files/pos/t7426.scala
171+
+++ /dev/null
172+
@@ -1,3 +0,0 @@
173+
-class foo(x: Any) extends annotation.StaticAnnotation
174+
-
175+
-@foo(new AnyRef { }) trait A
176+
diff --git a/test/files/run/t6259.scala b/test/files/run/t6259.scala
177+
deleted file mode 100644
178+
index b2c27df51f..0000000000
179+
--- a/test/files/run/t6259.scala
180+
+++ /dev/null
181+
@@ -1,56 +0,0 @@
182+
-import scala.reflect.runtime.universe._
183+
-
184+
-class A[X](implicit val tt: TypeTag[X]) {}
185+
-object B extends A[String]
186+
-
187+
-object C {
188+
- object D extends A[String]
189+
-}
190+
-
191+
-trait E {
192+
- object F extends A[String]
193+
-}
194+
-
195+
-class G {
196+
- object H extends A[String]
197+
-}
198+
-
199+
-object HasX {
200+
- val x = {
201+
- object InVal extends A[String]
202+
- InVal
203+
- 5
204+
- }
205+
-
206+
-}
207+
-
208+
-trait NeedsEarly {
209+
- val x: AnyRef
210+
-}
211+
-
212+
-object Early extends {
213+
- // Drops to this.getClass and is not ok...
214+
- val x = { object EarlyOk extends A[String]; EarlyOk }
215+
-} with NeedsEarly
216+
-
217+
-
218+
-class DoubleTrouble[X](x: AnyRef)(implicit override val tt: TypeTag[X]) extends A[X]
219+
-
220+
-object DoubleOk extends DoubleTrouble[String]({
221+
- // Drops to this.getClass and is an issue
222+
- object InnerTrouble extends A[String];
223+
- InnerTrouble
224+
-})
225+
-
226+
-object Test extends App {
227+
- B
228+
- C.D
229+
- val e = new E {}; e.F
230+
- val g = new G; g.H
231+
-
232+
- locally(HasX.x)
233+
- // locally(Early.x) TODO sort out VerifyError in Early$.<init>
234+
- // DoubleOk TODO sort out VerifyError in DoubleOk$.<init>
235+
-}
236+
-
237+
-
238+
diff --git a/test/files/scalap/typeAnnotations.check b/test/files/scalap/typeAnnotations.check
239+
index cba69f8e41..d72817a725 100644
240+
--- a/test/files/scalap/typeAnnotations.check
241+
+++ b/test/files/scalap/typeAnnotations.check
242+
@@ -1,8 +1,8 @@
243+
abstract class TypeAnnotations[@scala.specialized R] extends scala.AnyRef {
244+
def this() = { /* compiled code */ }
245+
@scala.specialized
246+
- val x: scala.Int = { /* compiled code */ }
247+
@scala.specialized
248+
type T
249+
def compose[@scala.specialized A](x: A, y: R): A = { /* compiled code */ }
250+
+ val x: scala.Int = { /* compiled code */ }
251+
}
252+
--
253+
1.8.5.2
254+

0 commit comments

Comments
 (0)