Skip to content

Commit 20ae563

Browse files
fix/scripts: Propagate runner JVM version and skip testing invalid compiler commits (#19656)
* Bisect script used JVM 17 by default, can be overriden using: `scala-cli run project/scripts/bisect.scala --jvm=21 -- <bisect args>` * Bisect runner JVM version is propagated to scala-cli verification script and sbt when building compiler * Skip testing commits for which compiler compilation fails
1 parent 447cdf4 commit 20ae563

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

project/scripts/bisect.scala

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//> using jvm 17 // Maximal JDK version which can be used with all Scala 3 versions, can be overriden via command line arguments '--jvm=21'
12
/*
23
This script will bisect a problem with the compiler based on success/failure of the validation script passed as an argument.
34
It starts with a fast bisection on released nightly builds.
@@ -124,6 +125,7 @@ object ValidationScript:
124125

125126
def tmpScalaCliScript(command: String, args: Seq[String]): File = tmpScript(s"""
126127
|#!/usr/bin/env bash
128+
|export JAVA_HOME=${sys.props("java.home")}
127129
|scala-cli ${command} -S "$$1" --server=false ${args.mkString(" ")}
128130
|""".stripMargin
129131
)
@@ -242,8 +244,10 @@ class CommitBisect(validationScript: File, shouldFail: Boolean, bootstrapped: Bo
242244
val bisectRunScript = raw"""
243245
|scalaVersion=$$(sbt "print ${scala3CompilerProject}/version" | tail -n1)
244246
|rm -rf out
245-
|sbt "clean; set every doc := new File(\"unused\"); set scaladoc/Compile/resourceGenerators := (\`${scala3Project}\`/Compile/resourceGenerators).value; ${scala3Project}/publishLocal"
246-
|${validationCommandStatusModifier}${validationScript.getAbsolutePath} "$$scalaVersion"
247+
|export JAVA_HOME=${sys.props("java.home")}
248+
|(sbt "clean; set every doc := new File(\"unused\"); set scaladoc/Compile/resourceGenerators := (\`${scala3Project}\`/Compile/resourceGenerators).value; ${scala3Project}/publishLocal" \
249+
| || (echo "Failed to build compiler, skip $$scalaVersion"; git bisect skip) \
250+
|) && ${validationCommandStatusModifier}${validationScript.getAbsolutePath} "$$scalaVersion"
247251
""".stripMargin
248252
"git bisect start".!
249253
s"git bisect bad $fistBadHash".!

0 commit comments

Comments
 (0)