From c9efc7597990a1412a9eb52d6182e98801f0125d Mon Sep 17 00:00:00 2001 From: Myyk Seok <2080820+myyk@users.noreply.github.com> Date: Wed, 30 Oct 2024 00:47:09 +0800 Subject: [PATCH 01/10] chore: simplify resolve core without functionality changes --- .../src/mill/resolve/ResolveCore.scala | 68 +++++++++---------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/main/resolve/src/mill/resolve/ResolveCore.scala b/main/resolve/src/mill/resolve/ResolveCore.scala index 5c3a7396a74..604d9737a15 100644 --- a/main/resolve/src/mill/resolve/ResolveCore.scala +++ b/main/resolve/src/mill/resolve/ResolveCore.scala @@ -240,31 +240,30 @@ private object ResolveCore { } def resolveTransitiveChildren( - rootModule: BaseModule, - cls: Class[_], - nameOpt: Option[String], - segments: Segments, - typePattern: Seq[String] + rootModule: BaseModule, + cls: Class[_], + nameOpt: Option[String], + segments: Segments, + typePattern: Seq[String] ): Either[String, Set[Resolved]] = { - val direct = - resolveDirectChildren(rootModule, cls, nameOpt, segments, typePattern) - direct.flatMap { direct => - for { - directTraverse <- - resolveDirectChildren(rootModule, cls, nameOpt, segments, Nil) - indirect0 = directTraverse - .collect { case m: Resolved.Module => - resolveTransitiveChildren( - rootModule, - m.cls, - nameOpt, - m.segments, - typePattern - ) - } - indirect <- EitherOps.sequence(indirect0).map(_.flatten) - } yield direct ++ indirect + val direct = resolveDirectChildren(rootModule, cls, nameOpt, segments, typePattern) + val directTraverse = resolveDirectChildren(rootModule, cls, nameOpt, segments, Nil) + + val indirect0 = directTraverse match { + case Right(modules) => + modules.flatMap { + case m: Resolved.Module => + // TODO: Add cycle detection here + Some(resolveTransitiveChildren(rootModule, m.cls, nameOpt, m.segments, typePattern)) + case _ => None + } + case Left(err) => Seq(Left(err)) } + + for { + d <- direct + i <- EitherOps.sequence(indirect0).map(_.flatten) + } yield d ++ i } private def resolveParents(c: Class[_]): Seq[Class[_]] = @@ -318,21 +317,18 @@ private object ResolveCore { } } else Right(Nil) - crossesOrErr.flatMap { crosses => - val filteredCrosses = crosses.filter { c => + for { + crosses <- crossesOrErr + filteredCrosses = crosses.filter { c => classMatchesTypePred(typePattern)(c.cls) } - - resolveDirectChildren0(rootModule, segments, cls, nameOpt, typePattern) - .map( - _.map { - case (Resolved.Module(s, cls), _) => Resolved.Module(segments ++ s, cls) - case (Resolved.NamedTask(s), _) => Resolved.NamedTask(segments ++ s) - case (Resolved.Command(s), _) => Resolved.Command(segments ++ s) - } - .toSet - .++(filteredCrosses) - ) + direct <- resolveDirectChildren0(rootModule, segments, cls, nameOpt, typePattern) + } yield { + direct.map { + case (Resolved.Module(s, cls), _) => Resolved.Module(segments ++ s, cls) + case (Resolved.NamedTask(s), _) => Resolved.NamedTask(segments ++ s) + case (Resolved.Command(s), _) => Resolved.Command(segments ++ s) + }.toSet ++ filteredCrosses } } From 1f0675b74a0a0352704f4ba50416986ec0baa909 Mon Sep 17 00:00:00 2001 From: Myyk Seok <2080820+myyk@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:24:46 +0800 Subject: [PATCH 02/10] test: add test to detect bug for https://github.com/com-lihaoyi/mill/issues/3715 --- .../test/src/mill/main/ResolveTests.scala | 23 +++++++++ main/test/src/mill/util/TestGraphs.scala | 47 +++++++++++++++++++ .../mill/scalalib/internal/ModuleUtils.scala | 2 +- 3 files changed, 71 insertions(+), 1 deletion(-) diff --git a/main/resolve/test/src/mill/main/ResolveTests.scala b/main/resolve/test/src/mill/main/ResolveTests.scala index 8c3c1718bac..0683ee9de7f 100644 --- a/main/resolve/test/src/mill/main/ResolveTests.scala +++ b/main/resolve/test/src/mill/main/ResolveTests.scala @@ -1110,5 +1110,28 @@ object ResolveTests extends TestSuite { Right(Set(_.concrete.tests.inner.foo, _.concrete.tests.inner.innerer.bar)) ) } + test("cyclicModuleRefInitError") { + val check = new Checker(cyclicModuleRefInitError) + test - check( + "__", + Left( + "blah blah blah." // TODO: complete this + ) + ) + } + test("nonCyclicModules") { + val check = new Checker(nonCyclicModules) + test - check( + "__", + Right(Set()) // TODO: complete this + ) + } + test("moduleRefWithNonModuleRefChild") { + val check = new Checker(moduleRefWithNonModuleRefChild) + test - check( + "__", + Right(Set()) // TODO: complete this + ) + } } } diff --git a/main/test/src/mill/util/TestGraphs.scala b/main/test/src/mill/util/TestGraphs.scala index 8ca8c563c87..25fc0b74e3f 100644 --- a/main/test/src/mill/util/TestGraphs.scala +++ b/main/test/src/mill/util/TestGraphs.scala @@ -222,6 +222,53 @@ class TestGraphs() { override lazy val millDiscover = Discover[this.type] } + object cyclicModuleRefInitError extends TestBaseModule { + import mill.Agg + + // See issue: https://github.com/com-lihaoyi/mill/issues/3715 + trait CommonModule extends TestBaseModule { + def moduleDeps: Seq[CommonModule] = Seq.empty + def a = myA + def b = myB + } + + object myA extends A + trait A extends CommonModule + object myB extends B + trait B extends CommonModule { + override def moduleDeps = super.moduleDeps ++ Agg(a) + } + } + + // The module names repeat, but it's not actually cyclic and is meant to confuse the cycle detection. + object nonCyclicModules extends TestBaseModule { + object A extends TestBaseModule { + def b = B + } + object B extends TestBaseModule { + object A extends TestBaseModule { + def b = B + } + def a = A + + object B extends TestBaseModule { + object B extends TestBaseModule {} + object A extends TestBaseModule { + def b = B + } + def a = A + } + } + } + + // This edge case shouldn't be an error + object moduleRefWithNonModuleRefChild extends TestBaseModule { + def aRef = A + def a = ModuleRef(A) + + object A extends TestBaseModule {} + } + object overrideModule extends TestBaseModule { trait Base extends Module { lazy val inner: BaseInnerModule = new BaseInnerModule {} diff --git a/scalalib/src/mill/scalalib/internal/ModuleUtils.scala b/scalalib/src/mill/scalalib/internal/ModuleUtils.scala index 54d9f82ae1c..017d2d29c49 100644 --- a/scalalib/src/mill/scalalib/internal/ModuleUtils.scala +++ b/scalalib/src/mill/scalalib/internal/ModuleUtils.scala @@ -25,7 +25,7 @@ object ModuleUtils { * @param deps A function provided the direct dependencies * @throws BuildScriptException if there were cycles in the dependencies */ - // FIMXE: Remove or consolidate with copy in ZincModuleImpl + // FIMXE: Remove or consolidate with copy in ZincWorkerImpl def recursive[T](name: String, start: T, deps: T => Seq[T]): Seq[T] = { @tailrec def rec( From 9fce280cf8c19d90d4ac36a0936586e1707c9cc3 Mon Sep 17 00:00:00 2001 From: Myyk Seok <2080820+myyk@users.noreply.github.com> Date: Wed, 30 Oct 2024 16:15:54 +0800 Subject: [PATCH 03/10] feat: detect some cyclic references in resolve --- .../src/mill/resolve/ResolveCore.scala | 47 ++++++++++++------- .../test/src/mill/main/ResolveTests.scala | 8 ++-- main/test/src/mill/util/TestGraphs.scala | 12 ++--- 3 files changed, 39 insertions(+), 28 deletions(-) diff --git a/main/resolve/src/mill/resolve/ResolveCore.scala b/main/resolve/src/mill/resolve/ResolveCore.scala index 604d9737a15..69a834be633 100644 --- a/main/resolve/src/mill/resolve/ResolveCore.scala +++ b/main/resolve/src/mill/resolve/ResolveCore.scala @@ -100,7 +100,8 @@ private object ResolveCore { m.cls, None, current.segments, - Nil + Nil, + Set.empty // TODO: We should pass the seenModules set ) transitiveOrErr.map(transitive => self ++ transitive) @@ -122,7 +123,8 @@ private object ResolveCore { m.cls, None, current.segments, - typePattern + typePattern, + Set.empty // TODO: We should pass the seenModules set ) transitiveOrErr.map(transitive => self ++ transitive) @@ -244,26 +246,37 @@ private object ResolveCore { cls: Class[_], nameOpt: Option[String], segments: Segments, - typePattern: Seq[String] + typePattern: Seq[String], + seenModules: Set[Class[_]], ): Either[String, Set[Resolved]] = { - val direct = resolveDirectChildren(rootModule, cls, nameOpt, segments, typePattern) + val errOrDirect = resolveDirectChildren(rootModule, cls, nameOpt, segments, typePattern) val directTraverse = resolveDirectChildren(rootModule, cls, nameOpt, segments, Nil) - val indirect0 = directTraverse match { - case Right(modules) => - modules.flatMap { - case m: Resolved.Module => - // TODO: Add cycle detection here - Some(resolveTransitiveChildren(rootModule, m.cls, nameOpt, m.segments, typePattern)) - case _ => None - } - case Left(err) => Seq(Left(err)) + val errOrModules = directTraverse.map { modules => + modules.flatMap { + case m: Resolved.Module => Some(m) + case _ => None + } } - for { - d <- direct - i <- EitherOps.sequence(indirect0).map(_.flatten) - } yield d ++ i + if (seenModules.contains(cls)) { + Left(s"Cyclic module reference detected: ${cls.getName}, it's required to wrap it in ModuleRef. See documentation: https://mill-build.org/mill/0.12.1/fundamentals/modules.html#_abstract_modules_references") + } else { + val errOrIndirect0 = errOrModules match { + case Right(modules) => + modules.flatMap { m => + Some(resolveTransitiveChildren(rootModule, m.cls, nameOpt, m.segments, typePattern, seenModules + cls)) + } + case Left(err) => Seq(Left(err)) + } + + val errOrIndirect = EitherOps.sequence(errOrIndirect0).map(_.flatten) + + for { + direct <- errOrDirect + indirect <- errOrIndirect + } yield direct ++ indirect + } } private def resolveParents(c: Class[_]): Seq[Class[_]] = diff --git a/main/resolve/test/src/mill/main/ResolveTests.scala b/main/resolve/test/src/mill/main/ResolveTests.scala index 0683ee9de7f..247c2284a9d 100644 --- a/main/resolve/test/src/mill/main/ResolveTests.scala +++ b/main/resolve/test/src/mill/main/ResolveTests.scala @@ -1112,11 +1112,9 @@ object ResolveTests extends TestSuite { } test("cyclicModuleRefInitError") { val check = new Checker(cyclicModuleRefInitError) - test - check( - "__", - Left( - "blah blah blah." // TODO: complete this - ) + test - check.checkSeq0( + Seq("__"), + isShortError(_, "Cyclic module reference detected") ) } test("nonCyclicModules") { diff --git a/main/test/src/mill/util/TestGraphs.scala b/main/test/src/mill/util/TestGraphs.scala index 25fc0b74e3f..d79a7cf5e8b 100644 --- a/main/test/src/mill/util/TestGraphs.scala +++ b/main/test/src/mill/util/TestGraphs.scala @@ -242,18 +242,18 @@ class TestGraphs() { // The module names repeat, but it's not actually cyclic and is meant to confuse the cycle detection. object nonCyclicModules extends TestBaseModule { - object A extends TestBaseModule { + object A extends Module { def b = B } - object B extends TestBaseModule { - object A extends TestBaseModule { + object B extends Module { + object A extends Module { def b = B } def a = A - object B extends TestBaseModule { - object B extends TestBaseModule {} - object A extends TestBaseModule { + object B extends Module { + object B extends Module {} + object A extends Module { def b = B } def a = A From 8099efe139e5a1b7acb97d3822a7182af75311cc Mon Sep 17 00:00:00 2001 From: Myyk Seok <2080820+myyk@users.noreply.github.com> Date: Wed, 30 Oct 2024 16:43:57 +0800 Subject: [PATCH 04/10] test: fix the new tests --- .../test/src/mill/main/ResolveTests.scala | 10 +- main/test/src/mill/util/TestGraphs.scala | 97 ++++++++++--------- 2 files changed, 55 insertions(+), 52 deletions(-) diff --git a/main/resolve/test/src/mill/main/ResolveTests.scala b/main/resolve/test/src/mill/main/ResolveTests.scala index 247c2284a9d..344556a561e 100644 --- a/main/resolve/test/src/mill/main/ResolveTests.scala +++ b/main/resolve/test/src/mill/main/ResolveTests.scala @@ -1111,24 +1111,24 @@ object ResolveTests extends TestSuite { ) } test("cyclicModuleRefInitError") { - val check = new Checker(cyclicModuleRefInitError) + val check = new Checker(TestGraphs.CyclicModuleRefInitError) test - check.checkSeq0( Seq("__"), isShortError(_, "Cyclic module reference detected") ) } test("nonCyclicModules") { - val check = new Checker(nonCyclicModules) + val check = new Checker(TestGraphs.NonCyclicModules) test - check( "__", - Right(Set()) // TODO: complete this + Right(Set(_.foo)) ) } test("moduleRefWithNonModuleRefChild") { - val check = new Checker(moduleRefWithNonModuleRefChild) + val check = new Checker(TestGraphs.ModuleRefWithNonModuleRefChild) test - check( "__", - Right(Set()) // TODO: complete this + Right(Set(_.foo)) ) } } diff --git a/main/test/src/mill/util/TestGraphs.scala b/main/test/src/mill/util/TestGraphs.scala index d79a7cf5e8b..473c8b06e11 100644 --- a/main/test/src/mill/util/TestGraphs.scala +++ b/main/test/src/mill/util/TestGraphs.scala @@ -222,53 +222,6 @@ class TestGraphs() { override lazy val millDiscover = Discover[this.type] } - object cyclicModuleRefInitError extends TestBaseModule { - import mill.Agg - - // See issue: https://github.com/com-lihaoyi/mill/issues/3715 - trait CommonModule extends TestBaseModule { - def moduleDeps: Seq[CommonModule] = Seq.empty - def a = myA - def b = myB - } - - object myA extends A - trait A extends CommonModule - object myB extends B - trait B extends CommonModule { - override def moduleDeps = super.moduleDeps ++ Agg(a) - } - } - - // The module names repeat, but it's not actually cyclic and is meant to confuse the cycle detection. - object nonCyclicModules extends TestBaseModule { - object A extends Module { - def b = B - } - object B extends Module { - object A extends Module { - def b = B - } - def a = A - - object B extends Module { - object B extends Module {} - object A extends Module { - def b = B - } - def a = A - } - } - } - - // This edge case shouldn't be an error - object moduleRefWithNonModuleRefChild extends TestBaseModule { - def aRef = A - def a = ModuleRef(A) - - object A extends TestBaseModule {} - } - object overrideModule extends TestBaseModule { trait Base extends Module { lazy val inner: BaseInnerModule = new BaseInnerModule {} @@ -714,4 +667,54 @@ object TestGraphs { } } + object CyclicModuleRefInitError extends TestBaseModule { + import mill.Agg + + // See issue: https://github.com/com-lihaoyi/mill/issues/3715 + trait CommonModule extends TestBaseModule { + def moduleDeps: Seq[CommonModule] = Seq.empty + def a = myA + def b = myB + } + + object myA extends A + trait A extends CommonModule + object myB extends B + trait B extends CommonModule { + override def moduleDeps = super.moduleDeps ++ Agg(a) + } + } + + // The module names repeat, but it's not actually cyclic and is meant to confuse the cycle detection. + object NonCyclicModules extends TestBaseModule { + def foo = Task { "foo" } + + object A extends Module { + def b = B + } + object B extends Module { + object A extends Module { + def b = B + } + def a = A + + object B extends Module { + object B extends Module {} + object A extends Module { + def b = B + } + def a = A + } + } + } + + // This edge case shouldn't be an error + object ModuleRefWithNonModuleRefChild extends TestBaseModule { + def foo = Task { "foo" } + + def aRef = A + def a = ModuleRef(A) + + object A extends TestBaseModule {} + } } From 7688b395605b2babeefde9d9721378b23f2c1bb2 Mon Sep 17 00:00:00 2001 From: Myyk Seok <2080820+myyk@users.noreply.github.com> Date: Wed, 30 Oct 2024 16:51:01 +0800 Subject: [PATCH 05/10] test: add a couple more tests --- .../resolve/test/src/mill/main/ResolveTests.scala | 14 ++++++++++++++ main/test/src/mill/util/TestGraphs.scala | 15 +++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/main/resolve/test/src/mill/main/ResolveTests.scala b/main/resolve/test/src/mill/main/ResolveTests.scala index 344556a561e..be7abe734db 100644 --- a/main/resolve/test/src/mill/main/ResolveTests.scala +++ b/main/resolve/test/src/mill/main/ResolveTests.scala @@ -1117,6 +1117,20 @@ object ResolveTests extends TestSuite { isShortError(_, "Cyclic module reference detected") ) } + test("cyclicModuleRefInitError2") { + val check = new Checker(TestGraphs.CyclicModuleRefInitError2) + test - check.checkSeq0( + Seq("__"), + isShortError(_, "Cyclic module reference detected") + ) + } + test("cyclicModuleRefInitError3") { + val check = new Checker(TestGraphs.CyclicModuleRefInitError3) + test - check.checkSeq0( + Seq("__"), + isShortError(_, "Cyclic module reference detected") + ) + } test("nonCyclicModules") { val check = new Checker(TestGraphs.NonCyclicModules) test - check( diff --git a/main/test/src/mill/util/TestGraphs.scala b/main/test/src/mill/util/TestGraphs.scala index 473c8b06e11..c127d338152 100644 --- a/main/test/src/mill/util/TestGraphs.scala +++ b/main/test/src/mill/util/TestGraphs.scala @@ -685,6 +685,21 @@ object TestGraphs { } } + object CyclicModuleRefInitError2 extends TestBaseModule { + // The cycle is in the child + def A = CyclicModuleRefInitError + } + + object CyclicModuleRefInitError3 extends TestBaseModule { + // The cycle is in directly here + object A extends Module { + def b = B + } + object B extends Module { + def a = A + } + } + // The module names repeat, but it's not actually cyclic and is meant to confuse the cycle detection. object NonCyclicModules extends TestBaseModule { def foo = Task { "foo" } From a4ae8d65ada3b57d929f2c455e464926a7f7342d Mon Sep 17 00:00:00 2001 From: Myyk Seok <2080820+myyk@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:02:18 +0800 Subject: [PATCH 06/10] test: add cycle in a cross test case --- .../resolve/test/src/mill/main/ResolveTests.scala | 7 +++++++ main/test/src/mill/util/TestGraphs.scala | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/main/resolve/test/src/mill/main/ResolveTests.scala b/main/resolve/test/src/mill/main/ResolveTests.scala index be7abe734db..579e9ce2a2b 100644 --- a/main/resolve/test/src/mill/main/ResolveTests.scala +++ b/main/resolve/test/src/mill/main/ResolveTests.scala @@ -1131,6 +1131,13 @@ object ResolveTests extends TestSuite { isShortError(_, "Cyclic module reference detected") ) } + test("crossedCyclicModuleRefInitError") { + val check = new Checker(TestGraphs.CrossedCyclicModuleRefInitError) + test - check.checkSeq0( + Seq("__"), + isShortError(_, "Cyclic module reference detected") + ) + } test("nonCyclicModules") { val check = new Checker(TestGraphs.NonCyclicModules) test - check( diff --git a/main/test/src/mill/util/TestGraphs.scala b/main/test/src/mill/util/TestGraphs.scala index c127d338152..31bdee150ea 100644 --- a/main/test/src/mill/util/TestGraphs.scala +++ b/main/test/src/mill/util/TestGraphs.scala @@ -700,6 +700,21 @@ object TestGraphs { } } + object CrossedCyclicModuleRefInitError extends TestBaseModule { + object cross extends mill.Cross[Cross]("210", "211", "212") + trait Cross extends Cross.Module[String] { + def suffix = Task { crossValue } + def c2 = cross2 + } + + object cross2 extends mill.Cross[Cross2]("210", "211", "212") + trait Cross2 extends Cross.Module[String] { + override def millSourcePath = super.millSourcePath / crossValue + def suffix = Task { crossValue } + def c1 = cross + } + } + // The module names repeat, but it's not actually cyclic and is meant to confuse the cycle detection. object NonCyclicModules extends TestBaseModule { def foo = Task { "foo" } From 22dd5ce39854f3a0e631766f3a1142b0921c5768 Mon Sep 17 00:00:00 2001 From: Myyk Seok <2080820+myyk@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:11:44 +0800 Subject: [PATCH 07/10] test: add another ModuleRef cycle test --- main/resolve/test/src/mill/main/ResolveTests.scala | 7 +++++++ main/test/src/mill/util/TestGraphs.scala | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/main/resolve/test/src/mill/main/ResolveTests.scala b/main/resolve/test/src/mill/main/ResolveTests.scala index 579e9ce2a2b..7ffd361063c 100644 --- a/main/resolve/test/src/mill/main/ResolveTests.scala +++ b/main/resolve/test/src/mill/main/ResolveTests.scala @@ -1152,5 +1152,12 @@ object ResolveTests extends TestSuite { Right(Set(_.foo)) ) } + test("moduleRefCycle") { + val check = new Checker(TestGraphs.ModuleRefCycle) + test - check( + "__", + Right(Set(_.foo)) + ) + } } } diff --git a/main/test/src/mill/util/TestGraphs.scala b/main/test/src/mill/util/TestGraphs.scala index 31bdee150ea..be6ac674de9 100644 --- a/main/test/src/mill/util/TestGraphs.scala +++ b/main/test/src/mill/util/TestGraphs.scala @@ -747,4 +747,16 @@ object TestGraphs { object A extends TestBaseModule {} } + + object ModuleRefCycle extends TestBaseModule { + def foo = Task { "foo" } + + // The cycle is in directly here + object A extends Module { + def b = ModuleRef(B) + } + object B extends Module { + def a = ModuleRef(A) + } + } } From 01e0a869864a1d8cdae90d949d3c7bcdd52bca2d Mon Sep 17 00:00:00 2001 From: Myyk Seok <2080820+myyk@users.noreply.github.com> Date: Thu, 31 Oct 2024 11:51:56 +0800 Subject: [PATCH 08/10] chore: small cleanup before PR --- main/resolve/src/mill/resolve/ResolveCore.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main/resolve/src/mill/resolve/ResolveCore.scala b/main/resolve/src/mill/resolve/ResolveCore.scala index 69a834be633..25a05b5cdc3 100644 --- a/main/resolve/src/mill/resolve/ResolveCore.scala +++ b/main/resolve/src/mill/resolve/ResolveCore.scala @@ -101,7 +101,7 @@ private object ResolveCore { None, current.segments, Nil, - Set.empty // TODO: We should pass the seenModules set + Set.empty ) transitiveOrErr.map(transitive => self ++ transitive) @@ -124,7 +124,7 @@ private object ResolveCore { None, current.segments, typePattern, - Set.empty // TODO: We should pass the seenModules set + Set.empty ) transitiveOrErr.map(transitive => self ++ transitive) @@ -341,7 +341,8 @@ private object ResolveCore { case (Resolved.Module(s, cls), _) => Resolved.Module(segments ++ s, cls) case (Resolved.NamedTask(s), _) => Resolved.NamedTask(segments ++ s) case (Resolved.Command(s), _) => Resolved.Command(segments ++ s) - }.toSet ++ filteredCrosses + } + .toSet ++ filteredCrosses } } From 78ab6ca064568cc4ad095e83e0382723c6569392 Mon Sep 17 00:00:00 2001 From: Myyk Seok <2080820+myyk@users.noreply.github.com> Date: Thu, 31 Oct 2024 11:55:45 +0800 Subject: [PATCH 09/10] chore: split out change in ModuleUtils to it's own branch --- scalalib/src/mill/scalalib/internal/ModuleUtils.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scalalib/src/mill/scalalib/internal/ModuleUtils.scala b/scalalib/src/mill/scalalib/internal/ModuleUtils.scala index 017d2d29c49..54d9f82ae1c 100644 --- a/scalalib/src/mill/scalalib/internal/ModuleUtils.scala +++ b/scalalib/src/mill/scalalib/internal/ModuleUtils.scala @@ -25,7 +25,7 @@ object ModuleUtils { * @param deps A function provided the direct dependencies * @throws BuildScriptException if there were cycles in the dependencies */ - // FIMXE: Remove or consolidate with copy in ZincWorkerImpl + // FIMXE: Remove or consolidate with copy in ZincModuleImpl def recursive[T](name: String, start: T, deps: T => Seq[T]): Seq[T] = { @tailrec def rec( From a13ee360919abaeb6a37e0c9486f93fcbd9a351d Mon Sep 17 00:00:00 2001 From: Myyk Seok <2080820+myyk@users.noreply.github.com> Date: Fri, 1 Nov 2024 13:17:20 +0800 Subject: [PATCH 10/10] chore: remove link from error message in ResolveCore --- main/resolve/src/mill/resolve/ResolveCore.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/resolve/src/mill/resolve/ResolveCore.scala b/main/resolve/src/mill/resolve/ResolveCore.scala index 25a05b5cdc3..86b5e4b1605 100644 --- a/main/resolve/src/mill/resolve/ResolveCore.scala +++ b/main/resolve/src/mill/resolve/ResolveCore.scala @@ -260,7 +260,7 @@ private object ResolveCore { } if (seenModules.contains(cls)) { - Left(s"Cyclic module reference detected: ${cls.getName}, it's required to wrap it in ModuleRef. See documentation: https://mill-build.org/mill/0.12.1/fundamentals/modules.html#_abstract_modules_references") + Left(s"Cyclic module reference detected: ${cls.getName}, it's required to wrap it in ModuleRef.") } else { val errOrIndirect0 = errOrModules match { case Right(modules) =>