From c4ec14ee468dac8058f7ecc25a08b078ad57c59e Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Sun, 22 Oct 2023 20:42:38 +0200 Subject: [PATCH] Enable pathref revalidation for all coursier downloads (#2846) This change sets the `revalidate` flag on the coursier resolved pathrefs in more situations, to better detect the case, that the cache might have changed. Pull request: https://github.com/com-lihaoyi/mill/pull/2846 --- main/api/src/mill/api/PathRef.scala | 2 +- main/util/src/mill/util/Util.scala | 2 +- scalalib/src/mill/scalalib/CoursierModule.scala | 2 +- scalalib/src/mill/scalalib/Lib.scala | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main/api/src/mill/api/PathRef.scala b/main/api/src/mill/api/PathRef.scala index 8e23945fc65..f2728f2c091 100644 --- a/main/api/src/mill/api/PathRef.scala +++ b/main/api/src/mill/api/PathRef.scala @@ -189,7 +189,7 @@ object PathRef { // Parsing to a long and casting to an int is the only way to make // round-trip handling of negative numbers work =( val sig = java.lang.Long.parseLong(hex, 16).toInt - val pr = PathRef(path, quick, sig, validOrig) + val pr = PathRef(path, quick, sig, revalidate = validOrig) validatedPaths.value.revalidateIfNeededOrThrow(pr) pr } diff --git a/main/util/src/mill/util/Util.scala b/main/util/src/mill/util/Util.scala index a8b24e50bf1..82b505c01bf 100644 --- a/main/util/src/mill/util/Util.scala +++ b/main/util/src/mill/util/Util.scala @@ -95,7 +95,7 @@ object Util { ), force = Nil, resolveFilter = resolveFilter - ) + ).map(_.map(_.withRevalidateOnce)) } def millProperty(key: String): Option[String] = diff --git a/scalalib/src/mill/scalalib/CoursierModule.scala b/scalalib/src/mill/scalalib/CoursierModule.scala index 6b395b436c7..bcfc7ea1f8a 100644 --- a/scalalib/src/mill/scalalib/CoursierModule.scala +++ b/scalalib/src/mill/scalalib/CoursierModule.scala @@ -47,7 +47,7 @@ trait CoursierModule extends mill.Module { customizer = resolutionCustomizer(), coursierCacheCustomizer = coursierCacheCustomizer(), ctx = Some(implicitly[mill.api.Ctx.Log]) - ).map(_.map(_.withRevalidateOnce)) + ) } /** diff --git a/scalalib/src/mill/scalalib/Lib.scala b/scalalib/src/mill/scalalib/Lib.scala index 7fd7d6a0e2c..3eb8946f4c1 100644 --- a/scalalib/src/mill/scalalib/Lib.scala +++ b/scalalib/src/mill/scalalib/Lib.scala @@ -74,7 +74,7 @@ object Lib { customizer = customizer, ctx = ctx, coursierCacheCustomizer = coursierCacheCustomizer - ) + ).map(_.map(_.withRevalidateOnce)) } def scalaCompilerIvyDeps(scalaOrganization: String, scalaVersion: String): Loose.Agg[Dep] =