Skip to content
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

Upgrade to Scala 2.13.4, switch CI to JDK 15, tweak CI configuration #10392

Merged
merged 5 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
163 changes: 98 additions & 65 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,27 @@ env:
DOTTY_CI_RUN: true

jobs:
test:
test_non_bootstrapped:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2020-09-08
image: lampepfl/dotty:2020-11-19
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
if: "!(github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))"

if: "github.event_name == 'schedule'
|| (
github.event_name == 'push'
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
)
|| (
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& contains(github.event.pull_request.body, '[test_non_bootstrapped]')
)"
steps:
- name: Set JDK 14 as default
run: echo "/usr/lib/jvm/java-14-openjdk-amd64/bin" >> $GITHUB_PATH
- name: Set JDK 15 as default
run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH

- name: Checkout cleanup script
uses: actions/checkout@v2
Expand All @@ -42,20 +49,28 @@ jobs:
./project/scripts/sbt ";compile ;test"
./project/scripts/cmdTests

test_bootstrapped:
test:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2020-09-08
image: lampepfl/dotty:2020-11-19
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
if: "!(github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))"
if: "github.event_name == 'schedule'
|| (
github.event_name == 'push'
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
)
|| (
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& !contains(github.event.pull_request.body, '[skip test]')
)"

steps:
- name: Set JDK 14 as default
run: echo "/usr/lib/jvm/java-14-openjdk-amd64/bin" >> $GITHUB_PATH
- name: Set JDK 15 as default
run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH

- name: Checkout cleanup script
uses: actions/checkout@v2
Expand All @@ -74,26 +89,18 @@ jobs:
./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"
./project/scripts/bootstrapCmdTests

## Only run bootstrapped tests for Windows since that's a superset of the
## non-bootstrapped tests and bootstrapping issues should be caught by
## the non-bootstrapped Linux runner.
# test-windows:
# runs-on: [self-hosted, Windows]
# if: "!(github.event_name == 'push' &&
# startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))"

# steps:
# - name: Git Checkout
# uses: actions/checkout@v2

# - name: Test
# run: sbt ";compile ;test"
# shell: cmd

test_bootstrapped-windows:
test_windows:
runs-on: [self-hosted, Windows]
if: "!(github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))"
if: "github.event_name == 'schedule'
|| (
github.event_name == 'push'
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
)
|| (
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& !contains(github.event.pull_request.body, '[skip test_windows]')
)"

steps:
- name: Git Checkout
Expand All @@ -110,11 +117,18 @@ jobs:
community_build_a:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2020-09-08
image: lampepfl/dotty:2020-11-19
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
if: "github.event_name == 'schedule'
|| github.event_name == 'push'
|| (
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& !contains(github.event.pull_request.body, '[skip community_build]')
)"

steps:
- name: Checkout cleanup script
Expand All @@ -138,11 +152,18 @@ jobs:
community_build_b:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2020-09-08
image: lampepfl/dotty:2020-11-19
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
if: "github.event_name == 'schedule'
|| github.event_name == 'push'
|| (
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& !contains(github.event.pull_request.body, '[skip community_build]')
)"

steps:
- name: Checkout cleanup script
Expand All @@ -166,16 +187,21 @@ jobs:
test_sbt:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2020-09-08
image: lampepfl/dotty:2020-11-19
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
if: (
github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags/')
) ||
github.event_name == 'schedule'
if: "github.event_name == 'schedule'
|| (
github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')
)
|| (
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& contains(github.event.pull_request.body, '[test_sbt]')
)"

steps:
- name: Checkout cleanup script
Expand All @@ -196,18 +222,23 @@ jobs:
test_java8:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2020-09-08
image: lampepfl/dotty:2020-11-19
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache

if: "(
github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags/') &&
!startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
) ||
github.event_name == 'schedule'"
if: "github.event_name == 'schedule'
|| (
github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
)
|| (
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& contains(github.event.pull_request.body, '[test_java8]')
)"

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

- name: Test
run: ./project/scripts/sbt ";compile ;test"
run: |
./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"
./project/scripts/bootstrapCmdTests

publish_nightly:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2020-09-08
image: lampepfl/dotty:2020-11-19
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_java8]
if: github.event_name == 'schedule'
needs: [test_non_bootstrapped, test, community_build_a, community_build_b, test_sbt, test_java8]
if: "github.event_name == 'schedule'"
env:
NIGHTLYBUILD: yes
PGP_PW: ${{ secrets.PGP_PW }} # PGP passphrase
Expand Down Expand Up @@ -265,13 +298,13 @@ jobs:
nightly_documentation:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2020-09-08
image: lampepfl/dotty:2020-11-19
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
needs: [publish_nightly]
if: github.event_name == 'schedule'
if: "github.event_name == 'schedule'"
env:
NIGHTLYBUILD: yes
BOT_TOKEN: ${{ secrets.BOT_TOKEN }} # If you need to change this:
Expand Down Expand Up @@ -306,15 +339,15 @@ jobs:
publish_release:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2020-09-08
image: lampepfl/dotty:2020-11-19
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_java8]
if: github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags/') &&
!startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
needs: [test_non_bootstrapped, test, community_build_a, community_build_b, test_sbt, test_java8]
if: "github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')"

env:
RELEASEBUILD: yes
Expand Down Expand Up @@ -388,15 +421,15 @@ jobs:
release_documentation:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2020-09-08
image: lampepfl/dotty:2020-11-19
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
needs: [publish_release]
if: github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags/') &&
!startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
if: "github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')"

env:
RELEASEBUILD: yes
Expand Down Expand Up @@ -432,14 +465,14 @@ jobs:
publish_sbt_release:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2020-09-08
image: lampepfl/dotty:2020-11-19
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
needs: [community_build_a, community_build_b, test_sbt]
if: github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
if: "github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/sbt-dotty-')"

env:
RELEASEBUILD: yes
Expand Down
Submodule scala-parser-combinators updated 34 files
+6 −9 .travis.yml
+6 −4 README.md
+57 −18 build.sbt
+8 −8 build.sh
+1 −1 docs/Getting_Started.md
+0 −3 jvm/src/main/scala/scala/util/parsing/input/PositionCache.scala
+1 −1 project/build.properties
+3 −3 project/plugins.sbt
+0 −4 shared/src/main/scala/scala/util/parsing/combinator/ImplicitConversions.scala
+0 −1 shared/src/main/scala/scala/util/parsing/combinator/JavaTokenParsers.scala
+3 −5 shared/src/main/scala/scala/util/parsing/combinator/PackratParsers.scala
+66 −35 shared/src/main/scala/scala/util/parsing/combinator/Parsers.scala
+3 −2 shared/src/main/scala/scala/util/parsing/combinator/RegexParsers.scala
+0 −2 shared/src/main/scala/scala/util/parsing/combinator/lexical/Lexical.scala
+0 −2 shared/src/main/scala/scala/util/parsing/combinator/lexical/Scanners.scala
+0 −5 shared/src/main/scala/scala/util/parsing/combinator/lexical/StdLexical.scala
+0 −2 shared/src/main/scala/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala
+0 −2 shared/src/main/scala/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala
+0 −3 shared/src/main/scala/scala/util/parsing/combinator/syntactical/TokenParsers.scala
+0 −3 shared/src/main/scala/scala/util/parsing/combinator/token/StdTokens.scala
+0 −3 shared/src/main/scala/scala/util/parsing/combinator/token/Tokens.scala
+2 −11 shared/src/main/scala/scala/util/parsing/input/CharArrayReader.scala
+0 −4 shared/src/main/scala/scala/util/parsing/input/CharSequenceReader.scala
+0 −3 shared/src/main/scala/scala/util/parsing/input/NoPosition.scala
+0 −2 shared/src/main/scala/scala/util/parsing/input/OffsetPosition.scala
+0 −1 shared/src/main/scala/scala/util/parsing/input/PagedSeq.scala
+1 −6 shared/src/main/scala/scala/util/parsing/input/PagedSeqReader.scala
+0 −3 shared/src/main/scala/scala/util/parsing/input/Position.scala
+0 −2 shared/src/main/scala/scala/util/parsing/input/Positional.scala
+0 −3 shared/src/main/scala/scala/util/parsing/input/Reader.scala
+0 −5 shared/src/main/scala/scala/util/parsing/input/StreamReader.scala
+4 −4 shared/src/test/scala/scala/util/parsing/combinator/JavaTokenParsersTest.scala
+67 −0 shared/src/test/scala/scala/util/parsing/combinator/RegexParsersTest.scala
+1 −1 shared/src/test/scala/scala/util/parsing/combinator/t7483.scala
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ object projects:

lazy val scalaParserCombinators = SbtCommunityProject(
project = "scala-parser-combinators",
sbtTestCommand = "parserCombinators/test",
sbtTestCommand = "parserCombinatorsJVM/test",
)

lazy val dottyCpsAsync = SbtCommunityProject(
Expand Down
14 changes: 8 additions & 6 deletions compiler/src/dotty/tools/dotc/core/NameOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dotty.tools.dotc
package core

import java.security.MessageDigest
import java.nio.CharBuffer
import scala.io.Codec
import Int.MaxValue
import Names._, StdNames._, Contexts._, Symbols._, Flags._, NameKinds._, Types._
Expand Down Expand Up @@ -32,17 +33,18 @@ object NameOps {
def apply(s: String): String = {
val marker = "$$$$"

val MaxNameLength = (CLASSFILE_NAME_CHAR_LIMIT - 6) min
val MaxNameLength = (CLASSFILE_NAME_CHAR_LIMIT - 6).min(
2 * (CLASSFILE_NAME_CHAR_LIMIT - 6 - 2 * marker.length - 32)
)

def toMD5(s: String, edge: Int): String = {
val prefix = s take edge
val suffix = s takeRight edge
val prefix = s.take(edge)
val suffix = s.takeRight(edge)

val cs = s.toArray
val bytes = Codec toUTF8 cs
md5 update bytes
val md5chars = (md5.digest() map (b => (b & 0xFF).toHexString)).mkString
val bytes = Codec.toUTF8(CharBuffer.wrap(cs))
md5.update(bytes)
val md5chars = md5.digest().map(b => (b & 0xFF).toHexString).mkString

prefix + marker + md5chars + marker + suffix
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ trait Applications extends Compatibility {

def makeVarArg(n: Int, elemFormal: Type): Unit = {
val args = typedArgBuf.takeRight(n).toList
typedArgBuf.trimEnd(n)
typedArgBuf.dropRightInPlace(n)
val elemtpt = TypeTree(elemFormal)
typedArgBuf += seqToRepeated(SeqLiteral(args, elemtpt))
}
Expand Down
4 changes: 2 additions & 2 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ object Build {
* scala-library.
*/
def stdlibVersion(implicit mode: Mode): String = mode match {
case NonBootstrapped => "2.13.3"
case Bootstrapped => "2.13.3"
case NonBootstrapped => "2.13.4"
case Bootstrapped => "2.13.4"
}

val dottyOrganization = "org.scala-lang"
Expand Down
2 changes: 1 addition & 1 deletion sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
val scala3Version = sys.props("plugin.scalaVersion")
val scala2Version = "2.13.3"
val scala2Version = "2.13.4"

lazy val `i8847-lib` = (project in file ("lib"))
.settings(scalaVersion := scala2Version)
Expand Down
2 changes: 1 addition & 1 deletion sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
val scala3Version = sys.props("plugin.scalaVersion")
val scala2Version = "2.13.3"
val scala2Version = "2.13.4"

lazy val `i9916a-lib` = (project in file ("lib"))
.settings(scalaVersion := scala2Version)
Expand Down
2 changes: 1 addition & 1 deletion sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
val scala3Version = sys.props("plugin.scalaVersion")
val scala2Version = "2.13.3"
val scala2Version = "2.13.4"

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