Skip to content

Prefer local ScalaModuleInfo over global config#609

Merged
eed3si9n merged 2 commits intocoursier:mainfrom
kitbellew:sbt-scalafmt-433
Apr 5, 2026
Merged

Prefer local ScalaModuleInfo over global config#609
eed3si9n merged 2 commits intocoursier:mainfrom
kitbellew:sbt-scalafmt-433

Conversation

@kitbellew
Copy link
Copy Markdown
Contributor

Otherwise, a user will never be able to download scala library at any other version.

Helps with scalameta/sbt-scalafmt#433.

Regardless of configuration, all tests insist on forcing the download
of scala library and at the same version.
@kitbellew
Copy link
Copy Markdown
Contributor Author

PTAL @alexarchambault @eed3si9n @tgodzik

@kitbellew kitbellew force-pushed the sbt-scalafmt-433 branch 2 times, most recently from 44ef8a7 to 3e8efa8 Compare April 5, 2026 14:40
@eed3si9n
Copy link
Copy Markdown
Collaborator

eed3si9n commented Apr 5, 2026

Looks like we need to either adjust the scripted tests or remove these ones:

[info] [info] Set current project to foo (in build file:/tmp/sbt_c6e69404/dotty-scala-instance/)
Error:  Downloading https://repo1.maven.org/maven2/ch/epfl/lamp/scala-library/2.12.8/scala-library-2.12.8.pom
Error:  Failed to download https://repo1.maven.org/maven2/ch/epfl/lamp/scala-library/2.12.8/scala-library-2.12.8.pom
Error:  Downloading https://repo1.maven.org/maven2/ch/epfl/lamp/scala-library/2.12.8/scala-library-2.12.8.pom.sha1
Error:  Failed to download https://repo1.maven.org/maven2/ch/epfl/lamp/scala-library/2.12.8/scala-library-2.12.8.pom.sha1
[info] [error] Couldn't retrieve `ch.epfl.lamp:dotty-compiler:0.16.0-RC3`.
[info] [error] (scalaInstance) Couldn't retrieve `ch.epfl.lamp:dotty-compiler:0.16.0-RC3`.
[info] [error] Total time: 1 s, completed Apr 5, 2026 3:58:48 PM
Error:  x shared-1 / dotty-scala-instance 

[info] [error] (scalaInstance) Couldn't retrieve `ch.epfl.lamp:dotty-doc:0.13.0-RC1`.
[info] [error] (update) sbt.librarymanagement.ResolveException: Error downloading ch.epfl.lamp:scala-library:2.12.8
[info] [error]   Not found
[info] [error]   Not found
[info] [error]   not found: /home/runner/.ivy2/local/ch.epfl.lamp/scala-library/2.12.8/ivys/ivy.xml
[info] [error]   not found: https://repo1.maven.org/maven2/ch/epfl/lamp/scala-library/2.12.8/scala-library-2.12.8.pom
[info] [error] Total time: 1 s, completed Apr 5, 2026 3:59:06 PM
Error:  x shared-1 / dotty 

Otherwise, a user will never be able to download scala library at any
other version.
@kitbellew
Copy link
Copy Markdown
Contributor Author

Looks like we need to either adjust the scripted tests or remove these ones:

[info] [info] Set current project to foo (in build file:/tmp/sbt_c6e69404/dotty-scala-instance/)
Error:  Downloading https://repo1.maven.org/maven2/ch/epfl/lamp/scala-library/2.12.8/scala-library-2.12.8.pom
Error:  Failed to download https://repo1.maven.org/maven2/ch/epfl/lamp/scala-library/2.12.8/scala-library-2.12.8.pom
Error:  Downloading https://repo1.maven.org/maven2/ch/epfl/lamp/scala-library/2.12.8/scala-library-2.12.8.pom.sha1
Error:  Failed to download https://repo1.maven.org/maven2/ch/epfl/lamp/scala-library/2.12.8/scala-library-2.12.8.pom.sha1
[info] [error] Couldn't retrieve `ch.epfl.lamp:dotty-compiler:0.16.0-RC3`.
[info] [error] (scalaInstance) Couldn't retrieve `ch.epfl.lamp:dotty-compiler:0.16.0-RC3`.
[info] [error] Total time: 1 s, completed Apr 5, 2026 3:58:48 PM
Error:  x shared-1 / dotty-scala-instance 

[info] [error] (scalaInstance) Couldn't retrieve `ch.epfl.lamp:dotty-doc:0.13.0-RC1`.
[info] [error] (update) sbt.librarymanagement.ResolveException: Error downloading ch.epfl.lamp:scala-library:2.12.8
[info] [error]   Not found
[info] [error]   Not found
[info] [error]   not found: /home/runner/.ivy2/local/ch.epfl.lamp/scala-library/2.12.8/ivys/ivy.xml
[info] [error]   not found: https://repo1.maven.org/maven2/ch/epfl/lamp/scala-library/2.12.8/scala-library-2.12.8.pom
[info] [error] Total time: 1 s, completed Apr 5, 2026 3:59:06 PM
Error:  x shared-1 / dotty 

I realized that I don't know what's happening here, and simply removed one line that I copied from the sbt implementation (setting org on coursier params), but added a TODO comment. it wasn't failing locally without that line.

Copy link
Copy Markdown
Collaborator

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@eed3si9n eed3si9n merged commit 3d485e0 into coursier:main Apr 5, 2026
5 checks passed
@kitbellew kitbellew deleted the sbt-scalafmt-433 branch April 5, 2026 18:48
kitbellew added a commit to kitbellew/sbt-scalafmt that referenced this pull request Apr 8, 2026
That version fixes ability to download scala-library at given version,
rather than the scala version of the build.

See sbt/sbt#9028 (2.x) and coursier/sbt-coursier#609 (1.x).
kitbellew added a commit to scalameta/sbt-scalafmt that referenced this pull request Apr 10, 2026
That version fixes ability to download scala-library at given version,
rather than the scala version of the build.

See sbt/sbt#9028 (2.x) and coursier/sbt-coursier#609 (1.x).
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.

2 participants