Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

dependencyTree only prints the module itself (no dependencies) #176

Open
pmpfr opened this issue Feb 7, 2019 · 3 comments
Open

dependencyTree only prints the module itself (no dependencies) #176

pmpfr opened this issue Feb 7, 2019 · 3 comments

Comments

@pmpfr
Copy link

pmpfr commented Feb 7, 2019

Under sbt 0.13.17; sbt-dependency-draph 0.9.2, a multi-module project:

> Common/dependencyTree
[info] com.ocado.cfc.vectortests:common_2.12:0ec6cb226ed46262f97474689f421a5a9a4f2305-SNAPSHOT-pmpfr-snyk
[success] Total time: 0 s, completed 07-Feb-2019 17:47:46

If run on the root project, it prints one line for each module and still thinks nothing depends on anything. If I downgrade to 0.8.2 it works fine.

Superficially similar to #171 except the output is one line rather than no line and different sbt versions.

Tomorrow I may try to find a more minimal reproduction.

@pmpfr
Copy link
Author

pmpfr commented Feb 11, 2019

Getting a neat, reliable reproduction case is hard. Whether it works or not is not referentially transparent: it depends on the sequence of sbt commands with the same/different build config. But it appears to come down to setting:
updateOptions := updateOptions.value.withCachedResolution(true)

(Possibly also interacting with dependencyOverrides += "io.netty" % "netty" % "3.9.2.Final" but I think the latter may be a red herring and just an example of "changing something which makes the build different" and I think enabling cached resolution alone is enough.)

@justinpitts
Copy link

justinpitts commented Feb 27, 2019

I'm reproducing this.

sbt 0.13.18
plugin version 0.9.2

Confirming that cached resolution behaves the same for me.

Additionally, dependencyGraph yields:

java.util.NoSuchElementException: key not found: ModuleId(org.scala-sbt.temp,temp-resolve-e35e879ea6119130013c08ef868b3b683bb1a52c,1.0) at scala.collection.MapLike$class.default(MapLike.scala:228) at scala.collection.AbstractMap.default(Map.scala:58) at scala.collection.MapLike$class.apply(MapLike.scala:141) at scala.collection.AbstractMap.apply(Map.scala:58) at net.virtualvoid.sbt.graph.ModuleGraph.module(model.scala:51) at net.virtualvoid.sbt.graph.rendering.AsciiGraph$$anonfun$2.apply(AsciiGraph.scala:37) at net.virtualvoid.sbt.graph.rendering.AsciiGraph$$anonfun$2.apply(AsciiGraph.scala:37) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.immutable.List.foreach(List.scala:318) at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) at scala.collection.AbstractTraversable.map(Traversable.scala:105) at net.virtualvoid.sbt.graph.rendering.AsciiGraph$.buildAsciiGraph(AsciiGraph.scala:37) at net.virtualvoid.sbt.graph.rendering.AsciiGraph$.asciiGraph(AsciiGraph.scala:26) at net.virtualvoid.sbt.graph.rendering.AsciiGraph$$anonfun$asciiGraphSetttings$2$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$3.apply(AsciiGraph.scala:47) at net.virtualvoid.sbt.graph.rendering.AsciiGraph$$anonfun$asciiGraphSetttings$2$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$3.apply(AsciiGraph.scala:47) at sbt.MultiLogger.log(MultiLogger.scala:27) at sbt.Logger$class.info(Logger.scala:117) at sbt.AbstractLogger.info(Logger.scala:11) at net.virtualvoid.sbt.graph.rendering.AsciiGraph$$anonfun$asciiGraphSetttings$2$$anonfun$apply$1$$anonfun$apply$2.apply(AsciiGraph.scala:47) at net.virtualvoid.sbt.graph.rendering.AsciiGraph$$anonfun$asciiGraphSetttings$2$$anonfun$apply$1$$anonfun$apply$2.apply(AsciiGraph.scala:43) at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47) at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40) at sbt.std.Transform$$anon$4.work(System.scala:63) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17) at sbt.Execute.work(Execute.scala:237) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228) at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159) at sbt.CompletionService$$anon$2.call(CompletionService.scala:28) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) [error] (compile:dependencyGraph) java.util.NoSuchElementException: key not found: ModuleId(org.scala-sbt.temp,temp-resolve-e35e879ea6119130013c08ef868b3b683bb1a52c,1.0)

@hiber-niu
Copy link

I also stuck in this situation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants