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

Logical loops in moduleDeps #2341

Closed
tballard opened this issue Mar 3, 2023 · 2 comments · Fixed by #2790
Closed

Logical loops in moduleDeps #2341

tballard opened this issue Mar 3, 2023 · 2 comments · Fixed by #2790
Milestone

Comments

@tballard
Copy link

tballard commented Mar 3, 2023

It appears that logical loops in moduleDeps are rewarded with a hearty stack trace as of 10.9. An error message with a list of the modules in the loop(s) would be the right thing, I suppose.

@lefou
Copy link
Member

lefou commented Mar 4, 2023

Can you please provide a reproduction?

@lefou lefou added the feedback wanted Additional feedback or testing is apreciated label Mar 4, 2023
@tballard
Copy link
Author

tballard commented Mar 4, 2023

Sure:

import mill.scalalib._
import mill.define.Task

object a extends ScalaModule() {
   override def moduleDeps = Seq(a)

   override def scalaVersion = "2.13.7"
}
> mill a.compile
yields:

Caused by: java.lang.StackOverflowError
	at ammonite.$file.build$a$.moduleDeps(build.sc:5)
	at mill.scalalib.JavaModule.recursiveModuleDeps(JavaModule.scala:155)
	at mill.scalalib.JavaModule.recursiveModuleDeps$(JavaModule.scala:154)
	at ammonite.$file.build$a$.recursiveModuleDeps(build.sc:4)
	at mill.scalalib.JavaModule.transitiveModuleDeps(JavaModule.scala:160)
	at mill.scalalib.JavaModule.transitiveModuleDeps$(JavaModule.scala:159)
	at ammonite.$file.build$a$.transitiveModuleDeps(build.sc:4)
	at mill.scalalib.JavaModule.$anonfun$recursiveModuleDeps$1(JavaModule.scala:155)
	at scala.collection.immutable.List.flatMap(List.scala:293)
	at scala.collection.immutable.List.flatMap(List.scala:79)
	at mill.scalalib.JavaModule.recursiveModuleDeps(JavaModule.scala:155)
	at mill.scalalib.JavaModule.recursiveModuleDeps$(JavaModule.scala:154)
	at ammonite.$file.build$a$.recursiveModuleDeps(build.sc:4)
	at mill.scalalib.JavaModule.transitiveModuleDeps(JavaModule.scala:160)
	at mill.scalalib.JavaModule.transitiveModuleDeps$(JavaModule.scala:159)
	at ammonite.$file.build$a$.transitiveModuleDeps(build.sc:4)
	at mill.scalalib.JavaModule.$anonfun$recursiveModuleDeps$1(JavaModule.scala:155)
	at scala.collection.immutable.List.flatMap(List.scala:293)
	at scala.collection.immutable.List.flatMap(List.scala:79)
	at mill.scalalib.JavaModule.recursiveModuleDeps(JavaModule.scala:155)
	at mill.scalalib.JavaModule.recursiveModuleDeps$(JavaModule.scala:154)
	at ammonite.$file.build$a$.recursiveModuleDeps(build.sc:4)
	at mill.scalalib.JavaModule.transitiveModuleDeps(JavaModule.scala:160)
	at mill.scalalib.JavaModule.transitiveModuleDeps$(JavaModule.scala:159)
	at ammonite.$file.build$a$.transitiveModuleDeps(build.sc:4)
	at mill.scalalib.JavaModule.$anonfun$recursiveModuleDeps$1(JavaModule.scala:155)
	at scala.collection.immutable.List.flatMap(List.scala:293)
	at scala.collection.immutable.List.flatMap(List.scala:79)
	at mill.scalalib.JavaModule.recursiveModuleDeps(JavaModule.scala:155)
	at mill.scalalib.JavaModule.recursiveModuleDeps$(JavaModule.scala:154)
	at ammonite.$file.build$a$.recursiveModuleDeps(build.sc:4)
	at mill.scalalib.JavaModule.transitiveModuleDeps(JavaModule.scala:160)
	at mill.scalalib.JavaModule.transitiveModuleDeps$(JavaModule.scala:159)
	at ammonite.$file.build$a$.transitiveModuleDeps(build.sc:4)
	at mill.scalalib.JavaModule.$anonfun$recursiveModuleDeps$1(JavaModule.scala:155)
	at scala.collection.immutable.List.flatMap(List.scala:293)
	at scala.collection.immutable.List.flatMap(List.scala:79)
	at mill.scalalib.JavaModule.recursiveModuleDeps(JavaModule.scala:155)

until the stack chokes

@lefou lefou removed the feedback wanted Additional feedback or testing is apreciated label Mar 4, 2023
lefou added a commit to lefou/mill that referenced this issue Mar 8, 2023
lefou added a commit to lefou/mill that referenced this issue Mar 12, 2023
lefou added a commit to lefou/mill that referenced this issue Apr 6, 2023
lefou added a commit to lefou/mill that referenced this issue Apr 6, 2023
lefou added a commit that referenced this issue Sep 27, 2023
lefou added a commit that referenced this issue Sep 27, 2023
@lefou lefou added this to the 0.11.5 milestone Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants