From 94a57dcf00cfe5b5ff628fc873d1b133fd4898cb Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Fri, 4 May 2018 18:08:15 -0400 Subject: [PATCH] Move fakeboot to home https://github.com/sbt/sbt/pull/4143 kept failing, and while I was debugging, I noticed that the target that it was downloading scala-compiler was in /tmp/... for the remote instance. This moves the fakeboot to a full path, which should make the build less susceptible to failure due to random network issues. --- project/build.properties | 2 +- sbt/src/test/scala/sbt/RunFromSourceMain.scala | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/project/build.properties b/project/build.properties index 05313438a..64cf32f7f 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.1.2 +sbt.version=1.1.4 diff --git a/sbt/src/test/scala/sbt/RunFromSourceMain.scala b/sbt/src/test/scala/sbt/RunFromSourceMain.scala index 7212d570e..d70f02cb0 100644 --- a/sbt/src/test/scala/sbt/RunFromSourceMain.scala +++ b/sbt/src/test/scala/sbt/RunFromSourceMain.scala @@ -69,18 +69,19 @@ object RunFromSourceMain { private lazy val bootDirectory: File = file(sys.props("user.home")) / ".sbt" / "boot" private lazy val scalaHome: File = { + val log = sbt.util.LogExchange.logger("run-from-source") val scalaHome0 = bootDirectory / s"scala-$scalaVersion" - if (scalaHome0.exists) scalaHome0 + if ((scalaHome0 / "lib").exists) scalaHome0 else { - val target = new File("target").getAbsoluteFile - val fakeboot = target / "fakeboot" + log.info(s"""scalaHome ($scalaHome0) wasn't found""") + val fakeboot = file(sys.props("user.home")) / ".sbt" / "fakeboot" val scalaHome1 = fakeboot / s"scala-$scalaVersion" val scalaHome1Lib = scalaHome1 / "lib" val scalaHome1Temp = scalaHome1 / "temp" - if (scalaHome1Lib.exists) () + if (scalaHome1Lib.exists) log.info(s"""using $scalaHome1 that was found""") else { + log.info(s"""creating $scalaHome1 by downloading scala-compiler $scalaVersion""") IO.createDirectories(List(scalaHome1Lib, scalaHome1Temp)) - val log = sbt.util.LogExchange.logger("run-from-source") val lm = { import sbt.librarymanagement.ivy.IvyDependencyResolution val ivyConfig = InlineIvyConfiguration().withLog(log)