Skip to content

Conversation

scoquelin
Copy link
Contributor

@scoquelin scoquelin commented Sep 29, 2023

Description

Bringing Scala 2.13.12 support by fixing reporters while maintaining backward compatibility with other Scala versions

Requires #1515 and #1518

Motivation

Closes #1514

@scoquelin scoquelin force-pushed the upgrade-scala-2.13.12 branch 2 times, most recently from 539f039 to a07c0e8 Compare September 29, 2023 22:58
@liucijus
Copy link
Collaborator

liucijus commented Oct 2, 2023

@scoquelin please rebase/resolve conflicts

@scoquelin scoquelin force-pushed the upgrade-scala-2.13.12 branch 6 times, most recently from b3ba33f to e59fb0e Compare October 3, 2023 04:52
}

@Override
public void doReport(Position pos, String msg, Severity severity, scala.collection.immutable.List<CodeAction> actions) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TLDR; After doing some troubleshooting, found out that the workaround was to override doReport instead of info0 as mentioned here.

Long version : figured out that the usedJars were not populated properly in DepsTrackingReporter since the overridden info0 method (responsible for building the list of used jars) didn't seem to be called, and that led to issues computing the actual list of unused dependencies reason why the build was failing, wrongly reporting unused dependencies whereas they were actually used.

Turns out that the compiler patch that calls inform which in turns calls echo now invokes doReport... so to get input about the used jars from the compiler source doReport now needs to be overridden starting from Scala 2.13.12...

@scoquelin
Copy link
Contributor Author

scoquelin commented Oct 3, 2023

@scoquelin please rebase/resolve conflicts

Will rebase again when #1518 will be merged but unused dependencies issue is now fixed 🥳

@scoquelin scoquelin force-pushed the upgrade-scala-2.13.12 branch from e59fb0e to 628c936 Compare October 3, 2023 15:17
@scoquelin
Copy link
Contributor Author

scoquelin commented Oct 4, 2023

@liucijus @simuons rebased and tested this version to build a Scala 2.13.12 codebase ✔️

Will appreciate some review/feedback thanks!

Copy link
Collaborator

@liucijus liucijus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @scoquelin!

@simuons simuons merged commit 6dd98a1 into bazel-contrib:master Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Scala 2.13.12] Issue with scala.tools.nsc.reporters.Reporter when compiling
3 participants