-
Notifications
You must be signed in to change notification settings - Fork 21
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
Regression in sbt 1.9.5, likely zinc regression #12868
Comments
I'm testing sbt 1.9.5 in the Scala 2 community build now — perhaps that will generate some insight. fyi @lrytz |
So I doubt that this is due to the new compiler bridge because that was added for Scala 2.13 and MiMa is complaining about Scala 2.12 artifacts. I am looking through the various changes put into Zinc recently (which is what new sbt 1.9.5 brings in) and the only one that comes to mind is sbt/zinc#1244 (it seems to be dealing with filenames which is what MiMa is complaining about). The inliner was also enabled in Zinc for Scala 2.13, but I seriously doubt thats the issue (this would be some serious bug in the inliner and furthermore would only be applicable if Zinc on Scala 2.13 is used to compile Scala 2.12 artifacts which I don't think is the case) |
The issue occurs with I checked and it only seems to happen with |
@dwijnand wdyt, plausible culprit? |
I tested with sbt 1.9.5 and 2.13.11, fails too. |
Just to clarify - is it really MiMa complaining? The error message "... differs only in case from ..." is from the compiler (https://github.com/scala/scala/blob/v2.12.18/src/compiler/scala/tools/nsc/backend/jvm/PostProcessor.scala#L104-L105) |
Your right, it happened in the MiMa step but it does seem to be the actual Scala compiler |
Created scala-steward-org/scala-steward#3167 for now -- I don't know if this would work? |
I can confirm it's caused by sbt/zinc#1244. I'll continue digging, but probably won't have anything done during ScalaDays. |
Thanks for diagnosing, enjoy the conference! |
cc @eed3si9n |
So at this point it may result in spurious/false warnings, and it might fail builds with fatal warnings? |
A lot of guessing here from my side as I haven't had time to look in detail, but the interaction is something like this: We have The phase travel The error in pekko is due to two anonymous classes now having the same name accidentally. However, I believe that this has a broad effect, many anonymous classes will get a different name when compiling with the new zinc. While it's possibly OK in terms of binary compatibiliy (anonymous classes cannot be referenced externally), it's still an unintended wide-reaching change. It probably should be considered a bug in the compiler, but we cannot change existing compiler releases. The new zinc needs to continue working with existing compiler releases. Therefore I think we need to revert the change in zinc. Since poeple might start using the new sbt and publish libraries with it, we should do that rather quickly and get another sbt release out. |
I agree with @lrytz here in that it seems the best course of action is to revert that PR and re-release zinc+sbt, then there is more breathing room to solve that PR properly without causing regressions. |
community build results: the 2.13 builds are green on 2.12, the akka-stream build consistently has a test failure example failure: https://scala-ci.typesafe.com/job/scala-2.12.x-jdk8-integrate-community-build/8240/artifact/logs/akka-stream-build.log: note that while the 2.13 build has current Akka, the 2.12 build is on a much older version @eed3si9n I'm always happy to run new sbt versions through the community build on request, including milestones and RCs |
FYI Pekko is also failing on 2.12 but with the latest Scala 2.12 scala version (i.e. 2.12.18) so I don't think the specific Scala 2.12 version makes a difference here. |
On it. |
sbt 1.9.6 is released - https://eed3si9n.com/sbt-1.9.6
|
Closing this as resolved. |
Thanks Eugene!
I don't think anyone would have spotted that during review... |
@eed3si9n i agree, this was unlikely to have been caught in advance by a human reviewer. but the community build did catch it, so ( later, after we catch our breath) maybe we could work out a way for me to help test sbt changes and/or zinc changes there, hopefully without much extra effort from your side being needed I’m interested both in a test-all-of-sbt option, and perhaps in a test-new-zinc-with-existing-sbt option as well? |
Yea, in general future Zinc changes should probably go through some testing, even when they look somewhat innocuous. |
So... if I just published a bunch of libraries including Play to maven central using sbt 1.9.5 it's better to re-publish them again with 1.9.6? 😢 |
Yea, I think it's a judgement call since the definition and call site of a lambda is closed within your own library, but it's definitely an odd duck name mangling. Given the wide usage of Play, it might be safe to republish? |
I think so. Anyway, thank you for the excellent and continuous work on sbt 👍 |
Just wanted to say that SBT 1.9.6 solves the problem with Pekko, so I can confirm that sbt/zinc#1244 was indeed the culprit |
? |
@mkurz That seems to be an unrelated issue from this one. |
Told scala-steward to hold back the already published artifacts, like you did with sbt 1.9.5: |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [sbt/sbt](https://togithub.com/sbt/sbt) | patch | `1.9.4` -> `1.9.6` | --- ### Release Notes <details> <summary>sbt/sbt (sbt/sbt)</summary> ### [`v1.9.6`](https://togithub.com/sbt/sbt/releases/tag/v1.9.6): 1.9.6 [Compare Source](https://togithub.com/sbt/sbt/compare/v1.9.5...v1.9.6) #### bug fix - sbt 1.9.6 reverts "internal representation of class symbol names" change ([https://github.com/sbt/zinc/pull/1244](https://togithub.com/sbt/zinc/pull/1244)), which caused Scala compiler to generate wrong anonymous class name by [@​eed3si9n](https://togithub.com/eed3si9n) in [https://github.com/sbt/zinc/pull/1256](https://togithub.com/sbt/zinc/pull/1256). See [https://github.com/scala/bug/issues/12868](https://togithub.com/scala/bug/issues/12868) for more details. **Full Changelog**: sbt/sbt@v1.9.5...v1.9.6 ### [`v1.9.5`](https://togithub.com/sbt/sbt/releases/tag/v1.9.5): 1.9.5 [Compare Source](https://togithub.com/sbt/sbt/compare/v1.9.4...v1.9.5) #### highlights - Switches to pre-compiled compiler bridge for Scala 2.13.12+ [#​7374][7374] by [@​eed3si9n][@​eed3si9n] - Fixes NPE when just `-X` is passed to `scalacOptions` [zinc#1246][zinc1246] by [@​unkarjedy][@​unkarjedy] #### other updates - Fixes internal representation of class symbol names [zinc#1244][zinc1244] by [@​dwijnand][@​dwijnand] - Fixes `NumberFormatException` in `CrossVersionUtil.binaryScalaVersion` [lm#426][lm426] by [@​HelloKunal][@​HelloKunal] - Fixes `scripted` client/server instability on Windows [#​7087][7087] by [@​mdedetrich][@​mdedetrich] - Fixes `sbt` launcher script bug on Windows [#​7365][7365] by [@​JD557][@​JD557] - Fixes `help` command on oldshell [#​7358][7358] by [@​azdrojowa123][@​azdrojowa123] - Adds `allModuleReports` to `UpdateReport` [lm#428][lm428] by [@​mdedetrich][@​mdedetrich] - Handles javac warning messages [zinc#1228][zinc1228] by [@​Arthurm1][@​Arthurm1] - Enables inliner for Scala 2.13 compiler bridge [zinc#1247][zinc1247] by [@​mdedetrich][@​mdedetrich] #### new contributors - [@​azdrojowa123](https://togithub.com/azdrojowa123) made their first contribution in [https://github.com/sbt/sbt/pull/7358](https://togithub.com/sbt/sbt/pull/7358) - [@​JD557](https://togithub.com/JD557) made their first contribution in [https://github.com/sbt/sbt/pull/7367](https://togithub.com/sbt/sbt/pull/7367) **Full Changelog**: sbt/sbt@v1.9.4...v1.9.5 [@​eed3si9n]: https://togithub.com/eed3si9n [@​Nirvikalpa108]: https://togithub.com/Nirvikalpa108 [@​adpi2]: https://togithub.com/adpi2 [@​er1c]: https://togithub.com/er1c [@​eatkins]: https://togithub.com/eatkins [@​dwijnand]: https://togithub.com/dwijnand [@​mdedetrich]: https://togithub.com/mdedetrich [@​JD557]: https://togithub.com/JD557 [@​azdrojowa123]: https://togithub.com/azdrojowa123 [@​HelloKunal]: https://togithub.com/HelloKunal [@​unkarjedy]: https://togithub.com/unkarjedy [@​Arthurm1]: https://togithub.com/Arthurm1 [7374]: https://togithub.com/sbt/sbt/pull/7374 [7087]: https://togithub.com/sbt/sbt/pull/7087 [7365]: https://togithub.com/sbt/sbt/issues/7365 [7358]: https://togithub.com/sbt/sbt/pull/7358 [zinc1246]: https://togithub.com/sbt/zinc/pull/1246 [zinc1244]: https://togithub.com/sbt/zinc/pull/1244 [zinc1228]: https://togithub.com/sbt/zinc/pull/1228 [zinc1247]: https://togithub.com/sbt/zinc/pull/1247 [lm426]: https://togithub.com/sbt/librarymanagement/pull/426 [lm428]: https://togithub.com/sbt/librarymanagement/pull/428 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/cwienberg/spark-sorting-helpers). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44My4wIiwidXBkYXRlZEluVmVyIjoiMzYuODMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Reproduction steps
Scala version: N/A (see PR)
Updating an existing project to SBT 1.9.5, see apache/pekko#648
Problem
Original notes
Still need to figure out what the root cause is, basically a project (Pekko) was updated to 1.9.5 and then MiMa started complaining about bincompat issues (see https://github.com/apache/incubator-pekko/actions/runs/6182223720/job/16781910666?pr=648). My initial suspicion/hunch is that it may be due to the new compiler bridge that was added in zinc which was brought in by the new sbt version (see scala/scala#10472)
The text was updated successfully, but these errors were encountered: