Skip to content
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

Justinass/dep analyzer #1370

Merged
merged 10 commits into from
Mar 22, 2022
Merged

Conversation

justinass-wix
Copy link
Contributor

@justinass-wix justinass-wix commented Mar 18, 2022

Description

Minimal implementation of compiler utils for Scala 3 Dependency Analyzer tests.

Motivation

Dependency Analyzer uses TestUtil to run compiler. For Scala 3 these utils have to be rewritten to work with new compiler.


  • Split analyzer_test.bzl to 2 files for scala 2 & 3 respectively
  • Passing scala-library and scala3-library_3paths via JVM flags to satisfy compiler (for scala 2 scala-library and scala-reflect are passed)

common_jvm_flags = [
"-Dplugin.jar.location=$(execpath //third_party/dependency_analyzer/src/main:dependency_analyzer)",
"-Dscala.library.location=$(rootpath @io_bazel_rules_scala_scala_library)",
"-Dscala.library2.location=$(rootpath @io_bazel_rules_scala_scala_library_2)",
Copy link
Member

Choose a reason for hiding this comment

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

can we add a comment why we need both standard libraries?

Copy link
Contributor Author

@justinass-wix justinass-wix Mar 21, 2022

Choose a reason for hiding this comment

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

I don't actually know why Scala 2 library is required, I tried various things until I got the code to compile... One hint was this line .

Without it compilation fails:
class dotty.tools.dotc.core.Symbols$NoSymbol$ cannot be cast to class dotty.tools.dotc.core.Symbols$ClassSymbol (dotty.tools.dotc.core.Symbols$NoSymbol$ and dotty.tools.dotc.core.Symbols$ClassSymbol are in unnamed module of loader 'app')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a comment.

@justinass-wix justinass-wix marked this pull request as ready for review March 21, 2022 10:16
@liucijus
Copy link
Collaborator

Thanks, @justinass-wix

@simuons simuons merged commit a2b971d into bazelbuild:master Mar 22, 2022
@justinass-wix justinass-wix deleted the justinass/dep-analyzer branch May 9, 2022 06:08
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.

4 participants