Skip to content

Restore Global.reporter()Reporter#9297

Merged
dwijnand merged 1 commit intoscala:2.12.xfrom
dwijnand:2.12/restore-Global.reporter-Reporter
Nov 2, 2020
Merged

Restore Global.reporter()Reporter#9297
dwijnand merged 1 commit intoscala:2.12.xfrom
dwijnand:2.12/restore-Global.reporter-Reporter

Conversation

@dwijnand
Copy link
Member

@dwijnand dwijnand commented Nov 2, 2020

It's an important binary API:

[scala-rewrites] [error] java.lang.NoSuchMethodError: scala.tools.nsc.Global.reporter()Lscala/tools/nsc/reporters/Reporter;
[scala-rewrites] [error] 	at scala.meta.internal.semanticdb.scalac.SemanticdbPlugin.init(SemanticdbPlugin.scala:25)
[scala-rewrites] [error] 	at scala.tools.nsc.plugins.Plugins.$anonfun$loadPlugins$9(Plugins.scala:162)

It's an important binary API:

    [scala-rewrites] [error] java.lang.NoSuchMethodError: scala.tools.nsc.Global.reporter()Lscala/tools/nsc/reporters/Reporter;
    [scala-rewrites] [error] 	at scala.meta.internal.semanticdb.scalac.SemanticdbPlugin.init(SemanticdbPlugin.scala:25)
    [scala-rewrites] [error] 	at scala.tools.nsc.plugins.Plugins.$anonfun$loadPlugins$9(Plugins.scala:162)
@scala-jenkins scala-jenkins added this to the 2.12.14 milestone Nov 2, 2020
@dwijnand dwijnand modified the milestones: 2.12.14, 2.12.13 Nov 2, 2020
@dwijnand dwijnand merged commit 42f2bd8 into scala:2.12.x Nov 2, 2020
@dwijnand dwijnand deleted the 2.12/restore-Global.reporter-Reporter branch November 2, 2020 12:38
@SethTisue SethTisue added the internal not resulting in user-visible changes (build changes, tests, internal cleanups) label Nov 3, 2020
@SethTisue
Copy link
Member

labeling with "internal" since the removal was never released

@dwijnand
Copy link
Member Author

dwijnand commented Nov 3, 2020

To answer my own question "how did we get away with breaking this in 2.13?", the answer is "because there are no binary guarantees for scala-compiler" and I'm defiantly overriding that in scala-rewrites: https://github.com/scala/scala-rewrites/blob/aa3f71bfc16c342f14566db0a730a0516acafc7e/project/ScalaNightlyPlugin.scala#L26.

In the community build both scala-compiler and scala-rewrites are compiled so if they compile together, why is it throwing a NoSuchMethodError? I think the cause is what this warning message is getting at:

[scala-rewrites] [warn] **** Missing dependency: the library org.scalameta#semanticdb-scalac is not provided (in space "scala.scala_rewrites") by any project in this configuration file.
[scala-rewrites] [warn] The library (and possibly some of its dependencies) will be retrieved from the external repositories.
[scala-rewrites] [warn] In order to control which version is used, you may want to add this dependency to the dbuild configuration file.

Which is actually also documented at the top of the CB's proj/scala-rewrites.conf:

// This project is unusual in that we build it using only binary
// dependencies, since the community build's scalafix version is too
// old and we can't upgrade it because it has too many dependencies.
// (And scala-rewrites is 2.12-only because it lives in
// sbt-plugin-land.)

// This is trickier-than-normal because semanticdb-scalac and
// scalafix-testkit are CrossVersion.full, so we have to override that
// to use older binaries, since binaries don't exist for Scala nightlies.
//
// (If those older binaries don't work, then we'll have to do
// something else, but in a way that's good because we can notify Olaf
// upstream that we changed something in Scala that's going to require
// changes to Scalafix.)

TL;DR this change wasn't as necessary as I'd thought.

@dwijnand
Copy link
Member Author

dwijnand commented Nov 4, 2020

Undoing this: #9300.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal not resulting in user-visible changes (build changes, tests, internal cleanups)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants