-
Notifications
You must be signed in to change notification settings - Fork 14.4k
KAFKA-7197 expand gradle build: include Scala 2.13 #5454
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
Conversation
Thanks for the PR. M5 is due soon, I think we should go straight to that in preparation of RC1. We should probably not build it by default until the final release. |
@dejan2609 2.13.0-M5 has been released. Maybe update this PR to use that? |
@ijuma Sure, sorry for my late answer (I was traveling). I will try to update PR asap. |
Update / related PR: |
Update 2: related PR mentioned above is solved, I will try to accommodate this PR accordingly. |
Long overdue, I will try to squeeze this in a next few days. |
Ok, I have some solution, but I need to hack Xlint options in addition, suppress unused import statements temporarily and so on (after that I will push some solution here):
|
Ok, I pushed commit (after quite a while). @ijuma now I see that I forgot to comply with your comment above (2.13 should not be listed among defaultScalaVersions yet... I will fix that). |
Just to sum it up:
|
retest this please |
1 similar comment
retest this please |
@ijuma please review (note: there are some flaky test). |
@ijuma please review. |
Thanx @ewencp for your review(s) above, I will try to implement/modify based on your suggestions. |
Update: Scala 2.13.0-RC1 has just been released: |
Related: scoverage/scalac-scoverage-plugin#250 Add Scala 2.13.0-RC1 support |
Update: scalac-scoverage-plugin and scalac-scoverage-runtime versions for 2.13.0-RC1 are released. scala-logging release is pending:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I left some minor comments. Apart from that:
- Please rebase as we just upgraded the Gradle version in trunk.
- I think we can go straight to 2.13.0-RC1 since it seems like most libraries are already there.
Hopefully we can enable 2.13 by default for Kafka 2.4.
Scalatest 3.0.8 and scala-logging 3.9.2 are available for Scala 2.13.0 now. Getting there... |
Ok, all dependencies are here, but I just digged some warnings that should be suppressed ( |
Update: switch from Build works for Scala 2.11 / 2.12 and (unsurprisingly) returns some errors for Scala 2.13: ./gradlew clean -PscalaVersion=2.13 jar -q
|
Great!
|
retest this please |
@ennru We have to support Scala 2.11, 2.12 and 2.13. I don't expect an immediate code change to adapt to 2.13 collection APIs. Maybe further down the line when we drop 2.11 and consider switching to 2.13 as the recommended version (we'd still have to be compatible with 2.12 at that point). |
retest this please |
@ijuma solved, rebased, squashed and force-pushed. |
@dejan2609 Can you please rebase (unfortunately your branch includes a change that broke one test, it has since been fixed) and update the PR description to match the current reality? I should be able to merge then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, noticed a couple of additional changes. We should be good to go after that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a couple of changes and it LGTM. It just needs a rebase and for the PR description to be updated.
…d default Scala versions details/notes: * gradle build now includes Scala 2.13; Scala 2.11/2.12 builds are intact * if no Scala version is specified, default to scala 2.12 (was 2.11) * 'baseScala' version resolving is expanded in order to handle milestone and RC versions of Scala * Scala 2.13 removes some scalac options and hence gradle build will include certain Xlint options ('by-name-right-associative' and 'unsound-match') for Scala 2.11/2.12 only * 'README.md' is changed accordingly * required version upgrades for dependencies: ** scalaLogging: 3.9.0 -->> 3.9.2 ** scalatest: 3.0.7 -->> 3.0.8 ** scoverage: 1.3.1 -->> 1.4.0
@ijuma Done as requested, all changes are bundled into one commit. |
Scala 2.12 is green, Scala 2.11 had 1 unrelated flaky connect test. Merging to master. |
While updating Jenkins to build with Scala 2.13, I ran into a number of compiler errors. I'll submit a PR with fixes. |
See #6989 |
Scala 2.13 support was added to build via #5454. This PR adjusts the code so that it compiles with 2.11, 2.12 and 2.13. Changes: * Add `scala-collection-compat` dependency. * Import `scala.collection.Seq` in a number of places for consistent behavior between Scala 2.11, 2.12 and 2.13. * Remove wildcard imports that were causing the Java classes to have priority over the Scala ones, related Scala issue: scala/scala#6589. * Replace parallel collection usage with `Future`. The former is no longer included by default in the standard library. * Replace val _: Unit workaround with one that is more concise and works with Scala 2.13 * Replace `filterKeys` with `filter` when we expect a `Map`. `filterKeys` returns a view that doesn't implement the `Map` trait in Scala 2.13. * Replace `mapValues` with `map` or add a `toMap` as an additional transformation when we expect a `Map`. `mapValues` returns a view that doesn't implement the `Map` trait in Scala 2.13. * Replace `breakOut` with `iterator` and `to`, `breakOut` was removed in Scala 2.13. * Replace to() with toMap, toIndexedSeq and toSet * Replace `mutable.Buffer.--` with `filterNot`. * ControlException is an abstract class in Scala 2.13. * Variable arguments can only receive arrays or immutable.Seq in Scala 2.13. * Use `Factory` instead of `CanBuildFrom` in DecodeJson. `CanBuildFrom` behaves a bit differently in Scala 2.13 and it's been deprecated. `Factory` has the behavior we need and it's available via the compat library. * Fix failing tests due to behavior change in Scala 2.13, "Map.values.map is not strict in Scala 2.13" (scala/bug#11589). * Use Java collections instead of Scala ones in StreamResetter (a Java class). * Adjust CheckpointFile.write to take an `Iterable` instead of `Seq` to avoid unnecessary collection copies. * Fix DelayedElectLeader to use a Map instead of Set and avoid `to` call that doesn't work in Scala 2.13. * Use unordered map for mapping in SimpleAclAuthorizer, mapping of ordered maps require an `Ordering` in Scala 2.13 for safety reasons. * Adapt `ConsumerGroupCommand` to compile with Scala 2.13. * CoreUtils.min takes an `Iterable` instead of `TraversableOnce`, the latter does not exist in Scala 2.13. * Replace `Unit` with `()` in a couple places. Scala 2.13 is stricter when it expects a value instead of a type. * Fix bug in CustomQuotaCallbackTest where we did not necessarily set `partitionRatio` correctly, `forall` can terminate early. * Add a couple of spotbugs exclusions that are needed by code generated by Scala 2.13 * Remove unused variables, simplify some code and remove procedure syntax in a few places. * Remove unused `CoreUtils.JSONEscapeString`. Reviewers: Manikumar Reddy <[email protected]>, José Armando García Sancio <[email protected]>
Final PR description (June 2019):
Initial PR description (August 2018):
details:
Note: ./gradlew -PscalaVersion=2.13 jar -q returns few errors (well, as expected):
Upgrade to Scala 2.13.0-M4 depends on: