Open james-s-w-clark opened 3 months ago
I guess re-using public targets and commands defined elsewhere is never a good idea. Instead, you should define a new command with T.command { .. }
and call (meaning: depend on) the other command from there. E.g.:
def sayProblem(): Command[Unit] = T.command {
sayThing("encountered unrecoverable cycle resolving import")()
}
Even, better, make the sayThing
command an annonymous task with T.task { .. }
.
Unfortunately, the types are correct, therefore the compiler will not call our implicit conversions here. The proper definition of a command should always contain the T.commnad { .. }
on the left hand side, which is not the case in the definition of sayProblem
in all of your examples. That means, the commands context isn't correct.
This build.sc works OK:
This build.sc hits the titular issue:
In this short example you're pointed in the right direction (but, at least to me, it's not clear that the solution is to not have this import as in the first example).
If you move the imports around, the error changes too. Just by reordering, you could get e.g.
That's still not too bad, it still talks about
utils
at least.What if you have a bunch more imports?
We've lost the guidance towards this bad import.
How did we arrive at this bad import?
In mill 0.10.n, this is OK:
But in 0.11.m, you get:
I added
extends mill.Module
as that error lead to this suggestion at https://github.com/com-lihaoyi/mill/issues/2888#issuecomment-1822757675I couldn't find an issue when searching for
encountered unrecoverable cycle resolving import
, so at least this should help anyone who comes across the same 👍