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

[1.3.0-RC1] Ivy repository for 0.13.x releases not available by default when cross-compiling a plugin #4698

Closed
bjaglin opened this issue May 17, 2019 · 4 comments · Fixed by #4829
Labels
area/library_management library management Regression workaround exists There's a workaround
Milestone

Comments

@bjaglin
Copy link
Contributor

bjaglin commented May 17, 2019

KO with 1.3.0-RC1

$ sbt new sbt/sbt-autoplugin.g8
...
sbtVersion [maven(org.scala-sbt,sbt,stable)]: 1.3.0-RC1
...
sbt:sbt-foo-bar> set crossSbtVersions := Vector("0.13.16")
sbt:sbt-foo-bar> ^compile
...
[error] sbt.librarymanagement.ResolveException: Error downloading org.scala-sbt:sbt:0.13.16
[error]   Not found
[error]   not found: https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.16/sbt-0.13.16.pom
[error]   not found: /home/bjaglin/.ivy2/local/org.scala-sbt/sbt/0.13.16/ivys/ivy.xml
[error]   not found: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-sbt/sbt/0.13.16/ivys/ivy.xml

OK with 1.2.8

$ sbt new sbt/sbt-autoplugin.g8
...
sbtVersion [maven(org.scala-sbt,sbt,stable)]: 1.2.8
...
sbt:sbt-foo-bar> set crossSbtVersions := Vector("0.13.16")
sbt:sbt-foo-bar> ^compile
...
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/scripted-framework/0.13.16/jars/scripted-framework.jar ...
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/scripted-sbt/0.13.16/jars/scripted-sbt.jar ...
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.16/jars/sbt-launch.jar ...
[info] 	[SUCCESSFUL ] org.scala-sbt#scripted-framework;0.13.16!scripted-framework.jar (1590ms)
[info] 	[SUCCESSFUL ] org.scala-sbt#scripted-sbt;0.13.16!scripted-sbt.jar (2617ms)
[info] 	[SUCCESSFUL ] org.scala-sbt#sbt-launch;0.13.16!sbt-launch.jar (3998ms)
@bjaglin
Copy link
Contributor Author

bjaglin commented May 17, 2019

Not sure if I am looking in the right place, but

does reference the repository where 0.13.x releases are published, but since there is a 302 redirect, maybe the Coursier behavior is not the same as ivy?

@bjaglin bjaglin changed the title [1.3.0-RC1] Ivy repository for 0.13.x releases not available by default when cross-compiling [1.3.0-RC1] Ivy repository for 0.13.x releases not available by default when cross-compiling a plugin May 17, 2019
@bjaglin
Copy link
Contributor Author

bjaglin commented May 17, 2019

Adding

typesafe-releases: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]

to a custom repository configuration fixes the regression.

@eed3si9n
Copy link
Member

@bjaglin Thanks for the report!

I am guessing you could also add a resolver like this:

resolvers += Resolver.typesafeIvyRepo("releases")

If so I might just update the g8 template and docs.

@bjaglin
Copy link
Contributor Author

bjaglin commented May 17, 2019

Thanks for the very prompt reply!

Indeed, my bad. It does make sense to add it, I just never thought about explicitly adding it with previous versions.

Regarding the actions we could take - https://github.com/sbt/website/blob/5524bb3e66a67fd73555910519abff51115fe3cd/src/reference/02-DetailTopics/05-Plugins-and-Best-Practices/07-Cross-Build-Plugins.md would need a big overhaul anyway and the amount of project cross-building to 0.13.x is probably small, so maybe having this issue and its solution indexed by search engines is enough to close?

@eed3si9n eed3si9n added workaround exists There's a workaround area/library_management library management labels Jun 21, 2019
eed3si9n added a commit to eed3si9n/sbt that referenced this issue Jun 22, 2019
eed3si9n added a commit to eed3si9n/sbt that referenced this issue Jun 22, 2019
@dwijnand dwijnand added this to the 1.3.0 milestone Jun 24, 2019
finaglehelper pushed a commit to twitter/scrooge that referenced this issue May 2, 2020
Problem

After updating to sbt 1.3.10 it appears we are running into
sbt/sbt#4698 for building the scrooge-sbt-plugin
for sbt 0.13.18.

Solutio

Even though the issue appears to have had a fix commited, manually
add the Typesafe Ivy Resolver to the `scroogeSbtPlugin` project
settings.

Result

Hopefully the scrooge sbt plugin can now build for sbt 0.13.18.

Differential Revision: https://phabricator.twitter.biz/D478077
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/library_management library management Regression workaround exists There's a workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants