cuplv / droidel

Framework model for static analysis of Android
Apache License 2.0
46 stars 14 forks source link

Wala error build via maven #1

Closed highwater closed 10 years ago

highwater commented 10 years ago

So I was trying this tool but unfortunately there was error test from WALA and I don't know how to fix it. What to do? Can this step be skipped? Also thanks a lot for making life much easier.

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5:39.326s
[INFO] Finished at: Sat Sep 20 09:19:49 WIB 2014
[INFO] Final Memory: 82M/394M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.14.1:test (test) on project com.ibm.wala.cast.java.polyglot.test: There are test failures.
[ERROR]
[ERROR] Please refer to /home/vip/WALA/com.ibm.wala.cast.java.polyglot.test/target/surefire-reports for the individual test results.
sblackshear commented 10 years ago

Hi Coraline, Sorry about the build issues! There should be a few different ways to fix this. First, are you building with the -DskipTests=true flag on? If so, I think that this goal will be skipped and hopefully prevent the build error.

Second, is maven using Java 7? I've seen strange errors when using different versions of Java. When I run mvn -v, I see [stuff] Java version: 1.7.0_67 [more stuff].

Third, I've also gotten the build to work by using mvn clean verify -DskipTests=true -q and manually copying the produced jars to the lib/ folder of Droidel (and removing the managed dependency on WALA from build.sbt).

Thanks for trying out the tool! It's a bit rough around the edges, but I'm very interesting in making it more usable. Please don't hesitate to report any more issues or to let me know if none of my suggested fixes work.

highwater commented 10 years ago

I managed to get it work using the default instructions on the front page (it just worked!), but another errors occurred. I checked in .m2 directory and the files exist there.

[info] Set current project to Droidel (in build file:/home/vip/droidel/)
[info] Updating {file:/home/vip/droidel/}droidel...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.ibm.wala#com.ibm.wala.shrike;1.3.4-SNAPSHOT:     Local Maven Repository: no ivy file nor artifact found for com.ibm.wala#WALA;1.3.4-SNAPSHOT
[warn]  :: com.ibm.wala#com.ibm.wala.util;1.3.4-SNAPSHOT:   Local Maven Repository: no ivy file nor artifact found for com.ibm.wala#WALA;1.3.4-SNAPSHOT
[warn]  :: com.ibm.wala#com.ibm.wala.core;1.3.4-SNAPSHOT:   Local Maven Repository: no ivy file nor artifact found for com.ibm.wala#WALA;1.3.4-SNAPSHOT
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]      com.ibm.wala:com.ibm.wala.shrike:1.3.4-SNAPSHOT (/home/vip/droidel/build.sbt#L11-16)
[warn]        +- University of Colorado Boulder:droidel_2.10:0.1-SNAPSHOT
[warn]      com.ibm.wala:com.ibm.wala.util:1.3.4-SNAPSHOT (/home/vip/droidel/build.sbt#L11-16)
[warn]        +- University of Colorado Boulder:droidel_2.10:0.1-SNAPSHOT
[warn]      com.ibm.wala:com.ibm.wala.core:1.3.4-SNAPSHOT (/home/vip/droidel/build.sbt#L11-16)
[warn]        +- University of Colorado Boulder:droidel_2.10:0.1-SNAPSHOT sbt.ResolveException: unresolved dependency: com.ibm.wala#com.ibm.wala.shrike;1.3.4-SNAPSHOT:     Local Maven Repository: no ivy file nor artifact found for com.ibm.wala#WALA;1.3.4-SNAPSHOT
unresolved dependency: com.ibm.wala#com.ibm.wala.util;1.3.4-SNAPSHOT:   Local Maven Repository: no ivy file nor artifact found for com.ibm.wala#WALA;1.3.4-SNAPSHOT
unresolved dependency: com.ibm.wala#com.ibm.wala.core;1.3.4-SNAPSHOT:   Local Maven Repository: no ivy file nor artifact found for com.ibm.wala#WALA;1.3.4-SNAPSHOT
    at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:243)
    at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:158)
    at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:156)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:147)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:147)
    at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:124)
    at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:56)
    at sbt.IvySbt$$anon$3.call(Ivy.scala:64)
    at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
    at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
    at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
    at xsbt.boot.Using$.withResource(Using.scala:10)
    at xsbt.boot.Using$.apply(Using.scala:9)
    at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
    at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
    at xsbt.boot.Locks$.apply0(Locks.scala:31)
    at xsbt.boot.Locks$.apply(Locks.scala:28)
    at sbt.IvySbt.withDefaultLogger(Ivy.scala:64)
    at sbt.IvySbt.withIvy(Ivy.scala:119)
    at sbt.IvySbt.withIvy(Ivy.scala:116)
    at sbt.IvySbt$Module.withModule(Ivy.scala:147)
    at sbt.IvyActions$.updateEither(IvyActions.scala:156)
    at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1282)
    at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1279)
    at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$84.apply(Defaults.scala:1309)
    at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$84.apply(Defaults.scala:1307)
    at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
    at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1312)
    at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1306)
    at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
    at sbt.Classpaths$.cachedUpdate(Defaults.scala:1324)
    at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1264)
    at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1242)
    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:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    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:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
[error] (*:update) sbt.ResolveException: unresolved dependency: com.ibm.wala#com.ibm.wala.shrike;1.3.4-SNAPSHOT:    Local Maven Repository: no ivy file nor artifact found for com.ibm.wala#WALA;1.3.4-SNAPSHOT
[error] unresolved dependency: com.ibm.wala#com.ibm.wala.util;1.3.4-SNAPSHOT:   Local Maven Repository: no ivy file nor artifact found for com.ibm.wala#WALA;1.3.4-SNAPSHOT
[error] unresolved dependency: com.ibm.wala#com.ibm.wala.core;1.3.4-SNAPSHOT:   Local Maven Repository: no ivy file nor artifact found for com.ibm.wala#WALA;1.3.4-SNAPSHOT
[error] Total time: 6 s, completed Sep 20, 2014 4:06:49 PM
sblackshear commented 10 years ago

Hmm, it sounds like an sbt resolution issue (the build works for me using for 0.13.5). You could try fixing sbt, but the quickest fix would be to copy the built WALA JARs into Droidel's lib/ directory. From the root directory of Droidel, do:

cp .m2/repository/com/ibm/wala/com.ibm.wala.core/1.3.4-SNAPSHOT/com.ibm.wala.core-1.3.4-SNAPSHOT.jar lib/ cp .m2/repository/com/ibm/wala/com.ibm.wala.util/1.3.4-SNAPSHOT/com.ibm.wala.util-1.3.4-SNAPSHOT.jar lib/ cp .m2/repository/com/ibm/wala/com.ibm.wala.util/1.3.4-SNAPSHOT/com.ibm.wala.util-1.3.4-SNAPSHOT.jar lib/

and then removed the managed dependency on WALA from build.sbt (that is, delete the lines "com.ibm.wala" % "com.ibm.wala.shrike" % "1.3.4-SNAPSHOT", "com.ibm.wala" % "com.ibm.wala.util" % "1.3.4-SNAPSHOT", "com.ibm.wala" % "com.ibm.wala.core" % "1.3.4-SNAPSHOT", ).

Hope this works!

highwater commented 10 years ago

Thank you it worked, found you did a typo in the third cp. Should be cp ~/.m2/repository/com/ibm/wala/com.ibm.wala.shrike/1.3.4-SNAPSHOT/com.ibm.wala.shrike-1.3.4-SNAPSHOT.jar lib/.

sblackshear commented 10 years ago

Great, thanks for your patience! Please let me know if you have any other problems.