Skip to content

ClassCastException when using --import with 0.11.3 #2749

Closed
@ckipp01

Description

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 the mill-github-dependency-graph:

❯ mill --no-server --import ivy:io.chris-kipp::mill-github-dependency-graph::0.2.6 io.kipp.mill.github.dependency.graph.Graph/generate
[build.sc] [48/52] compile
[info] compiling 1 Scala source to /Users/ckipp/Documents/scala-workspace/bloop-config/out/mill-build/compile.dest/classes ...
[info] done compiling
[build.sc] [52/52] methodCodeHashSignatures
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at mill.main.client.IsolatedMillMainLoader.runMain(IsolatedMillMainLoader.java:58)
        at mill.main.client.MillClientMain.main(MillClientMain.java:64)
Caused by: java.lang.ClassCastException: class scala.collection.immutable.$colon$colon cannot be cast to class scala.Tuple2 (scala.collection.immutable.$colon$colon and scala.Tuple2 are in unnamed module of loader 'app')
        at scala.collection.Iterator$$anon$10.nextCur(Iterator.scala:594)
        at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:608)
        at scala.collection.immutable.List.prependedAll(List.scala:152)
        at scala.collection.immutable.List$.from(List.scala:684)
        at scala.collection.immutable.List$.from(List.scala:681)
        at scala.collection.IterableFactory$Delegate.from(Factory.scala:288)
        at scala.collection.immutable.Iterable$.from(Iterable.scala:35)
        at scala.collection.immutable.Iterable$.from(Iterable.scala:32)
        at scala.collection.IterableFactory$Delegate.from(Factory.scala:288)
        at scala.collection.IterableOps.flatMap(Iterable.scala:684)
        at scala.collection.IterableOps.flatMap$(Iterable.scala:684)
        at scala.collection.AbstractIterable.flatMap(Iterable.scala:933)
        at mill.resolve.Resolve.resolveNonEmptyAndHandle(Resolve.scala:230)
        at mill.resolve.Resolve.resolveNonEmptyAndHandle$(Resolve.scala:223)
        at mill.resolve.Resolve$Tasks$.resolveNonEmptyAndHandle(Resolve.scala:34)
        at mill.resolve.Resolve.$anonfun$resolve0$4(Resolve.scala:207)
        at scala.util.Either.map(Either.scala:382)
        at mill.resolve.Resolve.$anonfun$resolve0$3(Resolve.scala:206)
        at scala.collection.immutable.List.map(List.scala:246)
        at scala.collection.immutable.List.map(List.scala:79)
        at mill.resolve.Resolve.$anonfun$resolve0$2(Resolve.scala:205)
        at scala.collection.immutable.List.map(List.scala:246)
        at scala.collection.immutable.List.map(List.scala:79)
        at mill.resolve.Resolve.$anonfun$resolve0$1(Resolve.scala:204)
        at scala.util.Either.flatMap(Either.scala:352)
        at mill.resolve.Resolve.resolve0(Resolve.scala:203)
        at mill.resolve.Resolve.resolve0$(Resolve.scala:197)
        at mill.resolve.Resolve$Tasks$.resolve0(Resolve.scala:34)
        at mill.resolve.Resolve.resolve(Resolve.scala:194)
        at mill.resolve.Resolve.resolve$(Resolve.scala:189)
        at mill.resolve.Resolve$Tasks$.resolve(Resolve.scala:34)
        at mill.main.RunScript$.$anonfun$evaluateTasksNamed$1(RunScript.scala:24)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at mill.main.RunScript$.evaluateTasksNamed(RunScript.scala:24)
        at mill.runner.MillBuildBootstrap$.evaluateWithWatches(MillBuildBootstrap.scala:397)
        at mill.runner.MillBuildBootstrap.$anonfun$processFinalTargets$3(MillBuildBootstrap.scala:307)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at mill.runner.MillBuildBootstrap.processFinalTargets(MillBuildBootstrap.scala:307)
        at mill.runner.MillBuildBootstrap.evaluateRec(MillBuildBootstrap.scala:195)
        at mill.runner.MillBuildBootstrap.evaluate(MillBuildBootstrap.scala:47)
        at mill.runner.MillMain$.$anonfun$main0$6(MillMain.scala:213)
        at mill.runner.Watching$.watchLoop(Watching.scala:27)
        at mill.runner.MillMain$.$anonfun$main0$1(MillMain.scala:198)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at scala.Console$.withErr(Console.scala:193)
        at mill.api.SystemStreams$.$anonfun$withStreams$2(SystemStreams.scala:62)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at scala.Console$.withOut(Console.scala:164)
        at mill.api.SystemStreams$.$anonfun$withStreams$1(SystemStreams.scala:61)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at scala.Console$.withIn(Console.scala:227)
        at mill.api.SystemStreams$.withStreams(SystemStreams.scala:60)
        at mill.runner.MillMain$.main0(MillMain.scala:80)
        at mill.runner.MillMain$.main(MillMain.scala:58)
        at mill.runner.MillMain.main(MillMain.scala)
        ... 6 more

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions