Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Spurious recompilation in multiproject builds with external subprojects. #35

Closed
harrah opened this Issue · 1 comment

1 participant

@harrah
Owner

I'm finding some strange behavior with the new external multiproject support. I have two projects, A and B which both dependOn external project C using RootProject("../c").

If I go to project A and compile it, C is also compiled, and all is well. However, if I then go to project B and compile it, this also causes C to be entirely recompiled. This of course is awful, because C takes a couple of minutes to compile and this happens whenever I switch between A and B.

Here is an example of build output related to the attached projects:

knuttycombe@floorshow sbt (master)]$ ls
a b c

[knuttycombe@floorshow sbt (master)]$ cd c/
[knuttycombe@floorshow c (master)]$ sbt compile
Getting net.java.dev.jna jna 3.2.3 ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
1 artifacts copied, 0 already retrieved (838kB/80ms)
Getting Scala 2.8.1 (for sbt)...
:: retrieving :: org.scala-tools.sbt#boot-scala
confs: [default]
4 artifacts copied, 0 already retrieved (15296kB/873ms)
Getting org.scala-tools.sbt sbt_2.8.1 0.10.0 ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
34 artifacts copied, 0 already retrieved (6012kB/794ms)
[info] Set current project to default (in build file:/Users/knuttycombe/tmp/sbt/c/)
[info] Updating...
[info] Done updating.
[info] Compiling 1 Scala source to /Users/knuttycombe/tmp/sbt/c/target/scala-2.8.1.final/classes...
[success] Total time: 3 s, completed Jun 4, 2011 9:46:53 PM
[knuttycombe@floorshow c (master)]$ cd ../b
[knuttycombe@floorshow b (master)]$ sbt compile
Getting net.java.dev.jna jna 3.2.3 ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
1 artifacts copied, 0 already retrieved (838kB/19ms)
Getting Scala 2.8.1 (for sbt)...
:: retrieving :: org.scala-tools.sbt#boot-scala
confs: [default]
4 artifacts copied, 0 already retrieved (15296kB/248ms)
Getting org.scala-tools.sbt sbt_2.8.1 0.10.0 ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
34 artifacts copied, 0 already retrieved (6012kB/63ms)
[info] Compiling 1 Scala source to /Users/knuttycombe/tmp/sbt/b/project/target/scala_2.8.1/classes...
[info] Set current project to b (in build file:/Users/knuttycombe/tmp/sbt/b/)
[info] Updating...
[info] Compiling 1 Scala source to /Users/knuttycombe/tmp/sbt/c/target/scala-2.8.1.final/classes...
[info] Done updating.
[info] Compiling 1 Scala source to /Users/knuttycombe/tmp/sbt/b/target/scala-2.8.1.final/classes...
[success] Total time: 3 s, completed Jun 4, 2011 9:47:16 PM
[knuttycombe@floorshow b (master)]$ cd ../a
[knuttycombe@floorshow a (master)]$ sbt compile
Getting net.java.dev.jna jna 3.2.3 ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
1 artifacts copied, 0 already retrieved (838kB/17ms)
Getting Scala 2.8.1 (for sbt)...
:: retrieving :: org.scala-tools.sbt#boot-scala
confs: [default]
4 artifacts copied, 0 already retrieved (15296kB/236ms)
Getting org.scala-tools.sbt sbt_2.8.1 0.10.0 ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
34 artifacts copied, 0 already retrieved (6012kB/65ms)
[info] Compiling 1 Scala source to /Users/knuttycombe/tmp/sbt/a/project/target/scala_2.8.1/classes...
[info] Set current project to a (in build file:/Users/knuttycombe/tmp/sbt/a/)
[info] Updating...
[info] Compiling 1 Scala source to /Users/knuttycombe/tmp/sbt/c/target/scala-2.8.1.final/classes...
[info] Done updating.
[info] Compiling 1 Scala source to /Users/knuttycombe/tmp/sbt/a/target/scala-2.8.1.final/classes...
[success] Total time: 3 s, completed Jun 4, 2011 9:47:41 PM
[knuttycombe@floorshow a (master)]$ cd ../b/
[knuttycombe@floorshow b (master)]$ sbt compile
[info] Set current project to b (in build file:/Users/knuttycombe/tmp/sbt/b/)
[info] Compiling 1 Scala source to /Users/knuttycombe/tmp/sbt/c/target/scala-2.8.1.final/classes...
[success] Total time: 6 s, completed Jun 4, 2011 9:47:58 PM
[knuttycombe@floorshow b (master)]$

Something interesting to note: although c is recompiled when I switch back to b, the classes in b that depend on c are not!

@harrah
Owner

IMPORTANT This project has moved to https://github.com/sbt/sbt. This issue still exists to avoid dead links, but GitHub limitations prevent the original issue from being correctly preserved here. Please see sbt/sbt#35 for the full issue and to comment.

@harrah harrah closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.