Skip to content

Conversation

@liucijus
Copy link
Collaborator

This adds minimal support for Scala 3:

  • Allow to compile Scala 3 code
  • Testing should work with custom toolchains
  • Dependency Analyzer is an empty implementation which does not do any analysis

Also added a simple Scala 3 workspace example to validate the changes, while the rest of Rules Scala tests are not fixed to work with Scala 3.

Issue #1269

Thanks @cocreature for the initial work

@liucijus liucijus requested a review from simuons as a code owner February 14, 2022 07:28
"io_bazel_rules_scala_scala_interfaces",
"io_bazel_rules_scala_scala_tasty_core",
"io_bazel_rules_scala_scala_asm",
# "io_bazel_rules_scala_scala_reflect",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this commented line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

@liucijus liucijus merged commit ca2ed27 into bazel-contrib:master Feb 14, 2022
@liucijus liucijus deleted the scala3-minimal-support branch February 14, 2022 08:51
@johnynek
Copy link
Contributor

johnynek commented Mar 2, 2022

one thing that isn't clear to me is how this interacts with ijar. I don't know the role of tasty in scala 3. I think we should document how this is working.

My fear is that we are making ijars, but actually scala 3 is reading tasty files and not actually using the ijar anyway, so we are only complicating matters and hurting things. But this could be wrong.

What I think we want ideally, is for tasty to support the idea of compilation interfaces, and have a scala specific way to do something like itasty but I don't grok how tasty is working now, so this could be off base.

@liucijus
Copy link
Collaborator Author

liucijus commented Mar 3, 2022

ijar should keep tasty files (bazelbuild/bazel@1489f0f) - I haven't verified if this works though.

@johnynek
Copy link
Contributor

johnynek commented Mar 3, 2022

but if you retain the entire tasty file, doesn't that retain the entire AST? So, doesn't that kill the point of ijar for scala (i.e. any change to the implementation will still cause a downstream recompilation?)

And if any change causes a downstream recompilation, then you might as well use a transitive compilation classpath so you minimize confusing issues with symbols being missing.

@liucijus
Copy link
Collaborator Author

liucijus commented Mar 4, 2022

but if you retain the entire tasty file, doesn't that retain the entire AST? So, doesn't that kill the point of ijar for scala (i.e. any change to the implementation will still cause a downstream recompilation?)
And if any change causes a downstream recompilation, then you might as well use a transitive compilation classpath so you minimize confusing issues with symbols being missing.

That's correct. There's plenty of work to be done to get full support for Scala 3.

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.

3 participants