Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions project/scripts/bisect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,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(" ")}
|scala-cli --cli-version=1.9.0 ${command} -S "$$1" --server=false ${args.mkString(" ")}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hardcoding --cli-version=1.9.0 here will always enforce the JVM launcher... which is slightly slower than its native counterparts.
That being said, it does ensure the script will work for everyone. 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A potential improvement would be to check for the version of scala-cli being used

This command will print the launcher version, only

scala-cli version --cli-version

And then if it's <1.9.0, print a warning and default to the --cli-version override.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you deem it out of scope for this PR, feel free to leave it like this and raise the improvement as an issue.

|""".stripMargin
)

Expand Down Expand Up @@ -177,14 +177,20 @@ class Releases(val releases: Vector[Release])

object Releases:
lazy val allReleases: Vector[Release] =
val re = raw"<version>(.+-bin-\d{8}-\w{7}-NIGHTLY)</version>".r
val xml = io.Source.fromURL(
"https://repo.scala-lang.org/artifactory/maven-nightlies/org/scala-lang/scala3-compiler_3/maven-metadata.xml"
Seq(
// Until 3.8.0-RC1-bin-20250822-658c8bd-NIGHTLY
"https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/maven-metadata.xml",
// From 3.8.0-RC1-bin-20250818-aaa39c5-NIGHTLY
"https://repo.scala-lang.org/artifactory/maven-nightlies/org/scala-lang/scala3-compiler_3/maven-metadata.xml",
)
re.findAllMatchIn(xml.mkString)
.map(io.Source.fromURL(_).mkString)
.flatMap: metadataXML =>
raw"<version>(.+-bin-\d{8}-\w{7}-NIGHTLY)</version>".r
.findAllMatchIn(metadataXML)
.flatMap{ m => Option(m.group(1)).map(Release.apply) }
.toVector
.sortBy: release =>
.toVector
.distinctBy(_.version)
.sortBy: release =>
(release.version, release.date)

def fromRange(range: ReleasesRange): Vector[Release] = range.filter(allReleases)
Expand Down
Loading