Skip to content

Commit d53ff1e

Browse files
committed
Fix windows CI; conditionally enable forward compat community build in PRs
1 parent 300a8b6 commit d53ff1e

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,12 @@ jobs:
327327
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
328328
- ${{ github.workspace }}/../../cache/general:/root/.cache
329329
if: "github.event_name == 'schedule' && github.repository == 'lampepfl/dotty'
330+
|| (
331+
github.event_name == 'pull_request'
332+
&& !contains(github.event.pull_request.body, '[skip ci]')
333+
&& !contains(github.event.pull_request.body, '[skip community_build]')
334+
&& contains(github.event.pull_request.body, '[test_forward_compat]')
335+
)
330336
|| (
331337
github.event_name == 'workflow_dispatch'
332338
&& github.repository == 'lampepfl/dotty'

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -520,11 +520,12 @@ trait ParallelTesting extends RunnerOrchestration { self =>
520520
}
521521

522522
protected def compileWithOtherCompiler(compiler: String, files: Array[JFile], flags: TestFlags, targetDir: JFile): TestReporter =
523-
val compilerDir = getCompiler(compiler).toString
524-
523+
val compilerDir = getCompiler(compiler)
524+
525525
def substituteClasspath(old: String): String =
526526
old.split(JFile.pathSeparator).map { o =>
527-
if JFile(o) == JFile(Properties.dottyLibrary) then s"$compilerDir/lib/scala3-library_3-$compiler.jar"
527+
if JFile(o) == JFile(Properties.dottyLibrary) then
528+
compilerDir.resolve("lib").resolve(s"scala3-library_3-$compiler.jar").toString
528529
else o
529530
}.mkString(JFile.pathSeparator)
530531

@@ -535,7 +536,8 @@ trait ParallelTesting extends RunnerOrchestration { self =>
535536
val dummyStream = new PrintStream(new ByteArrayOutputStream())
536537
val reporter = TestReporter.reporter(dummyStream, ERROR)
537538

538-
val command = Array(compilerDir + "/bin/scalac") ++ flags1.all ++ files.map(_.getPath)
539+
val scalacPath = compilerDir.resolve("bin").resolve("scalac").toString
540+
val command = Array(scalacPath) ++ flags1.all ++ files.map(_.getPath)
539541
val process = Runtime.getRuntime.exec(command)
540542
val errorsText = Source.fromInputStream(process.getErrorStream).mkString
541543
if process.waitFor() != 0 then
@@ -1419,10 +1421,10 @@ object ParallelTesting {
14191421
def isTastyFile(f: JFile): Boolean =
14201422
f.getName.endsWith(".tasty")
14211423

1422-
def getCompiler(version: String): JFile =
1423-
val dir = cache.resolve(s"scala3-${version}").toFile
1424+
def getCompiler(version: String): Path =
1425+
val dir = cache.resolve(s"scala3-${version}")
14241426
synchronized {
1425-
if dir.exists then
1427+
if dir.toFile.exists then
14261428
dir
14271429
else
14281430
import scala.sys.process._

0 commit comments

Comments
 (0)