-
-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ClassCastException
when using --import
with 0.11.3
#2749
Milestone
Comments
This is happening to my zio-temporal demo app as well (on 0.11.3... on .2 works fine).
I use some plugins as can be seen at https://github.com/carlosedp/zio-temporal-hello/blob/main/build.sc |
lihaoyi
added a commit
that referenced
this issue
Sep 18, 2023
fixes #2749 The basic problem is that the signature of `Discover.apply()` changed, but it only changed in the argument's generic type parameters, so it was nominally the same type after erasure, and accepted the `Map[Class[_], Seq]` even though it was expecting a `Map[Class[_], (Seq, Seq)]`, but later on in the code it would blow up with a `ClassCastException` This causes problems with Mill plugins containing external modules, which have their own `Discover[T]` macro pre-expanded and would not get re-compiled with the new 0.11.3 version of Mill. This PR works around the problem by adding a forwarder `Discover.apply(value: Map[Class, Seq])` that does the right thing and expands the `Seq` into a `(Seq, Seq)`, while adding a dummy paramter to `case class Discover` to avoid conflicts. A similar forwarder `Discover.<init>(value: Map[Class, Seq])` is needed to preserve binary compatibility (I think?) Tested manually via `./mill -i dev.run example/basic/1-simple-scala --import ivy:io.chris-kipp::mill-github-dependency-graph::0.2.6 io.kipp.mill.github.dependency.graph.Graph/generate`, which fails before this PR and passes after --------- Co-authored-by: Chris Kipp <ckipp@pm.me> Co-authored-by: Tobias Roeser <le.petit.fou@web.de>
Fixed in 0.11.4 |
nightscape
added a commit
to nightscape/mill-ci-release
that referenced
this issue
Sep 28, 2023
This should fix the ClassCastException during release: com-lihaoyi/mill#2749
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
With the recent release of 0.11.3 I noticed that a few of my plugins all started failing. The common thread of them seem to be that they are all using
--import
. For example you can replicate with the themill-github-dependency-graph
:You can see it happening in CI here. It is also happening with my ci-release plugins as you can see here with the same error.
Let me know if there is anything else I can provide.
The text was updated successfully, but these errors were encountered: