Implement an ijar equivalent for Scala 3 #1679
Open
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.
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.