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

Avoid sbt-web 1.4.x dependency, use latest 1.5.x #61

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

mkurz
Copy link
Member

@mkurz mkurz commented Feb 12, 2024

The "problem" is that currently sbt-web 1.4.x is pulled in, but only sbt-web 1.5.+ is hosted on maven central. So when blocking the deprecated repos, I can not build the project:

[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]          com.typesafe.sbt:sbt-web:1.4.4 (scalaVersion=2.12, sbtVersion=1.0)
[warn] 
[warn]  Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading com.typesafe.sbt:sbt-web;sbtVersion=1.0;scalaVersion=2.12:1.4.4
[error]   Not found
[error]   Not found
[error]   not found: https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-web_2.12_1.0/1.4.4/sbt-web-1.4.4.pom
[error]   not found: /home/mkurz/.ivy2/local/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/ivys/ivy.xml
[error]   download error: Caught java.net.ConnectException (Connection refused (Connection refused)) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/ivys/ivy.xml
[error]   download error: Caught java.net.ConnectException (Connection refused (Connection refused)) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/ivys/ivy.xml
...
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.typesafe.sbt:sbt-web;sbtVersion=1.0;scalaVersion=2.12:1.4.4
[error]   Not found
[error]   Not found
[error]   not found: https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-web_2.12_1.0/1.4.4/sbt-web-1.4.4.pom
[error]   not found: /home/mkurz/.ivy2/local/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/ivys/ivy.xml
[error]   download error: Caught java.net.ConnectException (Connection refused (Connection refused)) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/ivys/ivy.xml
[error]   download error: Caught java.net.ConnectException (Connection refused (Connection refused)) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/ivys/ivy.xml

dependency tree build.sbt:

[info] com.github.sbt:sbt-paradox-material-theme:0.6.0-SNAPSHOT
[info]   +-com.lightbend.paradox:sbt-paradox:0.9.2
[info]     |
[info]     +-com.typesafe.sbt:sbt-web:1.4.4

dependency tree project/plugins.sbt:

[info] default:project:0.1.0-SNAPSHOT
[info]   +-com.lightbend.paradox:sbt-paradox-theme:0.9.2
[info]   | +-com.typesafe.sbt:sbt-web:1.4.4
[info]   |
[info]   +-com.lightbend.paradox:sbt-paradox:0.9.2
[info]     |
[info]     +-com.typesafe.sbt:sbt-web:1.4.4

sbt-web was upgraded to 1.5.x just recently in paradox 0.10.6: lightbend/paradox@80c9c01

However because we want to use paradox 0.9.2 for a 0.7.0 release, it makes sense to override the used sbt-web version to use 1.5.x. Since I maintain sbt-web I can pretty much assure that 1.4.x and 1.5.x are compatible, however the only thing I removed where the Compat objects, because sbt 1.5.x does not cross compile to sbt 0.13.x anymore. This was not a problem until now, because I always just changed Compat.cacheStore(streams.value, "...") to streams.value.cacheStoreFactory.make("...") in all the projects I migrated to sbt-web 1.5.x.

This PR now fails however because of course paradox 0.9.x still uses that Compat object's methods:

[info] [error] java.lang.NoClassDefFoundError: com/typesafe/sbt/web/Compat$
...
[info] [error] Caused by: java.lang.ClassNotFoundException: com.typesafe.sbt.web.Compat$

So we have three choices:

  1. Do not upgrade to sbt-web 1.5.x but stay on 1.4.x and fetch it from the deprecated repo.
    I am against that, because bumping sbt-web 1.4.x to 1.5.x never caused any problems in other projects and sbt 1.5.x did fix problems, like memory leaks, got ride of the akka dependency within sbt (which was a bit... not nice to do that), support for newever npm/node versions etc.
  2. Ask lightbend (again) to release paradox 0.9.3 which avoids using the Compat object, so we can bump to sbt 1.5.x here. However I guarantee you this will never happen. Lightbend does not do that, we asked different things in the last two years to fix for us (like backport the Scala 3 support PR to akka-http 10.2.x, which would not be hard, they didn't do it).
  3. I will just re-add the Compat object to a new sbt-web 1.5.4 release so this PR turns green. IMHO this is the easiest thing to do and also a manageable trade off.

@mkurz mkurz marked this pull request as ready for review February 13, 2024 13:29
@mkurz
Copy link
Member Author

mkurz commented Feb 13, 2024

Re-introduced the Compat object:

released as sbt-web 1.5.4.

@mkurz mkurz merged commit 1261986 into sbt:main Feb 13, 2024
5 checks passed
@mkurz mkurz deleted the sbt-web-1.5.x branch February 13, 2024 13:37
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.

1 participant