Highlights
This release mainly fixes regressions in 2.1.25, and makes downloads more resilient against transient network failures or overloaded servers.
coursier.jarand the thincoursierlauncher work again. In 2.1.25, these launchers bundled or pulled a Scala 2.13cats-freenext to the Scala 3-built CLI, so every resolution command (fetch,resolve,launch, …) failed withNoSuchMethodError: cats.implicits$.catsStdInstancesForList(). The stray 2.13 dependency is now gone. CI now also builds and tests JAR launchers, and rejects class paths that mix Scala binary versions. Fixes [#3865]. (#3879)- No more duplicate conflicts. Since 2.1.25, a dependency declared as explicitly non-optional (
optional0 = Some(false), as sbt does) and the same dependency with no optional flag were treated as two dependencies. That duplicated entries inminDependenciesand incoursier.graph.Conflict(…), which broke sbt eviction warnings, for example. They are now normalized. Fixes [#3861]. (#3878) - The Scala 3 artifacts target Scala 3.3 LTS. In 2.1.25 they were compiled with Scala 3.9.0, so only projects on 3.9 could use them. They are now built with 3.3.8, which makes them usable from any Scala 3.3+ project. (#3856)
Downloads and cache
- HTTP errors are retried with curl-style backoff. The server responses that curl's
--retryretries are now retried too: 408, 500, 502, 503, 504, and Cloudflare's 522/524. The first retry waits 1 second, and the wait doubles each time, up to 10 minutes. ARetry-Afterheader on any of those responses is honoured, not only on a 503. Other 5xx responses, such as 501, fail right away. Connection errors, timeouts, and SSL errors keep their short backoff (10 ms, doubling, up to 20 s). The newcoursier.http-retry-backoff-initial-delayandcoursier.http-retry-backoff-max-delayproperties tune this. See the retries documentation. (#3884) - The CLI retries downloads by default.
--retry-countused to default to 1, so the CLI made a single attempt even when the cache would have retried. It now uses the cache's default (5 attempts, or thecoursier.exception-retryJava property). Its help message also says that it covers network and server errors, not just checksum errors. (#3883) - Cache servers are used automatically. When
COURSIER_CACHE_SERVERpoints at a cache server, anyFileCacheusing the default cache location now goes through that server. Before, only the default cache did. Localfile:URLs are still read directly. The server also honours the client's cache policies and TTL. (#3887) - Local archives are left alone. The archive cache no longer writes integrity files next to local archives that stay outside the cache (
file:URLs), and no longer deletes them when they are corrupted. (#3885)
CLI and installation
cs updatenow shows versions, e.g.Updated scalafmt (3.9.5 -> 3.9.6). (#3889)- The Homebrew formula no longer depends on
openjdk. That formula'sjavawas on thePATHand shadowed the JVMs managed by coursier, sojavaandcs javacould disagree. The nativecslauncher doesn't need a JVM. The JAR-basedcoursierlauncher uses the JVM fromJAVA_HOMEor thePATH, whichcs setupcan install. Shell completions now refer tocs. Fixes [#3763]. (#3886)
Library changes
- Scala 3 compiler crashes fixed. Some GraalVM-only classes carry annotations that reference GraalVM classes users don't have on their class path. When one of those classes sat in a package user code looks up, the Scala 3 compiler could crash. They now live in dedicated packages:
coursier.exec.Graalvm*moved tocoursier.exec.graalvm.- The deprecated, unused
coursier.jvm.GraalvmErrnoExtrasandcoursier.jvm.GraalvmUnistdExtraswere removed. coursier.cache.internal.SigWinchNativeWindowsmoved tocoursier.cache.internal.graalvm.
These are native-image internals, but they are binary-incompatible changes. (#3857, [#3862])
- Future lazy vals in the Scala 3 artifacts. They are compiled with
-Yfuture-lazy-vals, the lazy val implementation that became the default in Scala 3.8 and works on JDK 25+. (#3866) - Separate jsoniter-scala versions. The Scala 3 modules now use jsoniter-scala 2.41.0. The Scala 2 modules stay on 2.13.8, the last release with Java 8 class files. (#3855, [#3877])
- Scala.js artifacts are Scala 3 only. The
_sjs1_2.13artifacts are no longer published. (#3854)
Publishing
- Artifacts, snapshots included, are now also published to GitHub Packages. Sonatype Central remains the main repository. (#3881)
Build and release tooling
- Skip successfully uploaded release assets when re-running uploads (#3860)
- Resolve paths when smoke-testing JAR launchers (#3890)
- Use Mill's built-in Sonatype Central publisher, and serialize publishing jobs (#3891)
- Update Mill to 2.0.0-M2 (#3880)
- Avoid compilation when evaluating BSP
workspace/buildTargets(#3888) - Update
cs.shto 2.1.25 (#3859) - Update the cs version building the Linux launchers to 2.1.25 (#3858)
Dependency updates
- Update dependency to 0.3.3 by @scala-steward (#3873)
- Update config_3 to 1.17.1 by @scala-steward (#3875)
- Update svm to 25.0.4.1.1 by @scala-steward (#3874)
- Update scalafix-core to 0.14.9 by @scala-steward (#3870)
Full Changelog: https://github.com/coursier/coursier/compare/v2.1.25...v2.1.26