-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Fix #1103: Scala 3 support for Scala.js #1187
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why's that change?
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.
I want it to be
scala3-library_sjs1_3.0.0-RC1
on Scala.jsThere 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.
Yeah, that was obvious. Sorry for the poor question. I was wondering, why that works at all, as this method is also used outside of a Scala.js context. I would expect it to fail when compiling a simple scala project. Also this should affect Scala Native modules. My initial though was, that a Scala.js specific runtime/ compiler classpath should be applied to the
ScalaJsModule
, not theScalaModule
. You see me confused.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.
platformSuffix
works on any platform. It works correctly on ScalaModule becauseplatformSuffix = ""
.The main difference between Scala 2 and Scala 3 on Scala JS is that the Scala.js backend is not implemented as a compiler plugin but inside the Scala 3 compiler. So if Scala 2 removes the
scala-library
and replaces it with itsscalajs-library
(as you can see there is nosuper.scalacPluginIvyDeps() ++
in the Scala2 part ofscalacPluginIvyDeps
, which means that we don't want the scala-library from Scala but we'll use the Scala.js one instead), the Scala 3 compiler emits differentscala3-library
artifacts for every backend.Regarding Scala Native, I expect that when it will be supported, its support will be done in a similar fashion as the Scala.js one, so there will be a
scala3-library_native0.x_3...
artifact that theScalaNativeModule
will automatically use.I apologise in advance with the Scala.js team if I said something not completely precise.
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.
Thank you for that explanation. And sorry for not knowing that specific part of the Mill API better. The platform suffix handling still feels a bit odd, but that is another discussion. PR looks good to me!
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.
Nothing to be sorry of! Thank you for the review and the merge 🙏😃
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.
Ok, I wasn't that wrong with my suspicion. This assumes we only build with plain Scala Module or one of the built-in platform versions
ScalaJSModule
or ScalaNativeModule. But the platform concept is more general and if one module sets it to be unequal
""`, this implementation will fail. Instead, we should revert that specific line and implement it more specifically in the both modules that need it.E.g. imagine, someone tries to build a Mill plugin with Scala 3 (which is currently not supported), the you would run into the following issue:
Example adapted from https://matrix.to/#/!zXvttAKLPnvdnmiYsY:matrix.am/$FU_LdtZ6RFNOtmpbIlCGGzlkzWAV0NPUaF2BE7F2sqI?via=matrix.am&via=gitter.im&via=matrix.org
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.
I opened PR #2739