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

Support Scala 2.13 #809

Closed
kerinin opened this issue Aug 10, 2019 · 10 comments
Closed

Support Scala 2.13 #809

kerinin opened this issue Aug 10, 2019 · 10 comments

Comments

@kerinin
Copy link

kerinin commented Aug 10, 2019

I tried monkey-patching scala_repositories:

scala_repositories(
  scala_version_shas = (
    "2.13.0",
    {
      "scala_compiler": "71d3be89400375bb014ec7eb0b367b91a8f7c7c2354c4f2d9efe28f1af8f960c",
      "scala_library": "bd3b2fa8b922295ccf1537aba1850d455f82003c10484df509d29ff177cc1edc",
      "scala_reflect": "aef72378abbc8b05cfdc7144fc0e55904dd87bf46ce2e973ae667dc3ed2fcee8"
    }
  ),
  scala_extra_jars = {
    "2.13": {
      "scalatest": {
        "version": "3.0.5",
        "sha256": "b416b5bcef6720da469a8d8a5726e457fc2d1cd5d316e1bc283aa75a2ae005e5",
      },
      "scalactic": {
        "version": "3.0.5",
        "sha256": "57e25b4fd969b1758fe042595112c874dfea99dca5cc48eebe07ac38772a0c41",
      },
      "scala_xml": {
        "version": "1.0.5",
        "sha256": "035015366f54f403d076d95f4529ce9eeaf544064dbc17c2d10e4f5908ef4256",
      },
      "scala_parser_combinators": {
        "version": "1.0.4",
        "sha256": "282c78d064d3e8f09b3663190d9494b85e0bb7d96b0da05994fe994384d96111",
      },
    },
  },
)

But it looks like there are incompatibilities in rules_scala itself:

$ bazel build ...                                                                                                                                                                                                                                                                                                                    Saturday August 10 08:38:25 AM
INFO: Analyzed 10 targets (2 packages loaded, 417 targets configured).
INFO: Found 10 targets...
ERROR: /private/var/tmp/_bazel_ryanmichael/17a3ffa16963a088f6b5ad97d780663a/external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/scalac/BUILD:10:1: Building external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/scalac/scalac.jar (4 source files) failed (Exit 1)
external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/scalac/ScalacProcessor.java:242: error: cannot find symbol
      reporter.printSummary();
              ^
  symbol:   method printSummary()
  location: variable reporter of type ConsoleReporter
INFO: Elapsed time: 1.967s, Critical Path: 0.53s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
@johnynek
Copy link
Member

I imagine the call to nsc will need to change. Happy to help you work on a PR here. We can have a separate source file for 2.13 and change as needed, then in the toolchain we can point to a different executable.

@ittaiz
Copy link
Member

ittaiz commented Aug 18, 2019 via email

@k-bespalov
Copy link

any news..?

@bjchambers
Copy link

I spent some time tinkering with this, and figured I'd share the branch and what I did get working / not working:

  1. I had to update test_version significantly since it was broken in multiple ways. It needed to load http_archive, skylib, stop using jvm_flags, and register the scala & scala_proto toolchains.
  2. I had to update a bunch of dependencies since the current versions don't support 2.13. The most problematic was fastparser, which is used by scalapb, which doesn't have a version supporting all of 2.11, 2.12 and 2.13.
  3. Once that was passed, there are a variety of flags and code in use that weren't compatible with 2.13. I used a MethodHandle in ScalacProcessor to avoid forking the code.

There are a variety of things left that don't work in 2.13 (when running test_version and commenting out 2.11 and 2.12), and I'm not sure all the changes work with the earlier versions. If anyone wants to take a look the branch is here:
https://github.com/bjchambers/rules_scala-1/tree/scala-2.13

I'm not sure whether I'll have any more time or not to look at it, but if I do I'll update that branch.

@mmlac
Copy link

mmlac commented May 14, 2020

What is the plan on Scala 2.13 (and then soon Scala 3.0) support?

Is the plan to only look at this after moving to toolchains and depend on #940 and #962 or is language support an issue to be addressed separately as the others mainly deal with the goal of supporting multiple Scala versions at the same time?

@smparkes
Copy link
Contributor

smparkes commented May 14, 2020

I would not wait on #962. I'm contemplating closing that. It's sufficient but not necessary.

@ittaiz
Copy link
Member

ittaiz commented May 15, 2020

The plan is to have the ability to use a different vector of scala repositories to work with the repo.

Whoever needs this is welcome to contribute it (like Oscar mentioned).

We (Wix) will probably get to it in the next few quarters for our own needs.

One thing (which I’m not 100% sure where we should discuss this) is whether we should drop support for 2.11 to ease using both 2.12 and 2.13
I think that if someone works on this and finds big problems I’d be open towards dropping 2.11 support (given community agreement).

@Shastick
Copy link

Shastick commented Sep 1, 2020

Hi there, anything new on this issue?

Would anyone have some pointers on what needs to be done and where to start? (I'm relatively new to Bazel so it would be some very iterative trial and error at best, but I might be able to scrape together some time.)

@ittaiz
Copy link
Member

ittaiz commented Sep 2, 2020 via email

@liucijus
Copy link
Collaborator

Support added via #1118

gergelyfabian pushed a commit to gergelyfabian/rules_scala that referenced this issue May 31, 2022
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

No branches or pull requests

9 participants