Skip to content

Commit 2a7f19a

Browse files
Merge pull request #10392 from dotty-staging/upgrade/scala-2.13.4
Upgrade to Scala 2.13.4, switch CI to JDK 15, tweak CI configuration
2 parents 64c8e77 + 07bb6cf commit 2a7f19a

File tree

16 files changed

+122
-102
lines changed

16 files changed

+122
-102
lines changed

.github/workflows/ci.yaml

+98-65
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,27 @@ env:
1010
DOTTY_CI_RUN: true
1111

1212
jobs:
13-
test:
13+
test_non_bootstrapped:
1414
runs-on: [self-hosted, Linux]
1515
container:
16-
image: lampepfl/dotty:2020-09-08
16+
image: lampepfl/dotty:2020-11-19
1717
volumes:
1818
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
1919
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
2020
- ${{ github.workspace }}/../../cache/general:/root/.cache
21-
if: "!(github.event_name == 'push' &&
22-
startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))"
23-
21+
if: "github.event_name == 'schedule'
22+
|| (
23+
github.event_name == 'push'
24+
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
25+
)
26+
|| (
27+
github.event_name == 'pull_request'
28+
&& !contains(github.event.pull_request.body, '[skip ci]')
29+
&& contains(github.event.pull_request.body, '[test_non_bootstrapped]')
30+
)"
2431
steps:
25-
- name: Set JDK 14 as default
26-
run: echo "/usr/lib/jvm/java-14-openjdk-amd64/bin" >> $GITHUB_PATH
32+
- name: Set JDK 15 as default
33+
run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH
2734

2835
- name: Checkout cleanup script
2936
uses: actions/checkout@v2
@@ -42,20 +49,28 @@ jobs:
4249
./project/scripts/sbt ";compile ;test"
4350
./project/scripts/cmdTests
4451
45-
test_bootstrapped:
52+
test:
4653
runs-on: [self-hosted, Linux]
4754
container:
48-
image: lampepfl/dotty:2020-09-08
55+
image: lampepfl/dotty:2020-11-19
4956
volumes:
5057
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
5158
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
5259
- ${{ github.workspace }}/../../cache/general:/root/.cache
53-
if: "!(github.event_name == 'push' &&
54-
startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))"
60+
if: "github.event_name == 'schedule'
61+
|| (
62+
github.event_name == 'push'
63+
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
64+
)
65+
|| (
66+
github.event_name == 'pull_request'
67+
&& !contains(github.event.pull_request.body, '[skip ci]')
68+
&& !contains(github.event.pull_request.body, '[skip test]')
69+
)"
5570

5671
steps:
57-
- name: Set JDK 14 as default
58-
run: echo "/usr/lib/jvm/java-14-openjdk-amd64/bin" >> $GITHUB_PATH
72+
- name: Set JDK 15 as default
73+
run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH
5974

6075
- name: Checkout cleanup script
6176
uses: actions/checkout@v2
@@ -74,26 +89,18 @@ jobs:
7489
./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-dotty/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test"
7590
./project/scripts/bootstrapCmdTests
7691
77-
## Only run bootstrapped tests for Windows since that's a superset of the
78-
## non-bootstrapped tests and bootstrapping issues should be caught by
79-
## the non-bootstrapped Linux runner.
80-
# test-windows:
81-
# runs-on: [self-hosted, Windows]
82-
# if: "!(github.event_name == 'push' &&
83-
# startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))"
84-
85-
# steps:
86-
# - name: Git Checkout
87-
# uses: actions/checkout@v2
88-
89-
# - name: Test
90-
# run: sbt ";compile ;test"
91-
# shell: cmd
92-
93-
test_bootstrapped-windows:
92+
test_windows:
9493
runs-on: [self-hosted, Windows]
95-
if: "!(github.event_name == 'push' &&
96-
startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))"
94+
if: "github.event_name == 'schedule'
95+
|| (
96+
github.event_name == 'push'
97+
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
98+
)
99+
|| (
100+
github.event_name == 'pull_request'
101+
&& !contains(github.event.pull_request.body, '[skip ci]')
102+
&& !contains(github.event.pull_request.body, '[skip test_windows]')
103+
)"
97104

98105
steps:
99106
- name: Git Checkout
@@ -110,11 +117,18 @@ jobs:
110117
community_build_a:
111118
runs-on: [self-hosted, Linux]
112119
container:
113-
image: lampepfl/dotty:2020-09-08
120+
image: lampepfl/dotty:2020-11-19
114121
volumes:
115122
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
116123
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
117124
- ${{ github.workspace }}/../../cache/general:/root/.cache
125+
if: "github.event_name == 'schedule'
126+
|| github.event_name == 'push'
127+
|| (
128+
github.event_name == 'pull_request'
129+
&& !contains(github.event.pull_request.body, '[skip ci]')
130+
&& !contains(github.event.pull_request.body, '[skip community_build]')
131+
)"
118132

119133
steps:
120134
- name: Checkout cleanup script
@@ -138,11 +152,18 @@ jobs:
138152
community_build_b:
139153
runs-on: [self-hosted, Linux]
140154
container:
141-
image: lampepfl/dotty:2020-09-08
155+
image: lampepfl/dotty:2020-11-19
142156
volumes:
143157
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
144158
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
145159
- ${{ github.workspace }}/../../cache/general:/root/.cache
160+
if: "github.event_name == 'schedule'
161+
|| github.event_name == 'push'
162+
|| (
163+
github.event_name == 'pull_request'
164+
&& !contains(github.event.pull_request.body, '[skip ci]')
165+
&& !contains(github.event.pull_request.body, '[skip community_build]')
166+
)"
146167

147168
steps:
148169
- name: Checkout cleanup script
@@ -166,16 +187,21 @@ jobs:
166187
test_sbt:
167188
runs-on: [self-hosted, Linux]
168189
container:
169-
image: lampepfl/dotty:2020-09-08
190+
image: lampepfl/dotty:2020-11-19
170191
volumes:
171192
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
172193
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
173194
- ${{ github.workspace }}/../../cache/general:/root/.cache
174-
if: (
175-
github.event_name == 'push' &&
176-
startsWith(github.event.ref, 'refs/tags/')
177-
) ||
178-
github.event_name == 'schedule'
195+
if: "github.event_name == 'schedule'
196+
|| (
197+
github.event_name == 'push'
198+
&& startsWith(github.event.ref, 'refs/tags/')
199+
)
200+
|| (
201+
github.event_name == 'pull_request'
202+
&& !contains(github.event.pull_request.body, '[skip ci]')
203+
&& contains(github.event.pull_request.body, '[test_sbt]')
204+
)"
179205

180206
steps:
181207
- name: Checkout cleanup script
@@ -196,18 +222,23 @@ jobs:
196222
test_java8:
197223
runs-on: [self-hosted, Linux]
198224
container:
199-
image: lampepfl/dotty:2020-09-08
225+
image: lampepfl/dotty:2020-11-19
200226
volumes:
201227
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
202228
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
203229
- ${{ github.workspace }}/../../cache/general:/root/.cache
204230

205-
if: "(
206-
github.event_name == 'push' &&
207-
startsWith(github.event.ref, 'refs/tags/') &&
208-
!startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
209-
) ||
210-
github.event_name == 'schedule'"
231+
if: "github.event_name == 'schedule'
232+
|| (
233+
github.event_name == 'push'
234+
&& startsWith(github.event.ref, 'refs/tags/')
235+
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
236+
)
237+
|| (
238+
github.event_name == 'pull_request'
239+
&& !contains(github.event.pull_request.body, '[skip ci]')
240+
&& contains(github.event.pull_request.body, '[test_java8]')
241+
)"
211242

212243
steps:
213244
- name: Set JDK 8 as default
@@ -226,18 +257,20 @@ jobs:
226257
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true
227258

228259
- name: Test
229-
run: ./project/scripts/sbt ";compile ;test"
260+
run: |
261+
./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-dotty/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test"
262+
./project/scripts/bootstrapCmdTests
230263
231264
publish_nightly:
232265
runs-on: [self-hosted, Linux]
233266
container:
234-
image: lampepfl/dotty:2020-09-08
267+
image: lampepfl/dotty:2020-11-19
235268
volumes:
236269
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
237270
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
238271
- ${{ github.workspace }}/../../cache/general:/root/.cache
239-
needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_java8]
240-
if: github.event_name == 'schedule'
272+
needs: [test_non_bootstrapped, test, community_build_a, community_build_b, test_sbt, test_java8]
273+
if: "github.event_name == 'schedule'"
241274
env:
242275
NIGHTLYBUILD: yes
243276
PGP_PW: ${{ secrets.PGP_PW }} # PGP passphrase
@@ -265,13 +298,13 @@ jobs:
265298
nightly_documentation:
266299
runs-on: [self-hosted, Linux]
267300
container:
268-
image: lampepfl/dotty:2020-09-08
301+
image: lampepfl/dotty:2020-11-19
269302
volumes:
270303
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
271304
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
272305
- ${{ github.workspace }}/../../cache/general:/root/.cache
273306
needs: [publish_nightly]
274-
if: github.event_name == 'schedule'
307+
if: "github.event_name == 'schedule'"
275308
env:
276309
NIGHTLYBUILD: yes
277310
BOT_TOKEN: ${{ secrets.BOT_TOKEN }} # If you need to change this:
@@ -306,15 +339,15 @@ jobs:
306339
publish_release:
307340
runs-on: [self-hosted, Linux]
308341
container:
309-
image: lampepfl/dotty:2020-09-08
342+
image: lampepfl/dotty:2020-11-19
310343
volumes:
311344
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
312345
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
313346
- ${{ github.workspace }}/../../cache/general:/root/.cache
314-
needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_java8]
315-
if: github.event_name == 'push' &&
316-
startsWith(github.event.ref, 'refs/tags/') &&
317-
!startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
347+
needs: [test_non_bootstrapped, test, community_build_a, community_build_b, test_sbt, test_java8]
348+
if: "github.event_name == 'push'
349+
&& startsWith(github.event.ref, 'refs/tags/')
350+
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')"
318351

319352
env:
320353
RELEASEBUILD: yes
@@ -388,15 +421,15 @@ jobs:
388421
release_documentation:
389422
runs-on: [self-hosted, Linux]
390423
container:
391-
image: lampepfl/dotty:2020-09-08
424+
image: lampepfl/dotty:2020-11-19
392425
volumes:
393426
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
394427
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
395428
- ${{ github.workspace }}/../../cache/general:/root/.cache
396429
needs: [publish_release]
397-
if: github.event_name == 'push' &&
398-
startsWith(github.event.ref, 'refs/tags/') &&
399-
!startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
430+
if: "github.event_name == 'push'
431+
&& startsWith(github.event.ref, 'refs/tags/')
432+
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')"
400433

401434
env:
402435
RELEASEBUILD: yes
@@ -432,14 +465,14 @@ jobs:
432465
publish_sbt_release:
433466
runs-on: [self-hosted, Linux]
434467
container:
435-
image: lampepfl/dotty:2020-09-08
468+
image: lampepfl/dotty:2020-11-19
436469
volumes:
437470
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
438471
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
439472
- ${{ github.workspace }}/../../cache/general:/root/.cache
440473
needs: [community_build_a, community_build_b, test_sbt]
441-
if: github.event_name == 'push' &&
442-
startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
474+
if: "github.event_name == 'push'
475+
&& startsWith(github.event.ref, 'refs/tags/sbt-dotty-')"
443476

444477
env:
445478
RELEASEBUILD: yes

community-build/src/scala/dotty/communitybuild/projects.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ object projects:
297297

298298
lazy val scalaParserCombinators = SbtCommunityProject(
299299
project = "scala-parser-combinators",
300-
sbtTestCommand = "parserCombinators/test",
300+
sbtTestCommand = "parserCombinatorsJVM/test",
301301
)
302302

303303
lazy val dottyCpsAsync = SbtCommunityProject(

compiler/src/dotty/tools/dotc/core/NameOps.scala

+8-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package dotty.tools.dotc
22
package core
33

44
import java.security.MessageDigest
5+
import java.nio.CharBuffer
56
import scala.io.Codec
67
import Int.MaxValue
78
import Names._, StdNames._, Contexts._, Symbols._, Flags._, NameKinds._, Types._
@@ -32,17 +33,18 @@ object NameOps {
3233
def apply(s: String): String = {
3334
val marker = "$$$$"
3435

35-
val MaxNameLength = (CLASSFILE_NAME_CHAR_LIMIT - 6) min
36+
val MaxNameLength = (CLASSFILE_NAME_CHAR_LIMIT - 6).min(
3637
2 * (CLASSFILE_NAME_CHAR_LIMIT - 6 - 2 * marker.length - 32)
38+
)
3739

3840
def toMD5(s: String, edge: Int): String = {
39-
val prefix = s take edge
40-
val suffix = s takeRight edge
41+
val prefix = s.take(edge)
42+
val suffix = s.takeRight(edge)
4143

4244
val cs = s.toArray
43-
val bytes = Codec toUTF8 cs
44-
md5 update bytes
45-
val md5chars = (md5.digest() map (b => (b & 0xFF).toHexString)).mkString
45+
val bytes = Codec.toUTF8(CharBuffer.wrap(cs))
46+
md5.update(bytes)
47+
val md5chars = md5.digest().map(b => (b & 0xFF).toHexString).mkString
4648

4749
prefix + marker + md5chars + marker + suffix
4850
}

compiler/src/dotty/tools/dotc/typer/Applications.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ trait Applications extends Compatibility {
724724

725725
def makeVarArg(n: Int, elemFormal: Type): Unit = {
726726
val args = typedArgBuf.takeRight(n).toList
727-
typedArgBuf.trimEnd(n)
727+
typedArgBuf.dropRightInPlace(n)
728728
val elemtpt = TypeTree(elemFormal)
729729
typedArgBuf += seqToRepeated(SeqLiteral(args, elemtpt))
730730
}

project/Build.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ object Build {
7272
* scala-library.
7373
*/
7474
def stdlibVersion(implicit mode: Mode): String = mode match {
75-
case NonBootstrapped => "2.13.3"
76-
case Bootstrapped => "2.13.3"
75+
case NonBootstrapped => "2.13.4"
76+
case Bootstrapped => "2.13.4"
7777
}
7878

7979
val dottyOrganization = "org.scala-lang"

sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
val scala3Version = sys.props("plugin.scalaVersion")
2-
val scala2Version = "2.13.3"
2+
val scala2Version = "2.13.4"
33

44
lazy val `i8847-lib` = (project in file ("lib"))
55
.settings(scalaVersion := scala2Version)

sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
val scala3Version = sys.props("plugin.scalaVersion")
2-
val scala2Version = "2.13.3"
2+
val scala2Version = "2.13.4"
33

44
lazy val `i9916a-lib` = (project in file ("lib"))
55
.settings(scalaVersion := scala2Version)

sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
val scala3Version = sys.props("plugin.scalaVersion")
2-
val scala2Version = "2.13.3"
2+
val scala2Version = "2.13.4"
33

44
lazy val `i9916b-lib` = (project in file ("lib"))
55
.settings(scalaVersion := scala2Version)

0 commit comments

Comments
 (0)