From c810383daf088340252fc4f5fedad4eae0883193 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Wed, 8 May 2024 11:59:00 +0200 Subject: [PATCH 01/17] Upgrade sbt plugins to avoid deprecated repo.scala-sbt.org --- project/plugins.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 28508259b..6e2346199 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,10 +2,10 @@ ThisBuild / useCoursier := false scalacOptions ++= Seq("-feature", "-language:postfixOps", "-Ywarn-unused:_,-imports") -addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0") +addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1") addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.0") -addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.5.1") +addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.5.3") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.5") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.8.1") From 78296a912889b0f51ddbfbf10e9c966f916757bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 04:22:26 +0000 Subject: [PATCH 02/17] Bump scalacenter/sbt-dependency-submission from 2 to 3 Bumps [scalacenter/sbt-dependency-submission](https://github.com/scalacenter/sbt-dependency-submission) from 2 to 3. - [Release notes](https://github.com/scalacenter/sbt-dependency-submission/releases) - [Commits](https://github.com/scalacenter/sbt-dependency-submission/compare/v2...v3) --- updated-dependencies: - dependency-name: scalacenter/sbt-dependency-submission dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/dependency-graph.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependency-graph.yml b/.github/workflows/dependency-graph.yml index 8e5f9dc7a..de558d3bb 100644 --- a/.github/workflows/dependency-graph.yml +++ b/.github/workflows/dependency-graph.yml @@ -13,4 +13,4 @@ jobs: runs-on: ubuntu-latest # or windows-latest, or macOS-latest steps: - uses: actions/checkout@v4 - - uses: scalacenter/sbt-dependency-submission@v2 + - uses: scalacenter/sbt-dependency-submission@v3 From f990bd2d8ddac7fb7bffb98853d66065620c4b9c Mon Sep 17 00:00:00 2001 From: Adrien Piquerez Date: Tue, 21 May 2024 15:56:37 +0200 Subject: [PATCH 03/17] [BSP] Fix importing Optional project dependency --- .../sbt/internal/InternalDependencies.scala | 4 +++- .../src/server-test/buildserver/build.sbt | 2 +- .../test/scala/testpkg/BuildServerTest.scala | 19 ++++++++++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/main/src/main/scala/sbt/internal/InternalDependencies.scala b/main/src/main/scala/sbt/internal/InternalDependencies.scala index 4c866b17b..6a1bf74d6 100644 --- a/main/src/main/scala/sbt/internal/InternalDependencies.scala +++ b/main/src/main/scala/sbt/internal/InternalDependencies.scala @@ -13,7 +13,9 @@ import sbt.Keys._ private[sbt] object InternalDependencies { def configurations: Def.Initialize[Seq[(ProjectRef, Set[String])]] = Def.setting { - val allConfigs = Classpaths.allConfigs(configuration.value).map(_.name).toSet + val configMap = internalConfigurationMap.value + val config = configMap(configuration.value) + val allConfigs = Classpaths.allConfigs(config).map(_.name).toSet val ref = thisProjectRef.value val projectDependencies = buildDependencies.value.classpath.get(ref).toSeq.flatten val applicableConfigs = allConfigs + "*" diff --git a/server-test/src/server-test/buildserver/build.sbt b/server-test/src/server-test/buildserver/build.sbt index fffa813ff..1d31a2e61 100644 --- a/server-test/src/server-test/buildserver/build.sbt +++ b/server-test/src/server-test/buildserver/build.sbt @@ -12,7 +12,7 @@ lazy val runAndTest = project.in(file("run-and-test")) Test / javaOptions := Vector("Xmx512M"), Test / envVars := Map("KEY_TEST" -> "VALUE_TEST"), ) - .dependsOn(util) + .dependsOn(util % Optional) lazy val reportError = project.in(file("report-error")) diff --git a/server-test/src/test/scala/testpkg/BuildServerTest.scala b/server-test/src/test/scala/testpkg/BuildServerTest.scala index 0e79673b7..fff085a94 100644 --- a/server-test/src/test/scala/testpkg/BuildServerTest.scala +++ b/server-test/src/test/scala/testpkg/BuildServerTest.scala @@ -43,8 +43,12 @@ object BuildServerTest extends AbstractServerTest { test("workspace/buildTargets") { _ => sendRequest("workspace/buildTargets") val result = svr.waitFor[WorkspaceBuildTargetsResult](10.seconds) - val utilTarget = result.targets.find(_.displayName.contains("util")).get + val utilTargetIdentifier = BuildTargetIdentifier(buildTargetUri("util", "Compile")) + val utilTarget = result.targets.find(_.id == utilTargetIdentifier).get assert(utilTarget.id.uri.toString.endsWith("#util/Compile")) + val runAndTestTarget = result.targets.find(_.displayName.contains("runAndTest")).get + // runAndTest should declare the dependency to util even if optional + assert(runAndTestTarget.dependencies.contains(utilTargetIdentifier)) val buildServerBuildTarget = result.targets.find(_.displayName.contains("buildserver-build")).get assert(buildServerBuildTarget.id.uri.toString.endsWith("#buildserver-build")) @@ -233,14 +237,19 @@ object BuildServerTest extends AbstractServerTest { } test("buildTarget/scalacOptions, buildTarget/javacOptions") { _ => - val buildTarget = buildTargetUri("util", "Compile") - val badBuildTarget = buildTargetUri("badBuildTarget", "Compile") + val buildTargets = Seq( + buildTargetUri("util", "Compile"), + buildTargetUri("badBuildTarget", "Compile"), + ) - val id1 = scalacOptions(Seq(buildTarget, badBuildTarget)) + val id1 = scalacOptions(buildTargets) assertMessage(s""""id":"$id1"""", "scala-library-2.13.11.jar")() - val id2 = javacOptions(Seq(buildTarget, badBuildTarget)) + val id2 = javacOptions(buildTargets) assertMessage(s""""id":"$id2"""", "scala-library-2.13.11.jar")() + + val id3 = scalacOptions(Seq(buildTargetUri("runAndTest", "Compile"))) + assertMessage(s""""id":"$id3"""", "util/target/scala-2.13/classes")() } test("buildTarget/cleanCache") { _ => From 9a3c4a6f539f233552fa29509be74b0a83518ef6 Mon Sep 17 00:00:00 2001 From: Adrien Piquerez Date: Tue, 16 Apr 2024 15:18:16 +0200 Subject: [PATCH 04/17] Fix dependency-management/force-update-period --- main/src/main/scala/sbt/Defaults.scala | 2 +- .../sbt/internal/LibraryManagement.scala | 46 +++++++++++-------- .../force-update-period/build.sbt | 24 +++++----- .../force-update-period/test | 8 ++-- 4 files changed, 45 insertions(+), 35 deletions(-) diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala index fdbac4ffe..fa2c3eb7d 100644 --- a/main/src/main/scala/sbt/Defaults.scala +++ b/main/src/main/scala/sbt/Defaults.scala @@ -3797,7 +3797,7 @@ object Classpaths { forceUpdatePeriod.value match { case None => false case Some(period) => - val fullUpdateOutput = cacheDirectory / "out" + val fullUpdateOutput = cacheDirectory / "output" val now = System.currentTimeMillis val diff = now - IO.getModifiedTimeOrZero(fullUpdateOutput) val elapsedDuration = new FiniteDuration(diff, TimeUnit.MILLISECONDS) diff --git a/main/src/main/scala/sbt/internal/LibraryManagement.scala b/main/src/main/scala/sbt/internal/LibraryManagement.scala index 9a0f0d362..750a51c9f 100644 --- a/main/src/main/scala/sbt/internal/LibraryManagement.scala +++ b/main/src/main/scala/sbt/internal/LibraryManagement.scala @@ -110,13 +110,16 @@ private[sbt] object LibraryManagement { } /* Skip resolve if last output exists, otherwise error. */ - def skipResolve(cache: CacheStore): UpdateInputs => UpdateReport = { + def skipResolve(cache: CacheStore)(inputs: UpdateInputs): UpdateReport = { import sbt.librarymanagement.LibraryManagementCodec._ - Tracked.lastOutput[UpdateInputs, UpdateReport](cache) { - case (_, Some(out)) => markAsCached(out) - case _ => - sys.error("Skipping update requested, but update has not previously run successfully.") - } + val cachedReport = Tracked + .lastOutput[UpdateInputs, UpdateReport](cache) { + case (_, Some(out)) => out + case _ => + sys.error("Skipping update requested, but update has not previously run successfully.") + } + .apply(inputs) + markAsCached(cachedReport) } // Mark UpdateReport#stats as "cached." This is used by the dependers later @@ -127,15 +130,21 @@ private[sbt] object LibraryManagement { def doResolve(cache: CacheStore): UpdateInputs => UpdateReport = { val doCachedResolve = { (inChanged: Boolean, updateInputs: UpdateInputs) => import sbt.librarymanagement.LibraryManagementCodec._ - val cachedResolve = Tracked.lastOutput[UpdateInputs, UpdateReport](cache) { - case (_, Some(out)) if upToDate(inChanged, out) => markAsCached(out) - case pair => - log.debug(s"""not up to date. inChanged = $inChanged, force = $force""") - resolve - } - import scala.util.control.Exception.catching - catching(classOf[NullPointerException], classOf[OutOfMemoryError]) - .withApply { t => + try { + var isCached = false + val report = Tracked + .lastOutput[UpdateInputs, UpdateReport](cache) { + case (_, Some(out)) if upToDate(inChanged, out) => + isCached = true + out + case pair => + log.debug(s"""not up to date. inChanged = $inChanged, force = $force""") + resolve + } + .apply(updateInputs) + if (isCached) markAsCached(report) else report + } catch { + case t @ (_: NullPointerException | _: OutOfMemoryError) => val resolvedAgain = resolve val culprit = t.getClass.getSimpleName log.warn(s"Update task caching failed due to $culprit.") @@ -143,8 +152,7 @@ private[sbt] object LibraryManagement { resolvedAgain.toString.linesIterator.foreach(log.warn(_)) log.trace(t) resolvedAgain - } - .apply(cachedResolve(updateInputs)) + } } import LibraryManagementCodec._ Tracked.inputChanged(cacheStoreFactory.make("inputs"))(doCachedResolve) @@ -155,7 +163,7 @@ private[sbt] object LibraryManagement { val extraInputHash = module.extraInputHash val settings = module.moduleSettings val outStore = cacheStoreFactory.make("output") - val handler = if (skip && !force) skipResolve(outStore) else doResolve(outStore) + val handler = if (skip && !force) skipResolve(outStore)(_) else doResolve(outStore) // Remove clock for caching purpose val withoutClock = updateConfig.withLogicalClock(LogicalClock.unknown) handler((extraInputHash, settings, withoutClock)) @@ -257,7 +265,7 @@ private[sbt] object LibraryManagement { forceUpdatePeriod.value match { case None => false case Some(period) => - val fullUpdateOutput = cacheDirectory / "out" + val fullUpdateOutput = cacheDirectory / "output" val now = System.currentTimeMillis val diff = now - fullUpdateOutput.lastModified() val elapsedDuration = new scala.concurrent.duration.FiniteDuration( diff --git a/sbt-app/src/sbt-test/dependency-management/force-update-period/build.sbt b/sbt-app/src/sbt-test/dependency-management/force-update-period/build.sbt index 11bcdf94e..23d58d7d1 100644 --- a/sbt-app/src/sbt-test/dependency-management/force-update-period/build.sbt +++ b/sbt-app/src/sbt-test/dependency-management/force-update-period/build.sbt @@ -1,17 +1,19 @@ ThisBuild / useCoursier := false +name := "force-update-period" +scalaVersion := "2.12.18" libraryDependencies += "log4j" % "log4j" % "1.2.16" % "compile" - autoScalaLibrary := false -crossPaths := false - -TaskKey[Unit]("check-last-update-time") := (streams map { (s) => - val fullUpdateOutput = s.cacheDirectory / "out" - val timeDiff = System.currentTimeMillis()-fullUpdateOutput.lastModified() - val exists = fullUpdateOutput.exists() - s.log.info(s"Amount of time since last full update: $timeDiff") - if (exists && timeDiff > 5000) { - sys.error("Full update not performed") +TaskKey[Unit]("check-last-update-time") := { + val s = streams.value + val updateOutput = crossTarget.value / "update" / updateCacheName.value / "output" + if (!updateOutput.exists()) { + sys.error("Update cache does not exist") } -}).value + val timeDiff = System.currentTimeMillis() - updateOutput.lastModified() + s.log.info(s"Amount of time since last full update: $timeDiff") + if (timeDiff > 5000) { + sys.error("Update not performed") + } +} diff --git a/sbt-app/src/sbt-test/dependency-management/force-update-period/test b/sbt-app/src/sbt-test/dependency-management/force-update-period/test index 39e776d09..17ae82b98 100644 --- a/sbt-app/src/sbt-test/dependency-management/force-update-period/test +++ b/sbt-app/src/sbt-test/dependency-management/force-update-period/test @@ -1,11 +1,11 @@ -$ absent target/resolution-cache +$ absent target/scala-2.12/resolution-cache > compile -$ exists target/resolution-cache +$ exists target/scala-2.12/resolution-cache > checkLastUpdateTime -$ sleep 10000 +$ sleep 5000 > compile # This is expected to fail -> checkLastUpdateTime > set forceUpdatePeriod := Some(new scala.concurrent.duration.FiniteDuration(5000, java.util.concurrent.TimeUnit.MILLISECONDS)) > compile -> checkLastUpdateTime \ No newline at end of file +> checkLastUpdateTime From 71f996df6eebea900f52aa1bd1b34c20bba87d25 Mon Sep 17 00:00:00 2001 From: Adrien Piquerez Date: Wed, 22 May 2024 10:25:45 +0200 Subject: [PATCH 05/17] Fix scripted project/internal-dependency-configuration --- .../internal-dependency-configurations/build.sbt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sbt-app/src/sbt-test/project/internal-dependency-configurations/build.sbt b/sbt-app/src/sbt-test/project/internal-dependency-configurations/build.sbt index 06a8556dd..f65b34710 100644 --- a/sbt-app/src/sbt-test/project/internal-dependency-configurations/build.sbt +++ b/sbt-app/src/sbt-test/project/internal-dependency-configurations/build.sbt @@ -23,31 +23,31 @@ def getConfigs(key: SettingKey[Seq[(ProjectRef, Set[String])]]): val checkA = taskKey[Unit]("Verify that project a's internal dependencies are as expected") checkA := { val compileDeps = getConfigs(a / Compile / internalDependencyConfigurations).value - assert(compileDeps == Map("a" -> Set("compile"))) + assert(compileDeps == Map("a" -> Set("compile", "optional", "provided", "compile-internal"))) val testDeps = getConfigs(a / Test / internalDependencyConfigurations).value - assert(testDeps == Map("a" -> Set("compile", "runtime", "test"))) + assert(testDeps == Map("a" -> Set("compile", "optional", "provided", "runtime", "test", "test-internal")), testDeps.mkString(", ")) } val checkB = taskKey[Unit]("Verify that project b's internal dependencies are as expected") checkB := { val compileDeps = getConfigs(b / Compile / internalDependencyConfigurations).value - assert(compileDeps == Map("b" -> Set("compile"), "a" -> Set("compile"))) + assert(compileDeps == Map("b" -> Set("compile", "optional", "provided", "compile-internal"), "a" -> Set("compile"))) val testDeps = getConfigs(b / Test / internalDependencyConfigurations).value - assert(testDeps == Map("b" -> Set("compile", "runtime", "test"), "a" -> Set("compile"))) + assert(testDeps == Map("b" -> Set("compile", "optional", "provided", "runtime", "test", "test-internal"), "a" -> Set("compile"))) } val checkC = taskKey[Unit]("Verify that project c's internal dependencies are as expected") checkC := { val compileDeps = getConfigs(c / Compile / internalDependencyConfigurations).value - assert(compileDeps == Map("c" -> Set("compile"))) + assert(compileDeps == Map("c" -> Set("compile", "optional", "provided", "compile-internal"))) val testDeps = getConfigs(c / Test / internalDependencyConfigurations).value - assert(testDeps == Map("c" -> Set("compile", "runtime", "test"))) + assert(testDeps == Map("c" -> Set("compile", "optional", "provided", "runtime", "test", "test-internal"))) } val checkD = taskKey[Unit]("Verify that project d's internal dependencies are as expected") checkD := { val compileDeps = getConfigs(d / Compile / internalDependencyConfigurations).value - assert(compileDeps == Map("d" -> Set("compile"), "c" -> Set("compile"))) + assert(compileDeps == Map("d" -> Set("compile", "optional", "provided", "compile-internal"), "c" -> Set("compile"))) val testDeps = getConfigs(d / Test / internalDependencyConfigurations).value - assert(testDeps == Map("d" -> Set("compile", "runtime", "test"), "c" -> Set("compile", "test"))) + assert(testDeps == Map("d" -> Set("compile", "optional", "provided", "runtime", "test", "test-internal"), "c" -> Set("compile", "test"))) } From 678fe9d204426c2175921fe03b23a2df75a1cf33 Mon Sep 17 00:00:00 2001 From: Michael Sesterhenn Date: Thu, 20 Jun 2024 13:07:44 -0500 Subject: [PATCH 06/17] Trim spaces around k and v in build.properties to be more forgiving. --- sbt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbt b/sbt index 7d3f707e8..2c1e72cf7 100755 --- a/sbt +++ b/sbt @@ -707,6 +707,9 @@ loadConfigFile() { } loadPropFile() { + # trim key and value so as to be more forgiving with spaces around the '=': + k=$(echo $k |sed -e 's/^\s*(.+)\s*$/\\1/g') + v=$(echo $v |sed -e 's/^\s*(.+)\s*$/\\1/g') while IFS='=' read -r k v; do if [[ "$k" == "sbt.version" ]]; then build_props_sbt_version="$v" From 087770f5e0451bcb71b6494cc8c2441ae3e00c9f Mon Sep 17 00:00:00 2001 From: Michael Sesterhenn Date: Fri, 21 Jun 2024 11:21:15 -0500 Subject: [PATCH 07/17] Use built-in bash string trimming instead of sed. --- sbt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sbt b/sbt index 2c1e72cf7..a73586c81 100755 --- a/sbt +++ b/sbt @@ -89,6 +89,14 @@ cygwinpath() { fi } +# Trim leading and trailing spaces from a string. +# Echos the new trimmed string. +trimString() { + local inputStr="$*" + local modStr="${inputStr#"${inputStr%%[![:space:]]*}"}" + modStr="${modStr%"${modStr##*[![:space:]]}"}" + echo "$modStr" +} declare -r sbt_bin_dir="$(dirname "$(realpathish "$0")")" declare -r sbt_home="$(dirname "$sbt_bin_dir")" @@ -708,8 +716,8 @@ loadConfigFile() { loadPropFile() { # trim key and value so as to be more forgiving with spaces around the '=': - k=$(echo $k |sed -e 's/^\s*(.+)\s*$/\\1/g') - v=$(echo $v |sed -e 's/^\s*(.+)\s*$/\\1/g') + k=$(trimString $k) + v=$(trimString $v) while IFS='=' read -r k v; do if [[ "$k" == "sbt.version" ]]; then build_props_sbt_version="$v" From a0e4d22a6cd94ab3262af4aa49e6311e6686a6bb Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sat, 6 Jul 2024 15:20:13 -0400 Subject: [PATCH 08/17] sjson-new 0.10.1 --- project/Dependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index b622edf79..db05c9d88 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -80,7 +80,7 @@ object Dependencies { val lmCoursierShaded = "io.get-coursier" %% "lm-coursier-shaded" % "2.1.4" def sjsonNew(n: String) = - Def.setting("com.eed3si9n" %% n % "0.9.1") // contrabandSjsonNewVersion.value + Def.setting("com.eed3si9n" %% n % "0.10.1") // contrabandSjsonNewVersion.value val sjsonNewScalaJson = sjsonNew("sjson-new-scalajson") val sjsonNewMurmurhash = sjsonNew("sjson-new-murmurhash") From e32618529d9ee433c830c766d8d584e095afff35 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sat, 6 Jul 2024 16:36:20 -0400 Subject: [PATCH 09/17] Scala 2.13.14 --- project/Dependencies.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index db05c9d88..46f200015 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -5,7 +5,7 @@ import sbt.contraband.ContrabandPlugin.autoImport._ object Dependencies { // WARNING: Please Scala update versions in PluginCross.scala too val scala212 = "2.12.19" - val scala213 = "2.13.12" + val scala213 = "2.13.14" val checkPluginCross = settingKey[Unit]("Make sure scalaVersion match up") val baseScalaVersion = scala212 def nightlyVersion: Option[String] = @@ -134,5 +134,5 @@ object Dependencies { val hedgehog = "qa.hedgehog" %% "hedgehog-sbt" % "0.7.0" val disruptor = "com.lmax" % "disruptor" % "3.4.2" - val kindProjector = ("org.typelevel" % "kind-projector" % "0.13.2").cross(CrossVersion.full) + val kindProjector = ("org.typelevel" % "kind-projector" % "0.13.3").cross(CrossVersion.full) } From 70b829ec5443e8708456336ebdfd0e67eaf3ed32 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sat, 6 Jul 2024 16:43:13 -0400 Subject: [PATCH 10/17] sbt 1.10.0 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index e8a1e246e..081fdbbc7 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.7 +sbt.version=1.10.0 From c2009716e1c77a0a0379e877c5ac21522c766e0b Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sun, 7 Jul 2024 14:22:47 -0400 Subject: [PATCH 11/17] Zinc 1.10.1 --- project/Dependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 46f200015..410e3bdd3 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -15,7 +15,7 @@ object Dependencies { private val ioVersion = nightlyVersion.getOrElse("1.10.0") private val lmVersion = sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.10.0") - val zincVersion = nightlyVersion.getOrElse("1.10.0") + val zincVersion = nightlyVersion.getOrElse("1.10.1") private val sbtIO = "org.scala-sbt" %% "io" % ioVersion From d7a0db2334d646a623995cc026bb845538a28749 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sun, 7 Jul 2024 15:50:55 -0400 Subject: [PATCH 12/17] Lm 1.10.1 --- project/Dependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 410e3bdd3..f52b1153d 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -14,7 +14,7 @@ object Dependencies { // sbt modules private val ioVersion = nightlyVersion.getOrElse("1.10.0") private val lmVersion = - sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.10.0") + sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.10.1") val zincVersion = nightlyVersion.getOrElse("1.10.1") private val sbtIO = "org.scala-sbt" %% "io" % ioVersion From c42766a1235c51b8fe33695ccf830e8bc2d2b435 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sun, 7 Jul 2024 17:23:25 -0400 Subject: [PATCH 13/17] Launcher 1.4.3 --- project/Dependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index f52b1153d..2bf0d2741 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -22,7 +22,7 @@ object Dependencies { private val libraryManagementCore = "org.scala-sbt" %% "librarymanagement-core" % lmVersion private val libraryManagementIvy = "org.scala-sbt" %% "librarymanagement-ivy" % lmVersion - val launcherVersion = "1.4.2" + val launcherVersion = "1.4.3" val launcherInterface = "org.scala-sbt" % "launcher-interface" % launcherVersion val rawLauncher = "org.scala-sbt" % "launcher" % launcherVersion val testInterface = "org.scala-sbt" % "test-interface" % "1.0" From 317e991b87d9fe34c51766bfbb3a684c5051e476 Mon Sep 17 00:00:00 2001 From: SlowBrainDude <126806769+SlowBrainDude@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:30:32 +0200 Subject: [PATCH 14/17] Using common Scala 2.12 version for the sbtn subproject The old, hardcoded Scala 2.12 version previously used for the sbtn project (as a kind of workaround?) was no longer supported by Scala IDE tooling. But sbtn builds just fine when using the current global setting for the Scala 2.12 version, so this commit removes the hardcoded version. --- build.sbt | 1 - 1 file changed, 1 deletion(-) diff --git a/build.sbt b/build.sbt index 3eba2b719..98d0e71dc 100644 --- a/build.sbt +++ b/build.sbt @@ -1165,7 +1165,6 @@ lazy val sbtClientProj = (project in file("client")) .dependsOn(commandProj) .settings( commonBaseSettings, - scalaVersion := "2.12.11", // The thin client does not build with 2.12.12 publish / skip := true, name := "sbt-client", mimaPreviousArtifacts := Set.empty, From 242b8686e8b422cea721a4882a296fe92778fa87 Mon Sep 17 00:00:00 2001 From: SlowBrainDude <126806769+SlowBrainDude@users.noreply.github.com> Date: Sat, 20 Jul 2024 01:20:45 +0200 Subject: [PATCH 15/17] Note in DEV docs on supported build time JDK dependency --- DEVELOPING.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/DEVELOPING.md b/DEVELOPING.md index 8616765d3..beff0e099 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -18,6 +18,12 @@ The `develop` branch represents sbt 2.x, the next major sbt series. Next minor branch is where new features should be added as long as it is binary compatible with sbt 1.x. The `stable` branch represents the current stable sbt release. Only bug fixes are back-ported to the stable branch. +### Note on supported JDK version for the SBT build + +The SBT build itself currently doesn't support any JDK beyond version 17. You will run into deprecation warnings (which would become build errors due to build configuration) if you use any later JDK version to build SBT. + +If you're using Metals as IDE, also check the `Java Version` setting. The default at the time of writing this is `17`, but this may change in the future, or you may have set it to a later version yourself. (Be aware that Metals may download a JDK in the background if you haven't switch to a local JDK matching the version before changing this setting. Also, this setting is currently only available as a `User` setting, so you can't set it for a single workspace. Don't forget to switch back if you need to for other projects). + ### Instruction to build just sbt Sbt has a number of sub-modules. If the change you are making is just contained in sbt/sbt (not one of the sub-modules), From 860e170b6c6a3677e621ca983788424c16bba482 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sun, 7 Jul 2024 18:12:34 -0400 Subject: [PATCH 16/17] sbt 1.10.1 --- sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbt b/sbt index 7d3f707e8..0274f67d0 100755 --- a/sbt +++ b/sbt @@ -1,7 +1,7 @@ #!/usr/bin/env bash set +e -declare builtin_sbt_version="1.10.0" +declare builtin_sbt_version="1.10.1" declare -a residual_args declare -a java_args declare -a scalac_args From 7dafcd2df2c487b04d02a6986b128b4f50e710da Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Thu, 8 Aug 2024 00:02:49 -0400 Subject: [PATCH 17/17] Update Scala 3 doc test Current test depends on JCenter. --- .../doc-scala3/{m3 => a}/src/main/scala/foo/A.scala | 0 sbt-app/src/sbt-test/actions/doc-scala3/build.sbt | 10 ++++------ sbt-app/src/sbt-test/actions/doc-scala3/test | 8 ++++---- 3 files changed, 8 insertions(+), 10 deletions(-) rename sbt-app/src/sbt-test/actions/doc-scala3/{m3 => a}/src/main/scala/foo/A.scala (100%) diff --git a/sbt-app/src/sbt-test/actions/doc-scala3/m3/src/main/scala/foo/A.scala b/sbt-app/src/sbt-test/actions/doc-scala3/a/src/main/scala/foo/A.scala similarity index 100% rename from sbt-app/src/sbt-test/actions/doc-scala3/m3/src/main/scala/foo/A.scala rename to sbt-app/src/sbt-test/actions/doc-scala3/a/src/main/scala/foo/A.scala diff --git a/sbt-app/src/sbt-test/actions/doc-scala3/build.sbt b/sbt-app/src/sbt-test/actions/doc-scala3/build.sbt index 583a736e0..daa934878 100644 --- a/sbt-app/src/sbt-test/actions/doc-scala3/build.sbt +++ b/sbt-app/src/sbt-test/actions/doc-scala3/build.sbt @@ -1,11 +1,9 @@ -lazy val m3 = (project in file("m3")) - .settings( - scalaVersion := "3.0.0-M3", - resolvers += Resolver.JCenterRepository - ) - lazy val rc1 = (project in file("rc1")) .settings( scalaVersion := "3.0.0-RC1" ) +lazy val a = project + .settings( + scalaVersion := "3.4.2", + ) diff --git a/sbt-app/src/sbt-test/actions/doc-scala3/test b/sbt-app/src/sbt-test/actions/doc-scala3/test index c13e97789..064d840f4 100644 --- a/sbt-app/src/sbt-test/actions/doc-scala3/test +++ b/sbt-app/src/sbt-test/actions/doc-scala3/test @@ -6,10 +6,10 @@ $ exists rc1/target/scala-3.0.0-RC1/api/api/index.html $ exists rc1/target/scala-3.0.0-RC1/api/api/foo/A$.html $ exists rc1/target/scala-3.0.0-RC1/api/api/foo.html -> m3 / doc +> a / doc # there shouldn't be two api/ directories # see https://github.com/lampepfl/dotty/issues/11412 -$ exists m3/target/scala-3.0.0-M3/api/index.html -$ exists m3/target/scala-3.0.0-M3/api/api/foo/A$.html -$ exists m3/target/scala-3.0.0-M3/api/api/foo.html +$ exists a/target/scala-3.4.2/api/index.html +$ exists a/target/scala-3.4.2/api/foo/A$.html +$ exists a/target/scala-3.4.2/api/foo.html