These are chat archives for sbt/sbt

29th
Apr 2015
Miles Sabin
@milessabin
Apr 29 2015 05:58

I'm getting a feeling of deja vu from these Travis failures that I've been seeing since yesterday evening,

Getting Scala 2.10.4 (for sbt)...
:: retrieving :: org.scala-sbt#boot-scala
    confs: [default]
    0 artifacts copied, 5 already retrieved (0kB/14ms)
Error: Could not retrieve Scala 2.10.4: missing scala.tools.nsc.Global

Has anyone else started seeing this sort of thing?

Lukas Rytz
@lrytz
Apr 29 2015 10:17
I need to programmatically check in a plugin if a module (dependency) exists. I found this*, which I can copy-paste and adapt – is there a better way?
Josh Suereth
@jsuereth
Apr 29 2015 12:06
@milessabin I've started seeing this again. For 0.13.9 we're migrating to bintray before maven central, as it's been less flaky so far
@lrytz that code does not do what you think it does...
@lrytz If you won't be adding something to it later, yu can just depend on update.value and check the update report for it
Lukas Rytz
@lrytz
Apr 29 2015 12:09
@jsuereth the problem is i don't want to fail the build if a module doesn't exist.. this seems to do what i want:
  // adapted from https://github.com/typesafehub/migration-manager/blob/0.1.6/sbtplugin/src/main/scala/com/typesafe/tools/mima/plugin/SbtMima.scala#L69
  def artifactExists(organization: String, name: String, scalaBinaryVersion: String, version: String, ivy: IvySbt, s: TaskStreams): Boolean = {
    val moduleId = new ModuleID(organization, s"${name}_$scalaBinaryVersion", version)
    val moduleSettings = InlineConfiguration(
      "dummy" % "test" % "version",
      ModuleInfo("dummy-test-project-for-resolving"),
      dependencies = Seq(moduleId))
    val ivyModule = new ivy.Module(moduleSettings)
    try {
      IvyActions.update(
        ivyModule,
        new UpdateConfiguration(
          retrieve = None,
          missingOk = false,
          logging = UpdateLogging.DownloadOnly),
        s.log)
      true
    } catch {
      case _: ResolveException => false
    }
  }
eugene yokota
@eed3si9n
Apr 29 2015 12:31
I did see missing scala.tools.nsc.Global again on our build. And Maven Central seems to be involved even on 0.13.9. https://travis-ci.org/sbt/sbt/jobs/59272577
downloading https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.8.2/scala-compiler-2.8.2.jar ...
    [SUCCESSFUL ] org.scala-lang#scala-compiler;2.8.2!scala-compiler.jar (607ms)
downloading https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.8.2/scala-library-2.8.2.jar ...
    [SUCCESSFUL ] org.scala-lang#scala-library;2.8.2!scala-library.jar (1460ms)
:: retrieving :: org.scala-sbt#boot-scala
    confs: [default]
    3 artifacts copied, 0 already retrieved (15447kB/16ms)
Missing bintray credentials /home/travis/.bintray/.credentials. Some bintray features depend on this.
xsbti.RetrieveException: Could not retrieve Scala 2.9.3: missing scala.tools.nsc.Global
one way to stabilize the Travis build is to cache the ivy cache so you're not hitting the network unless you really have to - http://www.scala-sbt.org/0.13/docs/Travis-CI-with-sbt.html#%28Experimental%29+Reusing+Ivy+cache
Josh Suereth
@jsuereth
Apr 29 2015 12:37
yeah, maven central is involved, but should be the bottom of the list
i.e. bintray should get seen first....
AND, it turns out scripted is NOT using the latest launcher, so that's why our own tests are flaky
I think scripted may need some attention,a ctually
Simeon H.K. Fitch
@metasim
Apr 29 2015 13:10
@jsuereth Where should I log the issue I was having last night (detailed above) with scripted?
Josh Suereth
@jsuereth
Apr 29 2015 13:13
in sbt/sbt for now
partest is still in the same codebase
Simeon H.K. Fitch
@metasim
Apr 29 2015 13:20
thx
Miles Sabin
@milessabin
Apr 29 2015 15:43
@eed3si9n I do have caching enabled, thanks to @fommil, so I hadn't expect to see this again.
Travis seems to have had a b0rked update which they're rolling back at the moment, so it's possible that caches have been lost and the problem is a failure while attempting to repopulate.
eugene yokota
@eed3si9n
Apr 29 2015 15:51
I wonder if this could work for 0.13.8:
externalResolvers :=  Resolver.jcenterRepo +: externalResolvers.value
Josh Suereth
@jsuereth
Apr 29 2015 15:51
No, the failure is in sbt-launcher
which is somethign travis is using
You'd ahve to make a new repositories file and feed it to travis
(launcher repositories file)
Miles Sabin
@milessabin
Apr 29 2015 20:52
FYI, my build appears to be back to normal now.
eugene yokota
@eed3si9n
Apr 29 2015 20:53
so I guess ivy cache got fed, and stabilized?
Miles Sabin
@milessabin
Apr 29 2015 20:57
Looks that way.