1
1
// Usage
2
- // > scala-cli project/scripts/dottyCompileBisect.scala -- File .scala
2
+ // > scala-cli project/scripts/dottyCompileBisect.scala -- File1.scala File2 .scala
3
3
//
4
4
// This script will bisect the compilation failure starting with a fast bisection on released nightly builds.
5
5
// Then it will bisect the commits between the last nightly that worked and the first nightly that failed.
@@ -9,19 +9,19 @@ import sys.process._
9
9
import scala .io .Source
10
10
import Releases .Release
11
11
12
- @ main def dottyCompileBisect (file : String ): Unit =
13
- val releaseBisect = ReleaseBisect (file )
12
+ @ main def dottyCompileBisect (files : String * ): Unit =
13
+ val releaseBisect = ReleaseBisect (files.toList )
14
14
val fistBadRelease = releaseBisect.bisect(Releases .allReleases)
15
15
println(" \n Finished bisecting releases\n " )
16
16
fistBadRelease.previous match
17
17
case Some (lastGoodRelease) =>
18
18
println(s " Last good release: $lastGoodRelease\n First bad release: $fistBadRelease\n " )
19
- val commitBisect = CommitBisect (file )
19
+ val commitBisect = CommitBisect (files.toList )
20
20
commitBisect.bisect(lastGoodRelease.hash, fistBadRelease.hash)
21
21
case None =>
22
22
println(s " No good release found " )
23
23
24
- class ReleaseBisect (file : String ):
24
+ class ReleaseBisect (files : List [ String ] ):
25
25
26
26
def bisect (releases : Vector [Release ]): Release =
27
27
assert(releases.length > 1 , " Need at least 2 releases to bisect" )
@@ -35,7 +35,7 @@ class ReleaseBisect(file: String):
35
35
36
36
private def isGoodRelease (release : Release ): Boolean =
37
37
println(s " Testing ${release.version}" )
38
- val res = s """ scala-cli compile $file -S " ${release.version}" """ .!
38
+ val res = s """ scala-cli compile ${files.mkString( " " )} -S " ${release.version}" """ .!
39
39
val isGood = res == 0
40
40
println(s " Test result: ${release.version} is a ${if isGood then " good" else " bad" } release \n " )
41
41
isGood
@@ -64,10 +64,10 @@ object Releases:
64
64
65
65
override def toString : String = version
66
66
67
- class CommitBisect (file : String ):
67
+ class CommitBisect (files : List [ String ] ):
68
68
def bisect (lastGoodHash : String , fistBadHash : String ): Unit =
69
69
println(s " Starting bisecting commits $lastGoodHash.. $fistBadHash\n " )
70
70
" git bisect start" .!
71
71
s " git bisect bad $fistBadHash" .!
72
72
s " git bisect good $lastGoodHash" .!
73
- s " git bisect run sh project/scripts/dottyCompileBisect.sh $file " .!
73
+ s " git bisect run sh project/scripts/dottyCompileBisect.sh ${files.mkString( " " )} " .!
0 commit comments