Skip to content

Commit

Permalink
Upgrade to Scala 2.13.4, switch CI to JDK 15
Browse files Browse the repository at this point in the history
2.13.4 brings JDK 15 support with scala/scala#9292
  • Loading branch information
smarter committed Nov 19, 2020
1 parent dfe6f3e commit eedd602
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 27 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/ci.yaml
Expand Up @@ -13,7 +13,7 @@ jobs:
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
Expand All @@ -22,8 +22,8 @@ jobs:
startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))"

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 @@ -45,7 +45,7 @@ jobs:
test_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
Expand All @@ -54,8 +54,8 @@ jobs:
startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))"

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 Down Expand Up @@ -110,7 +110,7 @@ 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
Expand Down Expand Up @@ -138,7 +138,7 @@ 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
Expand Down Expand Up @@ -166,7 +166,7 @@ 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
Expand Down Expand Up @@ -196,7 +196,7 @@ 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
Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
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
Expand Down Expand Up @@ -265,7 +265,7 @@ 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
Expand Down Expand Up @@ -306,7 +306,7 @@ 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
Expand Down Expand Up @@ -388,7 +388,7 @@ 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
Expand Down Expand Up @@ -432,7 +432,7 @@ 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
Expand Down
14 changes: 8 additions & 6 deletions compiler/src/dotty/tools/dotc/core/NameOps.scala
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
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
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
@@ -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
@@ -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
@@ -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

0 comments on commit eedd602

Please sign in to comment.