wvlet / airframe

Essential Building Blocks for Scala
https://wvlet.org/airframe
Apache License 2.0
632 stars 66 forks source link

Surface: includes huge dotty/tools dependency to support Tasty #3462

Closed OndrejSpanel closed 7 months ago

OndrejSpanel commented 7 months ago

When I have used assembly to create a fat jar of my app, I was surprised to see the resulting JAR is much larger. Inspection has revealed this is caused by dotty / tools directory. The directory is present because of following dependencies:

def surfaceJVMDependencies(s: String) = Seq(
  "org.scala-lang" %% "scala3-tasty-inspector" % s,
  "org.scala-lang" %% "scala3-staging"         % s
)

I think those dependencies are there to support TastySurfaceFactory. I think this is quite exotic feature and it is not worth the ~40 MB dependency.

I suggest removing TastySurfaceFactory completely.

xerial commented 7 months ago

Agreed. These dependencies are used only to support runtime surface generation using the staged-compiler in RuntimeSurfaceFactory, but this approach didn't work as expected and caused many runtime issues such as #1698.

xerial commented 7 months ago

As the dependency spans across the entire codebase, I'll handle this