diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2a5a19f702..de2e21c8cb 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -30,7 +30,7 @@ Cargo.toml /build.sbt @4e6 @jaroslavtulach @hubertp @Akirathan /distribution/ @4e6 @jdunkerley @radeusgd @GregoryTravis @AdRiley @marthasharkey /engine/ @4e6 @jaroslavtulach @hubertp @Akirathan -/project/ @4e6 @jaroslavtulach @hubertp +/project/ @4e6 @jaroslavtulach @hubertp @Akirathan /tools/ @4e6 @jaroslavtulach @radeusgd @hubertp # Enso Libraries diff --git a/build.sbt b/build.sbt index 5ba6358aec..2d6ec6356d 100644 --- a/build.sbt +++ b/build.sbt @@ -3579,14 +3579,47 @@ lazy val `std-tableau` = project val unmanagedPath = unmanagedDirectory.toPath IO.withTemporaryDirectory( tmp => { - val files = IO.unzipURL( - unmanagedExternalZip.value, - tmp, - f => - f.endsWith(".jar") && !f.contains("gradle") && !f.contains( - "javadoc" - ) && !f.contains("jna") - ) + import scala.concurrent.ExecutionContext.Implicits.global + implicit val filesNotEmptySuccess: retry.Success[Set[File]] = + retry.Success(!_.isEmpty) + import scala.concurrent.duration._ + val future = retry.Backoff(4, 1.second).apply { () => + scala.concurrent.Future { + try { + IO.unzipURL( + unmanagedExternalZip.value, + tmp, + f => + f.endsWith(".jar") && !f.contains("gradle") && !f + .contains( + "javadoc" + ) && !f.contains("jna") + ) + } catch { + case _: java.net.SocketException | + _: java.net.ConnectException => + Set.empty[File] + } + } + } + future.onComplete { result => + if (result.isFailure || result.get.isEmpty) { + logger.log( + Level.Error, + "Failed to fetch any external artifacts for tableau" + ) + } + } + val files = scala.concurrent.Await.result(future, 60.seconds) + if (files.isEmpty) { + logger.log( + Level.Error, + "Failed to fetch any external artifacts for tableau" + ) + throw new IllegalStateException( + "Failed to fetch any external artifacts" + ) + } files.map { f => IO.move(f, unmanagedPath.resolve(f.getName).toFile) Attributed.blank(unmanagedPath.resolve(f.getName).toFile) diff --git a/project/plugins.sbt b/project/plugins.sbt index bcc4fed8a8..9e2a74b206 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,5 +8,6 @@ libraryDependencies += "io.circe" %% "circe-yaml" % "0 libraryDependencies += "commons-io" % "commons-io" % "2.12.0" libraryDependencies += "nl.gn0s1s" %% "bump" % "0.1.3" libraryDependencies += "com.google.googlejavaformat" % "google-java-format" % "1.18.1" +libraryDependencies += "com.softwaremill.retry" %% "retry" % "0.3.6" scalacOptions ++= Seq("-deprecation", "-feature")