-
Notifications
You must be signed in to change notification settings - Fork 281
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
Implement an ijar equivalent for Scala 3 #1679
base: master
Are you sure you want to change the base?
Conversation
"com_softwaremill_common_tagging", | ||
"dev_zio_izumi_reflect", |
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.
Are these really needed? Yes, these alllow to define more typesafe TASTy format specification, but at the same time these are introducing additional dependencies. Probably it would be best to keep this list as small as possible.
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.
dev_zio_izumi_reflect
is needed during testing so we can get information about which TASTy nodes were read if dottyijar
fails. Without it, debugging failures becomes near-impossible. com_softwaremill_common_tagging
can probably be done without, since it's only used to differentiate SignedInt
and UnsignedInt
, and SignedLong
and UnsignedLong
at the type level. This isn't just for type safety—the compiler needs it so it can summon the appropriate TastyFormat
. I think I can replicate this with value classes.
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.
Done!
Hi, @jadenPete, thanks for PR. Looks like checks are failing due to strict deps. Could you resolve this? I hadn't had a chance to look at PR yet but I'll try to in upcoming days. |
Sure thing! I'll look into the test failures. |
Different versions of specs2 support different Scala versions, so it's necessary to use a different version, depending on which Scala version we're on. v4.10.6 is the last to support Scala 2.11, v4.20.9 is the last to support Scala 2, and the latest version as of the time this commit was written, v5.5.8, only supports Scala 3.
Currently, it just strips private `val`s and `def`s and definition values, but I plan on making it more aggresive in the future.
We'd like to minimize the number of required dependencies.
All the tests are now passing! I've squashed all of the |
Description
From my comment in #1657:
Given these changes in how symbols are read from the compile classpath in Scala 3 vs Scala 2, I don't think
ijar
is an appropriate solution for producing Scala 3 interface JARs. For that reason, I've developed "dottyijar", a version ofijar
that produces an interface JAR by removing all.class
files and performing a few modifications to.tasty
files:val
anddef
definitions that are private and not inlineval
anddef
definitions and class parent arguments with???
For context on the TASTy format, see
dotty.tools.tasty.TastyFormat
.Thus,
dottyijar
produces interface JARs that are far less sensitive to implementation changes than those produced byijar
. Although it's not as fast asijar
(mainly because it's written in Scala and doesn't read and write in a single pass), it's very fast—dottyijar
produced an interface JAR for the Scala 3 compiler, which contains 1,011 TASTy files, in 4.369 seconds on my machine, whereasijar
took 0.292 seconds.Motivation
I'm implementing this change to close #1657.