-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Scala3 support #27
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments but I am pretty certain there is no reason to make any substantial changes to the Scala source of firtool-resolver (other than minor changes needed for cross-compilation).
object `firtool-resolver` extends Cross[FirtoolResolver]("2.13", "2.12") | ||
trait FirtoolResolver extends CrossScalaModule with ChipsAlliancePublishModule { root => | ||
object `firtool-resolver` extends Cross[FirtoolResolver]("2.13", "2.12", "3.4", "3.3") | ||
trait FirtoolResolver extends CrossSbtModule with ChipsAlliancePublishModule { root => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than switching this to SBT style, I would rather stick with vanilla Mill style. We only use SBT style in Chisel for historical reasons, we could just override millSourcePath
here. Fortunately, we don't even need to do that as I will explain below.
@@ -233,12 +233,14 @@ object `llvm-firtool` extends JavaModule with ChipsAlliancePublishModule { | |||
// ******************** WARNING ******************** | |||
// This is extremely manual and changing dependencies IN ANY WAY (including bumping version) | |||
// requires carefully checking the packages to shade and dynamic ivy deps in the outer project | |||
object `firtool-resolver` extends Cross[FirtoolResolver]("2.13", "2.12") | |||
trait FirtoolResolver extends CrossScalaModule with ChipsAlliancePublishModule { root => | |||
object `firtool-resolver` extends Cross[FirtoolResolver]("2.13", "2.12", "3.4", "3.3") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
object `firtool-resolver` extends Cross[FirtoolResolver]("2.13", "2.12", "3.4", "3.3") | |
object `firtool-resolver` extends Cross[FirtoolResolver]("2.13", "2.12", "3") |
"3.4" -> "3.4.2", | ||
"3.3" -> "3.3.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"3.4" -> "3.4.2", | |
"3.3" -> "3.3.3" | |
"3" -> "3.3.3" |
Scala 3 maintains binary compatibility across all minor versions so there is no reason to cross compile for any version but 1 in Scala 3 (unlike Scala 2 where it you do have to compile differently for 2.12 and 2.13.
@@ -281,8 +283,7 @@ trait FirtoolResolver extends CrossScalaModule with ChipsAlliancePublishModule { | |||
ivy"org.scala-lang.modules::scala-collection-compat:2.11.0" | |||
) | |||
|
|||
object core extends ScalaModule { | |||
|
|||
object core extends CrossSbtModule with CrossValue { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
object core extends CrossSbtModule with CrossValue { | |
object core extends ScalaModule with CrossValue { |
|
||
object FetchArtifact { | ||
def apply(logger: Logger, defaultVersion: String): Either[String, FirtoolBinary] = { | ||
Left("Firtool not found on system: building firtool is not supported in Scala 3") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not right. llvm-firtool
(the Maven project published by this repo that is just a repackaging of pre-build firtool binaries as Java published artifacts) is a Java project--it has no dependency on the Scala version.
Only firtool-resolver
needs to be cross-compiled and I am fairly certainly all of this source code can cross compile (or can easily be made to cross-compile).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way to get it without coursier? my cursory search indicated that coursier does not provide a scala3 artifact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use the Scala 2.13 artifact from Scala 3: https://mill-build.org/mill/fundamentals/library-deps.html#_using_scala_2_13_from_scala_3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nice, trying..
Also please add Scala 3 to CI |
The problem here is caused by the dependency on ivy |
No description provided.