From 6d940c29f61d629b70ec2a7a0dfccb248ac3ab36 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Fri, 9 Feb 2024 12:20:25 +0100 Subject: [PATCH 1/3] [scripts/bisect] Propagte JVM version of scala-cli runner to sbt and validation scripts --- project/scripts/bisect.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project/scripts/bisect.scala b/project/scripts/bisect.scala index e97fbb3fafd7..d195d497fcc1 100755 --- a/project/scripts/bisect.scala +++ b/project/scripts/bisect.scala @@ -124,6 +124,7 @@ object ValidationScript: def tmpScalaCliScript(command: String, args: Seq[String]): File = tmpScript(s""" |#!/usr/bin/env bash + |export JAVA_HOME=${sys.props("java.home")} |scala-cli ${command} -S "$$1" --server=false ${args.mkString(" ")} |""".stripMargin ) @@ -242,6 +243,7 @@ class CommitBisect(validationScript: File, shouldFail: Boolean, bootstrapped: Bo val bisectRunScript = raw""" |scalaVersion=$$(sbt "print ${scala3CompilerProject}/version" | tail -n1) |rm -rf out + |export JAVA_HOME=${sys.props("java.home")} |sbt "clean; set every doc := new File(\"unused\"); set scaladoc/Compile/resourceGenerators := (\`${scala3Project}\`/Compile/resourceGenerators).value; ${scala3Project}/publishLocal" |${validationCommandStatusModifier}${validationScript.getAbsolutePath} "$$scalaVersion" """.stripMargin From 2548779f6607ed1047835fa97d16a77c3653daff Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Fri, 9 Feb 2024 12:21:09 +0100 Subject: [PATCH 2/3] [scripts/bisect] Skip bisecting commits for which compiler cannot be build --- project/scripts/bisect.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/project/scripts/bisect.scala b/project/scripts/bisect.scala index d195d497fcc1..5892b8164099 100755 --- a/project/scripts/bisect.scala +++ b/project/scripts/bisect.scala @@ -244,8 +244,9 @@ class CommitBisect(validationScript: File, shouldFail: Boolean, bootstrapped: Bo |scalaVersion=$$(sbt "print ${scala3CompilerProject}/version" | tail -n1) |rm -rf out |export JAVA_HOME=${sys.props("java.home")} - |sbt "clean; set every doc := new File(\"unused\"); set scaladoc/Compile/resourceGenerators := (\`${scala3Project}\`/Compile/resourceGenerators).value; ${scala3Project}/publishLocal" - |${validationCommandStatusModifier}${validationScript.getAbsolutePath} "$$scalaVersion" + |(sbt "clean; set every doc := new File(\"unused\"); set scaladoc/Compile/resourceGenerators := (\`${scala3Project}\`/Compile/resourceGenerators).value; ${scala3Project}/publishLocal" \ + | || (echo "Failed to build compiler, skip $$scalaVersion"; git bisect skip) \ + |) && ${validationCommandStatusModifier}${validationScript.getAbsolutePath} "$$scalaVersion" """.stripMargin "git bisect start".! s"git bisect bad $fistBadHash".! From 37e0b074f9f2baaaae37c51a7361cf9c576ee505 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Fri, 9 Feb 2024 12:25:45 +0100 Subject: [PATCH 3/3] [script/bisect] Use JVM 17 by default in bisect script --- project/scripts/bisect.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/project/scripts/bisect.scala b/project/scripts/bisect.scala index 5892b8164099..c429fe06f81b 100755 --- a/project/scripts/bisect.scala +++ b/project/scripts/bisect.scala @@ -1,3 +1,4 @@ +//> using jvm 17 // Maximal JDK version which can be used with all Scala 3 versions, can be overriden via command line arguments '--jvm=21' /* This script will bisect a problem with the compiler based on success/failure of the validation script passed as an argument. It starts with a fast bisection on released nightly builds.