Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta build resolves to unused Scala 2.10.2 #1439

Closed
fommil opened this issue Jul 8, 2014 · 27 comments
Closed

Meta build resolves to unused Scala 2.10.2 #1439

fommil opened this issue Jul 8, 2014 · 27 comments
Labels
Milestone

Comments

@fommil
Copy link
Contributor

fommil commented Jul 8, 2014

steps

  1. Use sbt 0.13.5 with the following plugins:

project/plugins.sbt:

addSbtPlugin("me.lessis" % "bintray-sbt" % "0.1.2")

addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.6")

ivyPaths :=  new IvyPaths((baseDirectory in ThisBuild).value, Some((baseDirectory in ThisBuild).value / "ivy-cache"))

build.sbt:

ivyPaths :=  new IvyPaths((baseDirectory in ThisBuild).value / "project", Some((baseDirectory in ThisBuild).value / "project" / "ivy-cache"))

Run:

$ sbt exit

problem

The meta build resolves to Scala 2.10.2 and downloads it.

expectation

The meta build uses Scala 2.10.4 (or which ever Scala version the sbt 0.13.x uses)

notes (workaround posted by @eed3si9n)

Put this in project/plugins.sbt:

libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value

Meta build's Compile configuration seems to be unaware of the ultimate Scala version the build uses (2.10.4 for sbt 0.13.5) and uses the Scala version that the plugins used to publish. The above workaround uses Ivy eviction to bump up scala-compiler and scala-library version.

original report by @fommil (Sbt downloads precompiled incremental compiler interfaces that users never plan to use)

in one of the projects I contribute to http://github.com/ensime/ensime-server and starting with a fresh ivy cache, type sbt compile for this scala 2.10.4 project and see several versions of the scala-compiler and sbt itself being downloaded.

Are all dependencies aggressively downloaded before working out what is evicted?

@jsuereth jsuereth changed the title downloading pointless libs? Sbt downloads precompiled incremental compiler interfaces that users never plan to use Jul 8, 2014
@jsuereth
Copy link
Member

jsuereth commented Jul 8, 2014

It's not quite that bad. When downloading sbt itself, we include some "default" precompiled libraries. These really should only be downloaded after we discover a project that needs them, but the hook we're using pre-downloads them every time.

We have two options here:

  1. We never precompile anything for you, you take the hit locally always
  2. We rearchitect so we download on command.

@gkossakowski and I have talked about doing (2) for various other reasons, but I don't see that likely to happen soon (next few months)

@fommil
Copy link
Contributor Author

fommil commented Jul 9, 2014

Ok, well you guys have a lot to do in the shared server work, and rewriting ivy, so please do focus on those other high priority areas :-)

@fommil
Copy link
Contributor Author

fommil commented Aug 1, 2014

we're still seeing crazy things like various sbt plugins depending on different versions of scala-library or scala-compiler and sbt is pulling them all in before realising what should be ignored. That seems terribly wasteful for both resolution and network usage. It increases the probability of CI failures, e.g. we keep getting a failure getting 2.10.2 of scala-compiler at the moment https://travis-ci.org/ensime/ensime-server/builds/31396242 (this might be a transient error that will go away, but this issue in general is causing significant slowdown in our successful builds)

@paulp
Copy link
Contributor

paulp commented Aug 12, 2014

@fommil Your report was not understood. Josh is referring to some precompiled jars of trivial size. You are talking about it downloading scala-compiler 2.10.2, 2.10.3, 2.10.4, scala-reflect 2.10.0, 2.10.2, 2.10.4, and so on, which is indeed what it does if you have a couple plugins.

Good news, I convinced sbt not to do that. With the following in project/plugins.sbt, it only downloads 2.10.4 scala artifacts.

def plugin(m: ModuleID) = Defaults.sbtPluginExtra(m, "0.13", "2.10") excludeAll ExclusionRule("org.scala-lang")

libraryDependencies ++= Seq(
  plugin("me.lessis"    % "bintray-sbt"     % "0.1.2"),
  plugin("com.typesafe" % "sbt-mima-plugin" % "0.1.6")
)

@jsuereth
Copy link
Member

@paulp This has some a lot of merit. With the exclusion rule optimisations @eed3si9n has recently added, it may even dramatically improve resolution performance for plugins. I may even be more aggressive and alter the rule to be ExclusionRule("org.scala-sbt") and see if the ivy tower collapses.

NOTE: Edited org.scala-lang => org.scala-sbt

@paulp
Copy link
Contributor

paulp commented Aug 12, 2014

Isn't ExclusionRule("org.scala-lang") what I posted?

@jsuereth
Copy link
Member

@fommil Also, with regards to downloading those libraries, ivy will downloads all ivy.xml/pom.xml files during resolution. This isn't supposed to include JARs, but who knows what happens. I spent 2 days inside the cache implementation and I'm not sure I trust it. In any case, Paul's solution has a lot of merit to help with the situation.

@paulp In terms of Precompiled, sbt will ALWAYS resolve the full scala JARs for each precompiled interface, given how we've defined the ivy, not just the ivy.xml but the full JARs. SO, scala 2.9.3, Scala 2.10.4 and I think Scala 2.8.2. You know, for giggles. Also, see my edited comment. Was typing too fast.

@paulp
Copy link
Contributor

paulp commented Aug 12, 2014

Right, it's just that the full jars are 250K. Compared to the 14+ MB per scala-compiler jar, it's not significant.

    240824 cache/org.scala-sbt/compiler-interface/jars/compiler-interface-bin-0.13.5.jar
     30056 cache/org.scala-sbt/compiler-interface/jars/compiler-interface-src-0.13.5.jar
    228003 cache/org.scala-sbt/precompiled-2_8_2/jars/compiler-interface-bin-0.13.5.jar
    237425 cache/org.scala-sbt/precompiled-2_9_2/jars/compiler-interface-bin-0.13.5.jar
    237454 cache/org.scala-sbt/precompiled-2_9_3/jars/compiler-interface-bin-0.13.5.jar
  14445780 cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.10.4.jar
   7126372 cache/org.scala-lang/scala-library/jars/scala-library-2.10.4.jar
   3203471 cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.10.4.jar

@jsuereth
Copy link
Member

@paulp hmm, it's not pulling in the full scala-compiler as well? AFAIK our ivy config, it should be doing that too (which we'd also need to fix). i..e I see this as two issues:

  1. Precompiled jars require downloading a full scala compiler jar
  2. Sbt plugins tag along the scala version they were defined with.

I think we can mitigate both of these if not negate them completely.

@paulp
Copy link
Contributor

paulp commented Aug 12, 2014

Nope, it's not downloading any compiler but 2.10.4. Here's the complete list of what's downloaded from a cold start (this is easy to reproduce with my-sbt -no-share) sorted by size. This is with the plugins.sbt posted above, but that shouldn't be especially relevant to the contents of this list.

     4090 Aug 11 19:37 project/.ivy/cache/org.slf4j/slf4j-nop/jars/slf4j-nop-1.7.7.jar
     8185 Aug 11 19:37 project/.ivy/cache/net.databinder.dispatch/dispatch-json4s-native_2.10/jars/dispatch-json4s-native_2.10-0.11.1.jar
     8293 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/cross-0.13.5.jar
     8293 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/cross/jars/cross-0.13.5.jar
     8688 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/compiler-ivy-integration-0.13.5.jar
     8688 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/compiler-ivy-integration/jars/compiler-ivy-integration-0.13.5.jar
     9762 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/launcher-interface-0.13.5.jar
     9762 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/launcher-interface/jars/launcher-interface-0.13.5.jar
    13187 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/control-0.13.5.jar
    13187 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/control/jars/control-0.13.5.jar
    14755 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/test-interface-1.0.jar
    14755 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/test-interface/jars/test-interface-1.0.jar
    21269 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/sbt-0.13.5.jar
    21269 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/sbt/jars/sbt-0.13.5.jar
    23711 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/test-agent-0.13.5.jar
    23711 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/test-agent/jars/test-agent-0.13.5.jar
    29257 Aug 11 19:37 project/.ivy/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.7.7.jar
    29686 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/relation-0.13.5.jar
    29686 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/relation/jars/relation-0.13.5.jar
    30056 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/compiler-interface-src/compiler-interface-src-0.13.5.jar
    30056 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/compiler-interface/jars/compiler-interface-src-0.13.5.jar
    32806 Aug 11 19:37 project/.ivy/cache/com.thoughtworks.paranamer/paranamer/jars/paranamer-2.6.jar
    43854 Aug 11 19:37 project/.ivy/cache/scala_2.10/sbt_0.13/com.typesafe/sbt-mima-plugin/jars/sbt-mima-plugin-0.1.6.jar
    44291 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/tracking-0.13.5.jar
    44291 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/tracking/jars/tracking-0.13.5.jar
    52012 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/xsbti/interface-0.13.5.jar
    52012 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/interface/jars/interface-0.13.5.jar
    64116 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/logic-0.13.5.jar
    64116 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/logic/jars/logic-0.13.5.jar
    65762 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/compiler-integration-0.13.5.jar
    65762 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/compiler-integration/jars/compiler-integration-0.13.5.jar
    68748 Aug 11 19:37 project/.ivy/cache/org.json4s/json4s-native_2.10/jars/json4s-native_2.10-3.2.9.jar
    82635 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/classfile-0.13.5.jar
    82635 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/classfile/jars/classfile-0.13.5.jar
    83802 Aug 11 19:37 project/.ivy/cache/org.json4s/json4s-ast_2.10/jars/json4s-ast_2.10-3.2.9.jar
    86127 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/classpath-0.13.5.jar
    86127 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/classpath/jars/classpath-0.13.5.jar
    87520 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/apply-macro-0.13.5.jar
    87520 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/apply-macro/jars/apply-macro-0.13.5.jar
   102885 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/testing-0.13.5.jar
   102885 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/testing/jars/testing-0.13.5.jar
   106659 Aug 11 19:37 project/.boot/scala-2.10.4/lib/jansi.jar
   106659 Aug 11 19:37 project/.ivy/cache/org.fusesource.jansi/jansi/jars/jansi-1.4.jar
   108402 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/logging-0.13.5.jar
   108402 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/logging/jars/logging-0.13.5.jar
   112383 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/compile-0.13.5.jar
   112383 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/compile/jars/compile-0.13.5.jar
   115569 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/cache-0.13.5.jar
   115569 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/cache/jars/cache-0.13.5.jar
   123798 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/process-0.13.5.jar
   123798 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/process/jars/process-0.13.5.jar
   130029 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/tasks-0.13.5.jar
   130029 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/tasks/jars/tasks-0.13.5.jar
   130791 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/task-system-0.13.5.jar
   130791 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/task-system/jars/task-system-0.13.5.jar
   132033 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/run-0.13.5.jar
   132033 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/run/jars/run-0.13.5.jar
   151965 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/sbinary_2.10-0.4.2.jar
   151965 Aug 11 19:37 project/.ivy/cache/org.scala-tools.sbinary/sbinary_2.10/jars/sbinary_2.10-0.4.2.jar
   162648 Aug 11 19:37 project/.ivy/cache/com.typesafe/mima-reporter_2.10/jars/mima-reporter_2.10-0.1.6.jar
   163774 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/persist-0.13.5.jar
   163774 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/persist/jars/persist-0.13.5.jar
   164623 Aug 11 19:37 project/.boot/scala-2.10.4/lib/jline.jar
   164623 Aug 11 19:37 project/.ivy/cache/org.scala-lang/jline/jars/jline-2.10.4.jar
   173779 Aug 11 19:37 project/.ivy/cache/scala_2.10/sbt_0.13/me.lessis/bintray-sbt/jars/bintray-sbt-0.1.2.jar
   185676 Aug 11 19:37 project/.ivy/cache/com.typesafe/config/bundles/config-1.0.0.jar
   208781 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/jline-2.11.jar
   208781 Aug 11 19:37 project/.ivy/cache/jline/jline/jars/jline-2.11.jar
   225308 Aug 11 19:37 project/.ivy/cache/me.lessis/bintry_2.10/jars/bintry_2.10-0.3.0.jar
   225751 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/jsch-0.1.46.jar
   225751 Aug 11 19:37 project/.ivy/cache/com.jcraft/jsch/jars/jsch-0.1.46.jar
   228003 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/compiler-interface-bin_2.8.2.final/compiler-interface-bin-0.13.5.jar
   228003 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/precompiled-2_8_2/jars/compiler-interface-bin-0.13.5.jar
   237425 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/compiler-interface-bin_2.9.2/compiler-interface-bin-0.13.5.jar
   237425 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/precompiled-2_9_2/jars/compiler-interface-bin-0.13.5.jar
   237454 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/compiler-interface-bin_2.9.3/compiler-interface-bin-0.13.5.jar
   237454 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/precompiled-2_9_3/jars/compiler-interface-bin-0.13.5.jar
   240824 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/compiler-interface-bin_2.10.4/compiler-interface-bin-0.13.5.jar
   240824 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/compiler-interface/jars/compiler-interface-bin-0.13.5.jar
   241447 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/command-0.13.5.jar
   241447 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/command/jars/command-0.13.5.jar
   253594 Aug 11 19:37 project/.ivy/cache/net.databinder.dispatch/dispatch-core_2.10/jars/dispatch-core_2.10-0.11.1.jar
   270453 Aug 11 19:37 project/.ivy/cache/com.typesafe/mima-core_2.10/jars/mima-core_2.10-0.1.6.jar
   271984 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/io-0.13.5.jar
   271984 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/io/jars/io-0.13.5.jar
   326118 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/api-0.13.5.jar
   326118 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/api/jars/api-0.13.5.jar
   385387 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/completion-0.13.5.jar
   385387 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/completion/jars/completion-0.13.5.jar
   406225 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/collections-0.13.5.jar
   406225 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/collections/jars/collections-0.13.5.jar
   416634 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/incremental-compiler-0.13.5.jar
   416634 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/incremental-compiler/jars/incremental-compiler-0.13.5.jar
   443256 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/actions-0.13.5.jar
   443256 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/actions/jars/actions-0.13.5.jar
   526740 Aug 11 19:37 project/.ivy/cache/com.ning/async-http-client/jars/async-http-client-1.8.8.jar
   582985 Aug 11 19:37 project/.ivy/cache/org.json4s/json4s-core_2.10/jars/json4s-core_2.10-3.2.9.jar
   629546 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/main-settings-0.13.5.jar
   629546 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/main-settings/jars/main-settings-0.13.5.jar
   712573 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/ivy-0.13.5.jar
   712573 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/ivy/jars/ivy-0.13.5.jar
  1222059 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/ivy-2.3.0.jar
  1222059 Aug 11 19:37 project/.ivy/cache/org.apache.ivy/ivy/jars/ivy-2.3.0.jar
  1231993 Aug 11 19:37 project/.ivy/cache/io.netty/netty/bundles/netty-3.9.0.Final.jar
  2255251 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/main-0.13.5.jar
  2255251 Aug 11 19:37 project/.ivy/cache/org.scala-sbt/main/jars/main-0.13.5.jar
  3203471 Aug 11 19:37 project/.boot/scala-2.10.4/lib/scala-reflect.jar
  3203471 Aug 11 19:37 project/.boot/scala-2.10.4/org.scala-sbt/sbt/0.13.5/scala-reflect-2.10.4.jar
  3203471 Aug 11 19:37 project/.ivy/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.10.4.jar
  7126372 Aug 11 19:37 project/.boot/scala-2.10.4/lib/scala-library.jar
  7126372 Aug 11 19:37 project/.ivy/cache/org.scala-lang/scala-library/jars/scala-library-2.10.4.jar
 14445780 Aug 11 19:37 project/.boot/scala-2.10.4/lib/scala-compiler.jar
 14445780 Aug 11 19:37 project/.ivy/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.10.4.jar

@jsuereth
Copy link
Member

Ah, that's good to hear. I need look into the hackery used for the precompiler jars more it seems...

@fommil
Copy link
Contributor Author

fommil commented Aug 12, 2014

That's great! The precompiled binaries are a pain also, especially since their classifiers can never be resolved, it results in errors anytime updateClassifiers is called (on an SBT plugin)

@milessabin
Copy link
Contributor

Thanks @paulp ... that appears to be working for me.

@eed3si9n eed3si9n changed the title Sbt downloads precompiled incremental compiler interfaces that users never plan to use Meta build resolves to unused Scala 2.10.2 Aug 14, 2014
@eed3si9n eed3si9n added Bug and removed Enhancement labels Aug 14, 2014
@eed3si9n eed3si9n added this to the 0.13.6 milestone Aug 16, 2014
eed3si9n added a commit that referenced this issue Aug 18, 2014
Scala instance is added to the Ivy graph via autoLibraryDependency.
For metabuilds, scala-library is scoped under “provided” configuration,
which does not seem to evict modules on “compiled” configuration.
This commit turns overrideScalaVersion flag to true for the metabuilds,
so override rules are added for the following modules:
- scala-library
- scala-compiler
- scala-reflect
havocp added a commit that referenced this issue Aug 20, 2014
Fixes #1439. Fixes metabuild downloading unused Scala 2.10.2
gildegoma added a commit to travis-ci/travis-cookbooks that referenced this issue Aug 21, 2014
This is a workaround for sbt/sbt#1439 and lack of Nexus proxy hosted by
Travis infrastructure.
@gildegoma
Copy link

Beside working on the introduction of a Nexus proxy, the Travis team will soon ship new VM images.

As a faster workaround to this issue, I'd like to pre-install these "2.10.2" jars (see travis-ci/travis-cookbooks#362)

I can upload the resulting .ivy2 cache to a dropbox so you can inspect it. Here a little excerpt of the biggest jars:

2   cache/org.scala-sbt/main/jars/main-0.12.4.jar
2   cache/org.scala-sbt/main/jars/main-0.13.2.jar
3   cache/org.scala-sbt/main/jars/main-0.13.5.jar
4   cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.10.2.jar
4   cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.10.3.jar
4   cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.10.4.jar
5   cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.2.jar
6   cache/org.scala-lang/scala-library/jars/scala-library-2.11.2.jar
7   cache/org.scala-lang/scala-library/jars/scala-library-2.10.2.jar
7   cache/org.scala-lang/scala-library/jars/scala-library-2.10.3.jar
7   cache/org.scala-lang/scala-library/jars/scala-library-2.10.4.jar
9   cache/org.scala-lang/scala-library/jars/scala-library-2.9.2.jar
9   cache/org.scala-lang/scala-library/jars/scala-library-2.9.3.jar
11  cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.9.2.jar
11  cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.9.3.jar
13  cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.11.2.jar
14  cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.10.2.jar
14  cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.10.3.jar
14  cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.10.4.jar

Compared to current VM image, the "2.10.2" jars will be present. Please tell me if anything else should be preinstalled to solve this problem.

@eed3si9n
Copy link
Member

@gildegoma Thanks a lot for working on this. Does preloaded cache include all other text files like .xml, .xml.original, and .properties file?

@paulp
Copy link
Contributor

paulp commented Aug 21, 2014

@gildegoma If you want to compare with what I'm using, here it is: https://www.dropbox.com/s/zorqzskm17f4dgy/cache.tar.gz

I recommend all those files for inclusion (plus the 2.10.2 version of all the 2.10.4 files - I didn't need them personally since I've applied the sbt fix which limits it to 2.10.4.)

@fommil
Copy link
Contributor Author

fommil commented Aug 21, 2014

great! I recommend these files plus whatever else gets put into ~/.ivy2 after running sbt compile (0.13.5) on a basic scala 2.9.2, 2.9.3, 2.10.4 and 2.11.2 project. That will then pull in everything that sbt expects and the remaining downloading/resolving can be entirely project specific.

@gildegoma
Copy link

Thanks everyone for the fast feedbacks!

@eed3si9n No worries, all these .xml, .xml.original, and .properties files are included.

@paulp I've compared, and here are the directories from your cache tarball that wouldn't be included in Travis VM image (in Kbytes):

468 com.github.mdr
248 com.lihaoyi
552 com.ning
76  com.thoughtworks.paranamer
1244io.netty
236 me.lessis
280 net.databinder.dispatch
16  org.codehaus
760 org.json4s
832 org.scalacheck
124 org.slf4j
484 scala_2.10

Do you see any problem if these parts are not preinstalled ?

@fommil wrote:

sbt compile (0.13.5) on a basic scala 2.9.2, 2.9.3, 2.10.4 and 2.11.2 project

So as workaround, I added to 2.10.2 to the pre-installation list, so we'll have: 2.11.2, 2.10.4, 2.10.2 and 2.9.3. Should I really add 2.9.2 as well, or you meant 2.10.2?

So far, we populate ~/.ivy2 and ~/.sbt by running for each preinstalled Scala version sbt-extras -scala-version 2.x.y about with a very dummy scala project (consisting of a project/build.properties file that just contains sbt.version=0.x.y, e.g. 0.13.5). Do you think we should change anything?

@paulp
Copy link
Contributor

paulp commented Aug 21, 2014

No, those are mostly the transitive dependencies of sbt-pgp. But it's not going to be a problem regardless of what's included, because it's only optimization except for the 2.10.2-related breakage.

@fommil
Copy link
Contributor Author

fommil commented Aug 21, 2014

@gildegoma there are two issues here. One is dealing with the extreme situation of 2.10.2 being removed from central, the other is concerned with ensuring that all the deps of sbt are available on all nodes (which means effectively everybody with a scala build). My request is to oblige the latter, but it looks like you're pretty much doing this by the sounds of it.

And actually 2.9.2 would be good, as it is used for 2.9 cross builds (2.9.2 and 2.9.3 are not binary compatible, so you may as well think of them as different scala versions entirely)

gildegoma added a commit to travis-ci/travis-cookbooks that referenced this issue Aug 22, 2014
Different 2.9.x versions of Scala are binary incompatible.
Happily, Scala patch versions from 2.10.0 on have become binary
compatible, so we won't have to worry about this point in the future.

See sbt/sbt#1439 (comment)
@gildegoma
Copy link

@paulp @fommil Thanks again!

  • sbt dependencies: So far, the Travis VM images are built with the deps of the two last patch versions of the latest release and the last patch version of the precedent release. Upcoming VM image will contain following sbt deps:
    • 0.13.5 -> scala-2.10.4
    • 0.13.2 -> scala-2.10.3
    • 0.12.4 -> scala-2.9.2
  • binary compatibility: As a side effect of the point above (sbt 0.12.4), 2.9.2 deps are currently preinstalled. But for more safety, I added Scala 2.9.2 to the preinstallation list (in case sbt 0.12.4 is removed in favor an hypothetical/upcoming 0.14). Happily, I see that as of 2.10.0, patch versions are now binary compatible :)

I think we are good now, but please tell me if you see anything that should be improved or fixed.

@fommil
Copy link
Contributor Author

fommil commented Aug 22, 2014

😀

@nafg
Copy link
Contributor

nafg commented Sep 3, 2014

If the 2.10.2 jar is never used, why bother prepopulating it via dropbox etc. -- can't you just touch the right files so sbt will think it's been downloaded already?

@fommil
Copy link
Contributor Author

fommil commented Sep 3, 2014

sha/md5

@nafg
Copy link
Contributor

nafg commented Sep 3, 2014

Could that also be faked?

@fommil
Copy link
Contributor Author

fommil commented Sep 3, 2014

sure: if you want to become the world's most awesome code breaker

@nafg
Copy link
Contributor

nafg commented Sep 3, 2014

My point is, can I pre-populate travis with some dummy files so it doesn't bother downloading 2.10.2 which I'm not going to use?

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

No branches or pull requests

7 participants