-
Notifications
You must be signed in to change notification settings - Fork 948
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
Consider bumping scala-xml
to 2.x
#6997
Comments
Related to this issue, is there any plan to update to Scala 2.13? 🤔 |
From my understanding of past discussions, no. Updating to 2.13 would have huge ramifications to the sbt plugin ecosystem causing all plugins to have to update to 2.13. So I believe the plan is for sbt 2.x to be on Scala 3, so the plugin ecosystem would only need to go through that migration once. @eed3si9n can correct me if I'm wrong on that. |
Make sense. Thanks for the answer @ckipp01 :) |
Commented on scala/bug#12632 (comment) Yea. Unless something prevents us from going to Scala 3, sbt 2.x should be on 3 (see https://eed3si9n.com/sudori-part3/ etc). |
Without this configuration, devs may hit an error like ``` [error] java.lang.RuntimeException: found version conflict(s) in library dependencies; some are suspected to be binary incompatible: [error] [error] * org.scala-lang.modules:scala-xml_2.12:2.1.0 (early-semver) is selected over {1.3.0, 1.0.6, 1.2.0} [error] +- org.scoverage:scalac-scoverage-reporter_2.12:2.0.2 (depends on 2.1.0) [error] +- com.github.sbt:sbt-native-packager:1.9.11 (sbtVersion=1.0, scalaVersion=2.12) (depends on 2.1.0) [error] +- org.scala-sbt:testing_2.12:1.6.2 (depends on 1.3.0) [error] +- org.scala-sbt:sbinary_2.12:0.5.1 (depends on 1.0.6) [error] +- org.scala-sbt:main_2.12:1.6.2 (depends on 1.3.0) [error] +- org.scala-sbt:librarymanagement-core_2.12:1.6.1 (depends on 1.2.0) [error] +- org.scala-lang:scala-compiler:2.12.16 (depends on 1.0.6) [error] +- io.get-coursier:lm-coursier-shaded_2.12:2.0.10 (depends on 1.3.0) [error] [error] [error] this can be overridden using libraryDependencySchemes or evictionErrorLevel ``` See sbt/sbt#6997
would declaring the dependency as |
Got this fixed with #7021? |
Well, this issue is blocking Twirl (see playframework/twirl#548 (comment)), which is blocking Caliban (see ghostdogpr/caliban#1472) As suggested by @mkurz in his comment in the Twirl repo, can we maybe get a 1.8.0-M1 release using Scala 2.12.17 to be able to unblock everyone, maybe? |
To be honest that whole scala-xml upgrade thinig is a mess. The fact that sbt fails with an error on startup just by upgrading a librarie's patch version because it upgraded scala-xml is very very annoying. Next time this has should be coordinated somehow (next candidate is scala-parser-combinators... |
I'm not against but, IMO, it's quite hard to coordinate all these projects maintained by many different people unless one person or a small group of persons takes the responsibility to coordinate everything. The few of us who are involved in this scala-xml migration in Scala 2.12 and sbt are making PRs here and there to update things. It takes time, it's open-source work made in people's free time. Without this person (or small group) coordinating and making the required work, I don't see how it can be done more quickly. |
True, but bumping in patch releases is also not the best idea. That crashes sbt just because upgrading sbt-native-packager from 1.9.9 to 1.9.10... That's what's really bothers me. |
And suddenly I have to talk to 5 other maintainers to convice them to upgrade scala-xml because I can't, in a clean way, upgrade a patch version... |
For what it's worth, I understand your frustration, but this thread on sbt probably isn't the correct place to air it as it's not the fault of sbt at all. There is more context in here but this wasn't the first time scala-xml updates have caused issues. Projects have bumped back and forth to handle this, published multiple versions, etc. I totally agree that it's a bit of a nightmare. I'll even take part of the blame as I'm the one who bumped scoverage. However, I bumped because someone else bumped and I got complaints about it. That project probably bumped because someone else bumped. Thus is the nature of developing with Scala, the JVM, semver, etc. As @guizmaii mentioned these things are really hard to coordinate without a single person at the helm guiding it, but even with that, you'll have projects that won't bump or respond, etc. There are various open prs and issues around the ecosystem to bump. I encourage people to continue to push for this, comment on issues, and lend a hand where they can. This will hopefully get everything over the tipping point and we can forget about scala-xml 1.x and this issue for good. |
scala-parser-combinators like: hold my beer 😉 |
This is a continuation or really a revert of what was done in coursier#2274. Originally this was done because Scala 2.12 was on 1.x, but that is no longer the case. You can see the discussion for this in scala/bug#12632. I'm assuming that other things like sbt that will use this will also hit on it as well if it's still on 1.x. See sbt/sbt#6997 for more details on that. This also then bumps Scala 2.12 to 2.12.17 to make sure the scala-xml is aligned there too.
This is a continuation or really a revert of what was done in coursier#2274. Originally this was done because Scala 2.12 was on 1.x, but that is no longer the case. You can see the discussion for this in scala/bug#12632. I'm assuming that other things like sbt that will use this will also hit on it as well if it's still on 1.x. See sbt/sbt#6997 for more details on that. This also then bumps Scala 2.12 to 2.12.17 to make sure the scala-xml is aligned there too.
This is a continuation or really a revert of what was done in #2274. Originally this was done because Scala 2.12 was on 1.x, but that is no longer the case. You can see the discussion for this in scala/bug#12632. I'm assuming that other things like sbt that will use this will also hit on it as well if it's still on 1.x. See sbt/sbt#6997 for more details on that. This also then bumps Scala 2.12 to 2.12.17 to make sure the scala-xml is aligned there too.
Same reason that I had for coursier/coursier#2548 but since sbt 1.7.3 was released a bunch of people will see the following: ``` 03:31:06 [info] loading global plugins from /root/.sbt/1.0/plugins 03:31:10 [error] java.lang.RuntimeException: found version conflict(s) in library dependencies; some are suspected to be binary incompatible: 03:31:10 [error] 03:31:10 [error] * org.scala-lang.modules:scala-xml_2.12:2.1.0 (early-semver) is selected over {1.3.0, 1.2.0, 1.0.6} 03:31:10 [error] +- org.scala-lang:scala-compiler:2.12.17 (depends on 2.1.0) 03:31:10 [error] +- org.scala-sbt:testing_2.12:1.7.3 (depends on 1.3.0) 03:31:10 [error] +- org.scala-sbt:sbinary_2.12:0.5.1 (depends on 1.0.6) 03:31:10 [error] +- org.scala-sbt:main_2.12:1.7.3 (depends on 1.3.0) 03:31:10 [error] +- org.scala-sbt:librarymanagement-core_2.12:1.7.1 (depends on 1.2.0) 03:31:10 [error] +- io.get-coursier:lm-coursier-shaded_2.12:2.0.12 (depends on 1.3.0) ``` Since there is a mismatch of scala-xml all over the place. Since Scala has bumped I think it's appropriate the everyone else bumps as well. sbt has also merged in this change for the 1.8.x series. Relates to sbt/sbt#6997.
@eed3si9n do you have any timeline on when you'd like to get 1.8.x out? I noticed that with the latest 1.7.3 even just using
I've seen others report this as well. However it's not clear where 2.12.17 is coming in from in this scenario. This also made me realize it wasn't bumped in Either way the ball is sort of rolling, so how do we think it's best to proceed, and how can I help? |
For reproduction clone: https://github.com/ajozwik/quill-generic |
This sounds like it could be something in your global |
Locally with this repo bumping to 1.7.3 gives me no issues. Same as above, it could be something in your global config actually causing an issue here. |
Yes, |
I am guessing that in some situations sbt-coursier's Scala version (2.12.17) is bubbling up. I've opened coursier/coursier#2573 to request 2.12.16 version of sbt-coursier for 1.7.x branch. |
@ckipp01 Yeah! I should have checked your comment early! 😂 |
I have 7 plugins in |
In case anyone here missed it and is following along, v1.8.0-RC1 was realeased which does bring in the 2.x version of scala-xml. Please do test it out and report back if you're hitting on any scala-xml problems. I'm assuming there may be some, and then we can chase them down in the various repos. |
I still had problems with version conflicts when trying to use addDependencyTreePlugin in plugins.sbt (and sbt.version=1.8.0-RC1), but removing metals.sbt and .bloop/ folders did help (which weren't touched upon for a while). |
ok. I am closing this as done. If you encounter related issues (esp years from now) please open a fresh issue to avoid pinging everyone on this thread. |
1.8.0-RC1 did not clear this up for me. |
Some builds will continue to fail if the plugin depends on scala-xml 1.x. Either case the workaround would be to put the following in ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always |
@ckipp01 suggested this to me on discord and it works for us. Thanks! |
@guizmaii Thanks for that. I'll try to remove those transitive dependencies on scala-xml 1.x. |
Just a heads up (last post here I promise), I created #7075 as a way to track various plugins or issues that people may be hitting on. If you're still hitting on issues related to this, feel free to head there first before creating an issue or commenting here. |
I also needed this for settings:
|
I'd actually caution you not to use this setting. By doing this you're telling your whole build that instead of erroring on an eviction that it should error on, just ignore it. While for some cases like
to only target With that being said, the core of this issue in sbt has been solved as sbt 1.8.0 is on 2.x of scala-xml, so it's recommended you update. If you still have issues, then there is probably an issue with something else in your build that I recommend you hunt down or open a new issue about. |
@ckipp01, thanks for reminding me about that one! However, this did not work for me in
This is the issue:
I'm on Plugins are as follows:
|
Looking at the dependency issue, it's actually an issue with 2.13 artifacts, meaning it's not an issue with your plugins. If you'd move that same |
Problem outline
Not really a bug, just something a bunch of people are going to hit on. I've reported this to
scala/bug
, but these updates may have to go hand in hand if we do them. I'll copy over what I posted there since the reasoning is the same:The text was updated successfully, but these errors were encountered: