浏览代码

update JDK version to 21 or 17 in Scala frameworks to get the performance improvements from recent JDK versions: (#9837)

- akka-http
- blaze
- cask
- finagle
- finatra
- finch
- http4s
- otavia
- pekko-http
- scalene
- vertx-web-scala
- youi
Alpha Ho 4 月之前
父节点
当前提交
c588c09094
共有 73 个文件被更改,包括 146 次插入1382 次删除
  1. 1 1
      frameworks/Scala/akka-http/akka-http-slick-postgres.dockerfile
  2. 1 1
      frameworks/Scala/akka-http/akka-http-slick-postgres/build.sbt
  3. 1 1
      frameworks/Scala/akka-http/akka-http-slick-postgres/project/build.properties
  4. 1 1
      frameworks/Scala/akka-http/akka-http-slick-postgres/project/plugins.sbt
  5. 1 1
      frameworks/Scala/akka-http/akka-http-slick-postgres/src/main/scala/net/benchmark/akka/http/fortune/FortuneRoute.scala
  6. 2 2
      frameworks/Scala/akka-http/akka-http.dockerfile
  7. 1 1
      frameworks/Scala/akka-http/akka-http/build.sbt
  8. 1 1
      frameworks/Scala/akka-http/akka-http/project/build.properties
  9. 4 4
      frameworks/Scala/blaze/blaze.dockerfile
  10. 12 5
      frameworks/Scala/blaze/build.sbt
  11. 1 1
      frameworks/Scala/blaze/project/build.properties
  12. 0 579
      frameworks/Scala/blaze/sbt
  13. 1 1
      frameworks/Scala/cask/build.sbt
  14. 2 2
      frameworks/Scala/cask/cask.dockerfile
  15. 1 1
      frameworks/Scala/cask/project/build.properties
  16. 1 1
      frameworks/Scala/finagle/build.sbt
  17. 2 2
      frameworks/Scala/finagle/finagle.dockerfile
  18. 1 1
      frameworks/Scala/finagle/project/build.properties
  19. 1 1
      frameworks/Scala/finatra/build.sbt
  20. 2 2
      frameworks/Scala/finatra/finatra.dockerfile
  21. 1 1
      frameworks/Scala/finatra/project/build.properties
  22. 1 1
      frameworks/Scala/finch/build.sbt
  23. 2 2
      frameworks/Scala/finch/finch.dockerfile
  24. 1 1
      frameworks/Scala/finch/project/build.properties
  25. 1 1
      frameworks/Scala/http4s/blaze/project/build.properties
  26. 2 0
      frameworks/Scala/http4s/blaze/project/plugins.sbt
  27. 3 4
      frameworks/Scala/http4s/http4s.dockerfile
  28. 0 664
      frameworks/Scala/http4s/sbt
  29. 1 1
      frameworks/Scala/otavia/.mill-version
  30. 1 1
      frameworks/Scala/otavia/build.sc
  31. 2 1
      frameworks/Scala/otavia/otavia-overshoot.dockerfile
  32. 2 1
      frameworks/Scala/otavia/otavia.dockerfile
  33. 2 2
      frameworks/Scala/pekko-http/pekko-http.dockerfile
  34. 1 1
      frameworks/Scala/pekko-http/pekko-http/build.sbt
  35. 1 1
      frameworks/Scala/pekko-http/pekko-http/project/build.properties
  36. 2 2
      frameworks/Scala/play2-scala/benchmark_config.json
  37. 3 2
      frameworks/Scala/play2-scala/play2-scala-anorm-netty.dockerfile
  38. 3 2
      frameworks/Scala/play2-scala/play2-scala-anorm.dockerfile
  39. 3 3
      frameworks/Scala/play2-scala/play2-scala-anorm/build.sbt
  40. 3 3
      frameworks/Scala/play2-scala/play2-scala-anorm/conf/application.conf
  41. 1 1
      frameworks/Scala/play2-scala/play2-scala-anorm/project/build.properties
  42. 1 1
      frameworks/Scala/play2-scala/play2-scala-anorm/project/plugins.sbt
  43. 2 2
      frameworks/Scala/play2-scala/play2-scala-netty.dockerfile
  44. 2 2
      frameworks/Scala/play2-scala/play2-scala-reactivemongo-netty.dockerfile
  45. 2 2
      frameworks/Scala/play2-scala/play2-scala-reactivemongo.dockerfile
  46. 11 10
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/app/controllers/Application.scala
  47. 3 3
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/build.sbt
  48. 3 3
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/conf/application.conf
  49. 1 1
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/project/build.properties
  50. 1 1
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/project/plugins.sbt
  51. 2 2
      frameworks/Scala/play2-scala/play2-scala-slick-netty.dockerfile
  52. 2 2
      frameworks/Scala/play2-scala/play2-scala-slick.dockerfile
  53. 5 9
      frameworks/Scala/play2-scala/play2-scala-slick/app/controllers/Application.scala
  54. 8 2
      frameworks/Scala/play2-scala/play2-scala-slick/app/models/World.scala
  55. 3 3
      frameworks/Scala/play2-scala/play2-scala-slick/build.sbt
  56. 5 5
      frameworks/Scala/play2-scala/play2-scala-slick/conf/application.conf
  57. 1 1
      frameworks/Scala/play2-scala/play2-scala-slick/project/build.properties
  58. 1 1
      frameworks/Scala/play2-scala/play2-scala-slick/project/plugins.sbt
  59. 2 2
      frameworks/Scala/play2-scala/play2-scala.dockerfile
  60. 1 1
      frameworks/Scala/play2-scala/play2-scala/build.sbt
  61. 3 3
      frameworks/Scala/play2-scala/play2-scala/conf/application.conf
  62. 1 1
      frameworks/Scala/play2-scala/play2-scala/project/build.properties
  63. 1 1
      frameworks/Scala/play2-scala/play2-scala/project/plugins.sbt
  64. 1 11
      frameworks/Scala/scalene/scalene.dockerfile
  65. 1 1
      frameworks/Scala/sharaf/.mill-version
  66. 1 1
      frameworks/Scala/sharaf/sharaf.dockerfile
  67. 1 1
      frameworks/Scala/vertx-web-scala/build.sbt
  68. 1 1
      frameworks/Scala/vertx-web-scala/project/build.properties
  69. 1 1
      frameworks/Scala/vertx-web-scala/vertx-web-scala.dockerfile
  70. 1 1
      frameworks/Scala/youi/build.sbt
  71. 1 1
      frameworks/Scala/youi/project/build.properties
  72. 3 1
      frameworks/Scala/youi/project/plugins.sbt
  73. 1 1
      frameworks/Scala/youi/youi.dockerfile

+ 1 - 1
frameworks/Scala/akka-http/akka-http-slick-postgres.dockerfile

@@ -1,4 +1,4 @@
-FROM hseeberger/scala-sbt:8u265_1.3.13_2.13.3
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16
 
 WORKDIR /akka-http-slick-postgres
 

+ 1 - 1
frameworks/Scala/akka-http/akka-http-slick-postgres/build.sbt

@@ -62,7 +62,7 @@ lazy val commonSettings =
   Seq(
     organization := "net.benchmark.akka.http",
     organizationName := "Akka",
-    scalaVersion := "2.13.3",
+    scalaVersion := "2.13.16",
     scalacOptions ++= Seq(
       "-deprecation",
       "-encoding",

+ 1 - 1
frameworks/Scala/akka-http/akka-http-slick-postgres/project/build.properties

@@ -1 +1 @@
-sbt.version = 1.3.13
+sbt.version=1.10.11

+ 1 - 1
frameworks/Scala/akka-http/akka-http-slick-postgres/project/plugins.sbt

@@ -1,7 +1,7 @@
 addSbtPlugin("com.typesafe.sbt"   % "sbt-git"             % "1.0.0")
 addSbtPlugin("com.typesafe.sbt"   % "sbt-native-packager" % "1.3.16")
 addSbtPlugin("com.lucidchart"     % "sbt-scalafmt"        % "1.15")
-addSbtPlugin("org.wartremover"    % "sbt-wartremover"     % "2.4.10")
+addSbtPlugin("org.wartremover"    % "sbt-wartremover"     % "3.3.2")
 addSbtPlugin("io.get-coursier"    % "sbt-coursier"        % "1.0.3")
 
 libraryDependencies += "org.slf4j" % "slf4j-nop" % "1.7.25" // Needed by sbt-git

+ 1 - 1
frameworks/Scala/akka-http/akka-http-slick-postgres/src/main/scala/net/benchmark/akka/http/fortune/FortuneRoute.scala

@@ -35,7 +35,7 @@ object FortuneRoute {
 
 class FortuneRoute(fr: FortuneRepository, sd: ExecutionContextExecutor)(implicit val system: ActorSystem) {
 
-  private implicit val fmar = FortuneRoute.fm
+  private implicit val fmar: ToEntityMarshaller[Seq[Fortune]] = FortuneRoute.fm
 
   private def source(p: DatabasePublisher[Fortune]): Source[Fortune, NotUsed] = {
     Source

+ 2 - 2
frameworks/Scala/akka-http/akka-http.dockerfile

@@ -1,4 +1,4 @@
-FROM hseeberger/scala-sbt:8u265_1.3.13_2.13.3
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16
 
 WORKDIR /akka-http
 
@@ -23,4 +23,4 @@ RUN sbt clean compile stage
 
 EXPOSE 9000
 
-CMD ["target/universal/stage/bin/akka-http-benchmark", "-Dakka.http.benchmark.mysql.dbhost=tfb-database", "-J-server", "-J-Xms2g", "-J-Xmx2g", "-J-XX:NewSize=1g", "-J-XX:MaxNewSize=1g", "-J-XX:InitialCodeCacheSize=256m", "-J-XX:ReservedCodeCacheSize=256m", "-J-XX:+UseParallelGC", "-J-XX:-UseBiasedLocking", "-J-XX:+AlwaysPreTouch", "-J-XX:+UseNUMA", "-J-XX:+AggressiveOpts"]
+CMD ["target/universal/stage/bin/akka-http-benchmark", "-Dakka.http.benchmark.mysql.dbhost=tfb-database", "-J-server", "-J-Xms2g", "-J-Xmx2g", "-J-XX:NewSize=1g", "-J-XX:MaxNewSize=1g", "-J-XX:InitialCodeCacheSize=256m", "-J-XX:ReservedCodeCacheSize=256m", "-J-XX:+UseParallelGC", "-J-XX:+AlwaysPreTouch", "-J-XX:+UseNUMA"]

+ 1 - 1
frameworks/Scala/akka-http/akka-http/build.sbt

@@ -6,7 +6,7 @@ name := "akka-http-benchmark"
 
 version := "0.1.0-SNAPSHOT"
 
-scalaVersion := "2.13.8"
+scalaVersion := "2.13.16"
 
 val akkaV = "2.6.19"
 val akkaHttpV = "10.2.9"

+ 1 - 1
frameworks/Scala/akka-http/akka-http/project/build.properties

@@ -1 +1 @@
-sbt.version=1.5.4
+sbt.version=1.10.11

+ 4 - 4
frameworks/Scala/blaze/blaze.dockerfile

@@ -1,10 +1,10 @@
-FROM openjdk:15
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16
+
 WORKDIR /blaze
 COPY project project
 COPY src src
 COPY build.sbt build.sbt
-COPY sbt sbt
-RUN ./sbt assembly -batch && \
+RUN sbt assembly -batch && \
     mv target/blaze-assembly-1.0.jar . && \
     rm -Rf target && \
     rm -Rf project/target && \
@@ -14,4 +14,4 @@ RUN ./sbt assembly -batch && \
 
 EXPOSE 8080
 
-CMD ["java", "-server", "-Xms2g", "-Xmx2g", "-XX:NewSize=1g", "-XX:MaxNewSize=1g", "-XX:InitialCodeCacheSize=256m", "-XX:ReservedCodeCacheSize=256m", "-XX:+UseParallelGC", "-XX:+UseNUMA", "-XX:-UseBiasedLocking", "-XX:+AlwaysPreTouch", "-jar", "blaze-assembly-1.0.jar", "tfb-database"]
+CMD ["java", "-server", "-Xms2g", "-Xmx2g", "-XX:NewSize=1g", "-XX:MaxNewSize=1g", "-XX:InitialCodeCacheSize=256m", "-XX:ReservedCodeCacheSize=256m", "-XX:+UseParallelGC", "-XX:+UseNUMA", "-XX:+AlwaysPreTouch", "-jar", "blaze-assembly-1.0.jar", "tfb-database"]

+ 12 - 5
frameworks/Scala/blaze/build.sbt

@@ -2,12 +2,19 @@ name := "blaze"
 
 version := "1.0"
 
-scalaVersion := "2.13.5"
+scalaVersion := "2.13.16"
 
 libraryDependencies ++= Seq(
-	"org.http4s" %% "blaze-http" % "0.14.16",
-	"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % "2.7.3",
-	"ch.qos.logback" % "logback-classic" % "1.2.3"
+	"org.http4s" %% "blaze-http" % "0.14.18",
+	"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % "2.34.0",
+	"ch.qos.logback" % "logback-classic" % "1.5.18"
 )
 
-crossPaths := false
+crossPaths := false
+
+assembly / assemblyMergeStrategy  := {
+	case x if x.contains("module-info.class") => MergeStrategy.discard
+	case x =>
+		val oldStrategy = (assembly / assemblyMergeStrategy).value
+		oldStrategy(x)
+}

+ 1 - 1
frameworks/Scala/blaze/project/build.properties

@@ -1 +1 @@
-sbt.version=1.5.1
+sbt.version=1.10.11

+ 0 - 579
frameworks/Scala/blaze/sbt

@@ -1,579 +0,0 @@
-#!/usr/bin/env bash
-#
-# A more capable sbt runner, coincidentally also called sbt.
-# Author: Paul Phillips <[email protected]>
-# https://github.com/paulp/sbt-extras
-
-set -o pipefail
-
-declare -r sbt_release_version="1.2.8"
-declare -r sbt_unreleased_version="1.3.0-RC1"
-
-declare -r latest_213="2.13.0"
-declare -r latest_212="2.12.8"
-declare -r latest_211="2.11.12"
-declare -r latest_210="2.10.7"
-declare -r latest_29="2.9.3"
-declare -r latest_28="2.8.2"
-
-declare -r buildProps="project/build.properties"
-
-declare -r sbt_launch_ivy_release_repo="https://repo.typesafe.com/typesafe/ivy-releases"
-declare -r sbt_launch_ivy_snapshot_repo="https://repo.scala-sbt.org/scalasbt/ivy-snapshots"
-declare -r sbt_launch_mvn_release_repo="https://repo.scala-sbt.org/scalasbt/maven-releases"
-declare -r sbt_launch_mvn_snapshot_repo="https://repo.scala-sbt.org/scalasbt/maven-snapshots"
-
-declare -r default_jvm_opts_common="-Xms512m -Xss2m"
-declare -r noshare_opts="-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy"
-
-declare sbt_jar sbt_dir sbt_create sbt_version sbt_script sbt_new
-declare sbt_explicit_version
-declare verbose noshare batch trace_level
-declare debugUs
-
-declare java_cmd="java"
-declare sbt_launch_dir="$HOME/.sbt/launchers"
-declare sbt_launch_repo
-
-# pull -J and -D options to give to java.
-declare -a java_args scalac_args sbt_commands residual_args
-
-# args to jvm/sbt via files or environment variables
-declare -a extra_jvm_opts extra_sbt_opts
-
-echoerr () { echo >&2 "$@"; }
-vlog ()    { [[ -n "$verbose" ]] && echoerr "$@"; }
-die ()     { echo "Aborting: $*" ; exit 1; }
-
-setTrapExit () {
-  # save stty and trap exit, to ensure echo is re-enabled if we are interrupted.
-  SBT_STTY="$(stty -g 2>/dev/null)"
-  export SBT_STTY
-
-  # restore stty settings (echo in particular)
-  onSbtRunnerExit() {
-    [ -t 0 ] || return
-    vlog ""
-    vlog "restoring stty: $SBT_STTY"
-    stty "$SBT_STTY"
-  }
-
-  vlog "saving stty: $SBT_STTY"
-  trap onSbtRunnerExit EXIT
-}
-
-# this seems to cover the bases on OSX, and someone will
-# have to tell me about the others.
-get_script_path () {
-  local path="$1"
-  [[ -L "$path" ]] || { echo "$path" ; return; }
-
-  local -r target="$(readlink "$path")"
-  if [[ "${target:0:1}" == "/" ]]; then
-    echo "$target"
-  else
-    echo "${path%/*}/$target"
-  fi
-}
-
-script_path="$(get_script_path "${BASH_SOURCE[0]}")"
-declare -r script_path
-script_name="${script_path##*/}"
-declare -r script_name
-
-init_default_option_file () {
-  local overriding_var="${!1}"
-  local default_file="$2"
-  if [[ ! -r "$default_file" && "$overriding_var" =~ ^@(.*)$ ]]; then
-    local envvar_file="${BASH_REMATCH[1]}"
-    if [[ -r "$envvar_file" ]]; then
-      default_file="$envvar_file"
-    fi
-  fi
-  echo "$default_file"
-}
-
-sbt_opts_file="$(init_default_option_file SBT_OPTS .sbtopts)"
-jvm_opts_file="$(init_default_option_file JVM_OPTS .jvmopts)"
-
-build_props_sbt () {
-  [[ -r "$buildProps" ]] && \
-    grep '^sbt\.version' "$buildProps" | tr '=\r' ' ' | awk '{ print $2; }'
-}
-
-set_sbt_version () {
-  sbt_version="${sbt_explicit_version:-$(build_props_sbt)}"
-  [[ -n "$sbt_version" ]] || sbt_version=$sbt_release_version
-  export sbt_version
-}
-
-url_base () {
-  local version="$1"
-
-  case "$version" in
-        0.7.*) echo "http://simple-build-tool.googlecode.com" ;;
-      0.10.* ) echo "$sbt_launch_ivy_release_repo" ;;
-    0.11.[12]) echo "$sbt_launch_ivy_release_repo" ;;
-    0.*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]) # ie "*-yyyymmdd-hhMMss"
-               echo "$sbt_launch_ivy_snapshot_repo" ;;
-          0.*) echo "$sbt_launch_ivy_release_repo" ;;
-    *-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]) # ie "*-yyyymmdd-hhMMss"
-               echo "$sbt_launch_mvn_snapshot_repo" ;;
-            *) echo "$sbt_launch_mvn_release_repo" ;;
-  esac
-}
-
-make_url () {
-  local version="$1"
-
-  local base="${sbt_launch_repo:-$(url_base "$version")}"
-
-  case "$version" in
-        0.7.*) echo "$base/files/sbt-launch-0.7.7.jar" ;;
-      0.10.* ) echo "$base/org.scala-tools.sbt/sbt-launch/$version/sbt-launch.jar" ;;
-    0.11.[12]) echo "$base/org.scala-tools.sbt/sbt-launch/$version/sbt-launch.jar" ;;
-          0.*) echo "$base/org.scala-sbt/sbt-launch/$version/sbt-launch.jar" ;;
-        1.5.*) echo "$base/org/scala-sbt/sbt-launch/$version/sbt-launch-$version.jar" ;;
-            *) echo "$base/org/scala-sbt/sbt-launch/$version/sbt-launch.jar" ;;
-  esac
-}
-
-addJava ()     { vlog "[addJava] arg = '$1'"   ;     java_args+=("$1"); }
-addSbt ()      { vlog "[addSbt] arg = '$1'"    ;  sbt_commands+=("$1"); }
-addScalac ()   { vlog "[addScalac] arg = '$1'" ;   scalac_args+=("$1"); }
-addResidual () { vlog "[residual] arg = '$1'"  ; residual_args+=("$1"); }
-
-addResolver () { addSbt "set resolvers += $1"; }
-addDebugger () { addJava "-Xdebug" ; addJava "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1"; }
-setThisBuild () {
-  vlog "[addBuild] args = '$*'"
-  local key="$1" && shift
-  addSbt "set $key in ThisBuild := $*"
-}
-setScalaVersion () {
-  [[ "$1" == *"-SNAPSHOT" ]] && addResolver 'Resolver.sonatypeRepo("snapshots")'
-  addSbt "++ $1"
-}
-setJavaHome () {
-  java_cmd="$1/bin/java"
-  setThisBuild javaHome "_root_.scala.Some(file(\"$1\"))"
-  export JAVA_HOME="$1"
-  export JDK_HOME="$1"
-  export PATH="$JAVA_HOME/bin:$PATH"
-}
-
-getJavaVersion() {
-  local -r str=$("$1" -version 2>&1 | grep -E -e '(java|openjdk) version' | awk '{ print $3 }' | tr -d '"')
-
-  # java -version on java8 says 1.8.x
-  # but on 9 and 10 it's 9.x.y and 10.x.y.
-  if [[ "$str" =~ ^1\.([0-9]+)\..*$ ]]; then
-    echo "${BASH_REMATCH[1]}"
-  elif [[ "$str" =~ ^([0-9]+)\..*$ ]]; then
-    echo "${BASH_REMATCH[1]}"
-  elif [[ -n "$str" ]]; then
-    echoerr "Can't parse java version from: $str"
-  fi
-}
-
-checkJava() {
-  # Warn if there is a Java version mismatch between PATH and JAVA_HOME/JDK_HOME
-
-  [[ -n "$JAVA_HOME" && -e "$JAVA_HOME/bin/java"     ]] && java="$JAVA_HOME/bin/java"
-  [[ -n "$JDK_HOME"  && -e "$JDK_HOME/lib/tools.jar" ]] && java="$JDK_HOME/bin/java"
-
-  if [[ -n "$java" ]]; then
-    pathJavaVersion=$(getJavaVersion java)
-    homeJavaVersion=$(getJavaVersion "$java")
-    if [[ "$pathJavaVersion" != "$homeJavaVersion" ]]; then
-      echoerr "Warning: Java version mismatch between PATH and JAVA_HOME/JDK_HOME, sbt will use the one in PATH"
-      echoerr "  Either: fix your PATH, remove JAVA_HOME/JDK_HOME or use -java-home"
-      echoerr "  java version from PATH:               $pathJavaVersion"
-      echoerr "  java version from JAVA_HOME/JDK_HOME: $homeJavaVersion"
-    fi
-  fi
-}
-
-java_version () {
-  local -r version=$(getJavaVersion "$java_cmd")
-  vlog "Detected Java version: $version"
-  echo "$version"
-}
-
-# MaxPermSize critical on pre-8 JVMs but incurs noisy warning on 8+
-default_jvm_opts () {
-  local -r v="$(java_version)"
-  if [[ $v -ge 8 ]]; then
-    echo "$default_jvm_opts_common"
-  else
-    echo "-XX:MaxPermSize=384m $default_jvm_opts_common"
-  fi
-}
-
-build_props_scala () {
-  if [[ -r "$buildProps" ]]; then
-    versionLine="$(grep '^build.scala.versions' "$buildProps")"
-    versionString="${versionLine##build.scala.versions=}"
-    echo "${versionString%% .*}"
-  fi
-}
-
-execRunner () {
-  # print the arguments one to a line, quoting any containing spaces
-  vlog "# Executing command line:" && {
-    for arg; do
-      if [[ -n "$arg" ]]; then
-        if printf "%s\n" "$arg" | grep -q ' '; then
-          printf >&2 "\"%s\"\n" "$arg"
-        else
-          printf >&2 "%s\n" "$arg"
-        fi
-      fi
-    done
-    vlog ""
-  }
-
-  setTrapExit
-
-  if [[ -n "$batch" ]]; then
-    "$@" < /dev/null
-  else
-    "$@"
-  fi
-}
-
-jar_url ()  { make_url "$1"; }
-
-is_cygwin () { [[ "$(uname -a)" == "CYGWIN"* ]]; }
-
-jar_file () {
-  is_cygwin \
-  && cygpath -w "$sbt_launch_dir/$1/sbt-launch.jar" \
-  || echo "$sbt_launch_dir/$1/sbt-launch.jar"
-}
-
-download_url () {
-  local url="$1"
-  local jar="$2"
-
-  echoerr "Downloading sbt launcher for $sbt_version:"
-  echoerr "  From  $url"
-  echoerr "    To  $jar"
-
-  mkdir -p "${jar%/*}" && {
-    if command -v curl > /dev/null 2>&1; then
-      curl --fail --silent --location "$url" --output "$jar"
-    elif command -v wget > /dev/null 2>&1; then
-      wget -q -O "$jar" "$url"
-    fi
-  } && [[ -r "$jar" ]]
-}
-
-acquire_sbt_jar () {
-  {
-    sbt_jar="$(jar_file "$sbt_version")"
-    [[ -r "$sbt_jar" ]]
-  } || {
-    sbt_jar="$HOME/.ivy2/local/org.scala-sbt/sbt-launch/$sbt_version/jars/sbt-launch.jar"
-    [[ -r "$sbt_jar" ]]
-  } || {
-    sbt_jar="$(jar_file "$sbt_version")"
-    download_url "$(make_url "$sbt_version")" "$sbt_jar"
-  }
-}
-
-usage () {
-  set_sbt_version
-  cat <<EOM
-Usage: $script_name [options]
-
-Note that options which are passed along to sbt begin with -- whereas
-options to this runner use a single dash. Any sbt command can be scheduled
-to run first by prefixing the command with --, so --warn, --error and so on
-are not special.
-
-Output filtering: if there is a file in the home directory called .sbtignore
-and this is not an interactive sbt session, the file is treated as a list of
-bash regular expressions. Output lines which match any regex are not echoed.
-One can see exactly which lines would have been suppressed by starting this
-runner with the -x option.
-
-  -h | -help         print this message
-  -v                 verbose operation (this runner is chattier)
-  -d, -w, -q         aliases for --debug, --warn, --error (q means quiet)
-  -x                 debug this script
-  -trace <level>     display stack traces with a max of <level> frames (default: -1, traces suppressed)
-  -debug-inc         enable debugging log for the incremental compiler
-  -no-colors         disable ANSI color codes
-  -sbt-create        start sbt even if current directory contains no sbt project
-  -sbt-dir   <path>  path to global settings/plugins directory (default: ~/.sbt/<version>)
-  -sbt-boot  <path>  path to shared boot directory (default: ~/.sbt/boot in 0.11+)
-  -ivy       <path>  path to local Ivy repository (default: ~/.ivy2)
-  -no-share          use all local caches; no sharing
-  -offline           put sbt in offline mode
-  -jvm-debug <port>  Turn on JVM debugging, open at the given port.
-  -batch             Disable interactive mode
-  -prompt <expr>     Set the sbt prompt; in expr, 's' is the State and 'e' is Extracted
-  -script <file>     Run the specified file as a scala script
-
-  # sbt version (default: sbt.version from $buildProps if present, otherwise $sbt_release_version)
-  -sbt-force-latest         force the use of the latest release of sbt: $sbt_release_version
-  -sbt-version  <version>   use the specified version of sbt (default: $sbt_release_version)
-  -sbt-dev                  use the latest pre-release version of sbt: $sbt_unreleased_version
-  -sbt-jar      <path>      use the specified jar as the sbt launcher
-  -sbt-launch-dir <path>    directory to hold sbt launchers (default: $sbt_launch_dir)
-  -sbt-launch-repo <url>    repo url for downloading sbt launcher jar (default: $(url_base "$sbt_version"))
-
-  # scala version (default: as chosen by sbt)
-  -28                       use $latest_28
-  -29                       use $latest_29
-  -210                      use $latest_210
-  -211                      use $latest_211
-  -212                      use $latest_212
-  -213                      use $latest_213
-  -scala-home <path>        use the scala build at the specified directory
-  -scala-version <version>  use the specified version of scala
-  -binary-version <version> use the specified scala version when searching for dependencies
-
-  # java version (default: java from PATH, currently $(java -version 2>&1 | grep version))
-  -java-home <path>         alternate JAVA_HOME
-
-  # passing options to the jvm - note it does NOT use JAVA_OPTS due to pollution
-  # The default set is used if JVM_OPTS is unset and no -jvm-opts file is found
-  <default>        $(default_jvm_opts)
-  JVM_OPTS         environment variable holding either the jvm args directly, or
-                   the reference to a file containing jvm args if given path is prepended by '@' (e.g. '@/etc/jvmopts')
-                   Note: "@"-file is overridden by local '.jvmopts' or '-jvm-opts' argument.
-  -jvm-opts <path> file containing jvm args (if not given, .jvmopts in project root is used if present)
-  -Dkey=val        pass -Dkey=val directly to the jvm
-  -J-X             pass option -X directly to the jvm (-J is stripped)
-
-  # passing options to sbt, OR to this runner
-  SBT_OPTS         environment variable holding either the sbt args directly, or
-                   the reference to a file containing sbt args if given path is prepended by '@' (e.g. '@/etc/sbtopts')
-                   Note: "@"-file is overridden by local '.sbtopts' or '-sbt-opts' argument.
-  -sbt-opts <path> file containing sbt args (if not given, .sbtopts in project root is used if present)
-  -S-X             add -X to sbt's scalacOptions (-S is stripped)
-EOM
-}
-
-process_args () {
-  require_arg () {
-    local type="$1"
-    local opt="$2"
-    local arg="$3"
-
-    if [[ -z "$arg" ]] || [[ "${arg:0:1}" == "-" ]]; then
-      die "$opt requires <$type> argument"
-    fi
-  }
-  while [[ $# -gt 0 ]]; do
-    case "$1" in
-          -h|-help) usage; exit 0 ;;
-                -v) verbose=true && shift ;;
-                -d) addSbt "--debug" && shift ;;
-                -w) addSbt "--warn"  && shift ;;
-                -q) addSbt "--error" && shift ;;
-                -x) debugUs=true && shift ;;
-            -trace) require_arg integer "$1" "$2" && trace_level="$2" && shift 2 ;;
-              -ivy) require_arg path "$1" "$2" && addJava "-Dsbt.ivy.home=$2" && shift 2 ;;
-        -no-colors) addJava "-Dsbt.log.noformat=true" && shift ;;
-         -no-share) noshare=true && shift ;;
-         -sbt-boot) require_arg path "$1" "$2" && addJava "-Dsbt.boot.directory=$2" && shift 2 ;;
-          -sbt-dir) require_arg path "$1" "$2" && sbt_dir="$2" && shift 2 ;;
-        -debug-inc) addJava "-Dxsbt.inc.debug=true" && shift ;;
-          -offline) addSbt "set offline in Global := true" && shift ;;
-        -jvm-debug) require_arg port "$1" "$2" && addDebugger "$2" && shift 2 ;;
-            -batch) batch=true && shift ;;
-           -prompt) require_arg "expr" "$1" "$2" && setThisBuild shellPrompt "(s => { val e = Project.extract(s) ; $2 })" && shift 2 ;;
-           -script) require_arg file "$1" "$2" && sbt_script="$2" && addJava "-Dsbt.main.class=sbt.ScriptMain" && shift 2 ;;
-
-       -sbt-create) sbt_create=true && shift ;;
-          -sbt-jar) require_arg path "$1" "$2" && sbt_jar="$2" && shift 2 ;;
-      -sbt-version) require_arg version "$1" "$2" && sbt_explicit_version="$2" && shift 2 ;;
- -sbt-force-latest) sbt_explicit_version="$sbt_release_version" && shift ;;
-          -sbt-dev) sbt_explicit_version="$sbt_unreleased_version" && shift ;;
-   -sbt-launch-dir) require_arg path "$1" "$2" && sbt_launch_dir="$2" && shift 2 ;;
-  -sbt-launch-repo) require_arg path "$1" "$2" && sbt_launch_repo="$2" && shift 2 ;;
-    -scala-version) require_arg version "$1" "$2" && setScalaVersion "$2" && shift 2 ;;
-   -binary-version) require_arg version "$1" "$2" && setThisBuild scalaBinaryVersion "\"$2\"" && shift 2 ;;
-       -scala-home) require_arg path "$1" "$2" && setThisBuild scalaHome "_root_.scala.Some(file(\"$2\"))" && shift 2 ;;
-        -java-home) require_arg path "$1" "$2" && setJavaHome "$2" && shift 2 ;;
-         -sbt-opts) require_arg path "$1" "$2" && sbt_opts_file="$2" && shift 2 ;;
-         -jvm-opts) require_arg path "$1" "$2" && jvm_opts_file="$2" && shift 2 ;;
-
-               -D*) addJava "$1" && shift ;;
-               -J*) addJava "${1:2}" && shift ;;
-               -S*) addScalac "${1:2}" && shift ;;
-               -28) setScalaVersion "$latest_28" && shift ;;
-               -29) setScalaVersion "$latest_29" && shift ;;
-              -210) setScalaVersion "$latest_210" && shift ;;
-              -211) setScalaVersion "$latest_211" && shift ;;
-              -212) setScalaVersion "$latest_212" && shift ;;
-              -213) setScalaVersion "$latest_213" && shift ;;
-               new) sbt_new=true && : ${sbt_explicit_version:=$sbt_release_version} && addResidual "$1" && shift ;;
-                 *) addResidual "$1" && shift ;;
-    esac
-  done
-}
-
-# process the direct command line arguments
-process_args "$@"
-
-# skip #-styled comments and blank lines
-readConfigFile() {
-  local end=false
-  until $end; do
-    read -r || end=true
-    [[ $REPLY =~ ^# ]] || [[ -z $REPLY ]] || echo "$REPLY"
-  done < "$1"
-}
-
-# if there are file/environment sbt_opts, process again so we
-# can supply args to this runner
-if [[ -r "$sbt_opts_file" ]]; then
-  vlog "Using sbt options defined in file $sbt_opts_file"
-  while read -r opt; do extra_sbt_opts+=("$opt"); done < <(readConfigFile "$sbt_opts_file")
-elif [[ -n "$SBT_OPTS" && ! ("$SBT_OPTS" =~ ^@.*) ]]; then
-  vlog "Using sbt options defined in variable \$SBT_OPTS"
-  IFS=" " read -r -a extra_sbt_opts <<< "$SBT_OPTS"
-else
-  vlog "No extra sbt options have been defined"
-fi
-
-[[ -n "${extra_sbt_opts[*]}" ]] && process_args "${extra_sbt_opts[@]}"
-
-# reset "$@" to the residual args
-set -- "${residual_args[@]}"
-argumentCount=$#
-
-# set sbt version
-set_sbt_version
-
-checkJava
-
-# only exists in 0.12+
-setTraceLevel() {
-  case "$sbt_version" in
-    "0.7."* | "0.10."* | "0.11."* ) echoerr "Cannot set trace level in sbt version $sbt_version" ;;
-                                 *) setThisBuild traceLevel "$trace_level" ;;
-  esac
-}
-
-# set scalacOptions if we were given any -S opts
-[[ ${#scalac_args[@]} -eq 0 ]] || addSbt "set scalacOptions in ThisBuild += \"${scalac_args[*]}\""
-
-[[ -n "$sbt_explicit_version" && -z "$sbt_new" ]] && addJava "-Dsbt.version=$sbt_explicit_version"
-vlog "Detected sbt version $sbt_version"
-
-if [[ -n "$sbt_script" ]]; then
-  residual_args=( "$sbt_script" "${residual_args[@]}" )
-else
-  # no args - alert them there's stuff in here
-  (( argumentCount > 0 )) || {
-    vlog "Starting $script_name: invoke with -help for other options"
-    residual_args=( shell )
-  }
-fi
-
-# verify this is an sbt dir, -create was given or user attempts to run a scala script
-[[ -r ./build.sbt || -d ./project || -n "$sbt_create" || -n "$sbt_script" || -n "$sbt_new" ]] || {
-  cat <<EOM
-$(pwd) doesn't appear to be an sbt project.
-If you want to start sbt anyway, run:
-  $0 -sbt-create
-
-EOM
-  exit 1
-}
-
-# pick up completion if present; todo
-# shellcheck disable=SC1091
-[[ -r .sbt_completion.sh ]] && source .sbt_completion.sh
-
-# directory to store sbt launchers
-[[ -d "$sbt_launch_dir" ]] || mkdir -p "$sbt_launch_dir"
-[[ -w "$sbt_launch_dir" ]] || sbt_launch_dir="$(mktemp -d -t sbt_extras_launchers.XXXXXX)"
-
-# no jar? download it.
-[[ -r "$sbt_jar" ]] || acquire_sbt_jar || {
-  # still no jar? uh-oh.
-  echo "Download failed. Obtain the jar manually and place it at $sbt_jar"
-  exit 1
-}
-
-if [[ -n "$noshare" ]]; then
-  for opt in ${noshare_opts}; do
-    addJava "$opt"
-  done
-else
-  case "$sbt_version" in
-    "0.7."* | "0.10."* | "0.11."* | "0.12."* )
-      [[ -n "$sbt_dir" ]] || {
-        sbt_dir="$HOME/.sbt/$sbt_version"
-        vlog "Using $sbt_dir as sbt dir, -sbt-dir to override."
-      }
-    ;;
-  esac
-
-  if [[ -n "$sbt_dir" ]]; then
-    addJava "-Dsbt.global.base=$sbt_dir"
-  fi
-fi
-
-if [[ -r "$jvm_opts_file" ]]; then
-  vlog "Using jvm options defined in file $jvm_opts_file"
-  while read -r opt; do extra_jvm_opts+=("$opt"); done < <(readConfigFile "$jvm_opts_file")
-elif [[ -n "$JVM_OPTS" && ! ("$JVM_OPTS" =~ ^@.*) ]]; then
-  vlog "Using jvm options defined in \$JVM_OPTS variable"
-  IFS=" " read -r -a extra_jvm_opts <<< "$JVM_OPTS"
-else
-  vlog "Using default jvm options"
-  IFS=" " read -r -a extra_jvm_opts <<< "$(default_jvm_opts)"
-fi
-
-# traceLevel is 0.12+
-[[ -n "$trace_level" ]] && setTraceLevel
-
-main () {
-  execRunner "$java_cmd" \
-    "${extra_jvm_opts[@]}" \
-    "${java_args[@]}" \
-    -jar "$sbt_jar" \
-    "${sbt_commands[@]}" \
-    "${residual_args[@]}"
-}
-
-# sbt inserts this string on certain lines when formatting is enabled:
-#   val OverwriteLine = "\r\u001BM\u001B[2K"
-# ...in order not to spam the console with a million "Resolving" lines.
-# Unfortunately that makes it that much harder to work with when
-# we're not going to print those lines anyway. We strip that bit of
-# line noise, but leave the other codes to preserve color.
-mainFiltered () {
-  local -r excludeRegex=$(grep -E -v '^#|^$' ~/.sbtignore | paste -sd'|' -)
-
-  echoLine () {
-    local -r line="$1"
-    local -r line1="${line//\r\x1BM\x1B\[2K//g}"       # This strips the OverwriteLine code.
-    local -r line2="${line1//\x1B\[[0-9;]*[JKmsu]//g}" # This strips all codes - we test regexes against this.
-
-    if [[ $line2 =~ $excludeRegex ]]; then
-      [[ -n $debugUs ]] && echo "[X] $line1"
-    else
-      [[ -n $debugUs ]] && echo "    $line1" || echo "$line1"
-    fi
-  }
-
-  echoLine "Starting sbt with output filtering enabled."
-  main | while read -r line; do echoLine "$line"; done
-}
-
-# Only filter if there's a filter file and we don't see a known interactive command.
-# Obviously this is super ad hoc but I don't know how to improve on it. Testing whether
-# stdin is a terminal is useless because most of my use cases for this filtering are
-# exactly when I'm at a terminal, running sbt non-interactively.
-shouldFilter () { [[ -f ~/.sbtignore ]] && ! grep -E -q '\b(shell|console|consoleProject)\b' <<<"${residual_args[@]}"; }
-
-# run sbt
-if shouldFilter; then mainFiltered; else main; fi

+ 1 - 1
frameworks/Scala/cask/build.sbt

@@ -2,7 +2,7 @@ name := """cask-example"""
 
 version := "1.0"
 
-scalaVersion := "2.12.5"
+scalaVersion := "2.12.20"
 
 libraryDependencies ++= Seq(
   "com.lihaoyi" %% "cask" % "0.1.1",

+ 2 - 2
frameworks/Scala/cask/cask.dockerfile

@@ -1,4 +1,4 @@
-FROM hseeberger/scala-sbt:8u151-2.12.5-1.1.2
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.12.20
 WORKDIR /cask
 COPY project project
 COPY src src
@@ -7,4 +7,4 @@ RUN sbt assembly -batch
 
 EXPOSE 8080
 
-CMD ["java", "-server", "-Xms1g", "-Xmx1g", "-XX:NewSize=512m", "-XX:MaxNewSize=512m", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-XX:+UseNUMA", "-XX:-UseBiasedLocking", "-XX:+AlwaysPreTouch", "-jar", "target/scala-2.12/cask-example-assembly-1.0.jar"]
+CMD ["java", "-server", "-Xms1g", "-Xmx1g", "-XX:NewSize=512m", "-XX:MaxNewSize=512m", "-XX:+UseParallelGC", "-XX:+UseNUMA", "-XX:+AlwaysPreTouch", "-jar", "target/scala-2.12/cask-example-assembly-1.0.jar"]

+ 1 - 1
frameworks/Scala/cask/project/build.properties

@@ -1 +1 @@
-sbt.version=1.1.2
+sbt.version=1.10.11

+ 1 - 1
frameworks/Scala/finagle/build.sbt

@@ -1,7 +1,7 @@
 lazy val finagleVersion = "22.7.0"
 
 name := "finagle-benchmark"
-scalaVersion := "2.12.12"
+scalaVersion := "2.12.20"
 version := finagleVersion
 
 libraryDependencies ++= Seq(

+ 2 - 2
frameworks/Scala/finagle/finagle.dockerfile

@@ -1,4 +1,4 @@
-FROM hseeberger/scala-sbt:8u151-2.12.5-1.1.2
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.12.20
 WORKDIR /finagle
 COPY project project
 COPY src src
@@ -7,4 +7,4 @@ RUN sbt assembly -batch
 
 EXPOSE 8080
 
-CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-Dcom.twitter.finagle.tracing.enabled=false", "-Dio.netty.recycler.maxCapacityPerThread=0", "-Dio.netty.leakDetection.level=disabled", "-jar", "target/scala-2.12/finagle-benchmark.jar"]
+CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-Dcom.twitter.finagle.tracing.enabled=false", "-Dio.netty.recycler.maxCapacityPerThread=0", "-Dio.netty.leakDetection.level=disabled", "-jar", "target/scala-2.12/finagle-benchmark.jar"]

+ 1 - 1
frameworks/Scala/finagle/project/build.properties

@@ -1 +1 @@
-sbt.version=1.1.2
+sbt.version=1.10.11

+ 1 - 1
frameworks/Scala/finatra/build.sbt

@@ -4,7 +4,7 @@ name := "techempower-benchmarks-finatra"
 organization := "com.twitter"
 version := finatraVersion
 
-scalaVersion := "2.12.12"
+scalaVersion := "2.12.20"
 
 resolvers ++= Seq(
   Resolver.sonatypeRepo("releases")

+ 2 - 2
frameworks/Scala/finatra/finatra.dockerfile

@@ -1,4 +1,4 @@
-FROM hseeberger/scala-sbt:8u151-2.12.5-1.1.2
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.12.20
 WORKDIR /finatra
 COPY project project
 COPY src src
@@ -7,4 +7,4 @@ RUN sbt clean assembly -batch
 
 EXPOSE 8888
 
-CMD ["java", "-Dio.netty.recycler.maxCapacityPerThread=0", "-Dio.netty.leakDetection.level=disabled", "-Dcom.twitter.finagle.tracing.enabled=false", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-jar", "target/scala-2.12/finatra-benchmark.jar", "-http.response.charset.enabled=false"]
+CMD ["java", "-Dio.netty.recycler.maxCapacityPerThread=0", "-Dio.netty.leakDetection.level=disabled", "-Dcom.twitter.finagle.tracing.enabled=false", "--add-opens=java.base/java.lang=ALL-UNNAMED", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-jar", "target/scala-2.12/finatra-benchmark.jar", "-http.response.charset.enabled=false"]

+ 1 - 1
frameworks/Scala/finatra/project/build.properties

@@ -1 +1 @@
-sbt.version=1.1.2
+sbt.version=1.10.11

+ 1 - 1
frameworks/Scala/finch/build.sbt

@@ -2,7 +2,7 @@ lazy val finchVersion = "0.27.0"
 
 name := """techempower-benchmarks-finch"""
 version := finchVersion
-scalaVersion := "2.12.7"
+scalaVersion := "2.12.20"
 
 libraryDependencies ++= Seq(
   "com.github.finagle" %% "finchx-core" % finchVersion,

+ 2 - 2
frameworks/Scala/finch/finch.dockerfile

@@ -1,4 +1,4 @@
-FROM hseeberger/scala-sbt:8u151-2.12.5-1.1.2
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.12.20
 WORKDIR /finch
 COPY project project
 COPY src src
@@ -7,4 +7,4 @@ RUN sbt assembly -batch
 
 EXPOSE 9000
 
-CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-Dio.netty.recycler.maxCapacityPerThread=0", "-Dcom.twitter.finagle.tracing.enabled=false", "-Dio.netty.leakDetection.level=disabled", "-jar", "target/scala-2.12/finch-benchmark.jar"]
+CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-Dio.netty.recycler.maxCapacityPerThread=0", "-Dcom.twitter.finagle.tracing.enabled=false", "-Dio.netty.leakDetection.level=disabled", "-jar", "target/scala-2.12/finch-benchmark.jar"]

+ 1 - 1
frameworks/Scala/finch/project/build.properties

@@ -1 +1 @@
-sbt.version=1.1.2
+sbt.version=1.10.11

+ 1 - 1
frameworks/Scala/http4s/blaze/project/build.properties

@@ -1 +1 @@
-sbt.version=1.7.1
+sbt.version=1.10.11

+ 2 - 0
frameworks/Scala/http4s/blaze/project/plugins.sbt

@@ -1,2 +1,4 @@
 addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")
 addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.5.1")
+
+libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % "always"

+ 3 - 4
frameworks/Scala/http4s/http4s.dockerfile

@@ -1,10 +1,9 @@
-FROM openjdk:17 AS builder
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16 AS builder
 WORKDIR /http4s
 COPY blaze/project project
 COPY blaze/src src
 COPY blaze/build.sbt build.sbt
-COPY sbt sbt
-RUN ./sbt assembly -batch && \
+RUN sbt assembly -batch && \
     mv target/scala-2.13/http4s-assembly-1.0.jar . && \
     rm -Rf target && \
     rm -Rf project/target && \
@@ -12,7 +11,7 @@ RUN ./sbt assembly -batch && \
     rm -Rf ~/.ivy2 && \
     rm -Rf /var/cache
     
-FROM openjdk:17
+FROM openjdk:21
 WORKDIR /http4s
 COPY --from=builder /http4s/http4s-assembly-1.0.jar /http4s/http4s-assembly-1.0.jar
 

+ 0 - 664
frameworks/Scala/http4s/sbt

@@ -1,664 +0,0 @@
-#!/usr/bin/env bash
-#
-# A more capable sbt runner, coincidentally also called sbt.
-# Author: Paul Phillips <[email protected]>
-# https://github.com/paulp/sbt-extras
-#
-# Generated from http://www.opensource.org/licenses/bsd-license.php
-# Copyright (c) 2011, Paul Phillips. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#     * Neither the name of the author nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-set -o pipefail
-
-declare -r sbt_release_version="1.7.1"
-declare -r sbt_unreleased_version="1.7.1"
-
-declare -r latest_213="2.13.8"
-declare -r latest_212="2.12.16"
-declare -r latest_211="2.11.12"
-declare -r latest_210="2.10.7"
-declare -r latest_29="2.9.3"
-declare -r latest_28="2.8.2"
-
-declare -r buildProps="project/build.properties"
-
-declare -r sbt_launch_ivy_release_repo="https://repo.typesafe.com/typesafe/ivy-releases"
-declare -r sbt_launch_ivy_snapshot_repo="https://repo.scala-sbt.org/scalasbt/ivy-snapshots"
-declare -r sbt_launch_mvn_release_repo="https://repo1.maven.org/maven2"
-declare -r sbt_launch_mvn_snapshot_repo="https://repo.scala-sbt.org/scalasbt/maven-snapshots"
-
-declare -r default_jvm_opts_common="-Xms512m -Xss2m -XX:MaxInlineLevel=18"
-declare -r noshare_opts="-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy -Dsbt.coursier.home=project/.coursier"
-
-declare sbt_jar sbt_dir sbt_create sbt_version sbt_script sbt_new
-declare sbt_explicit_version
-declare verbose noshare batch trace_level
-
-declare java_cmd="java"
-declare sbt_launch_dir="$HOME/.sbt/launchers"
-declare sbt_launch_repo
-
-# pull -J and -D options to give to java.
-declare -a java_args scalac_args sbt_commands residual_args
-
-# args to jvm/sbt via files or environment variables
-declare -a extra_jvm_opts extra_sbt_opts
-
-echoerr() { echo >&2 "$@"; }
-vlog()    { [[ -n "$verbose" ]] && echoerr "$@"; }
-die()     {
-  echo "Aborting: $*"
-  exit 1
-}
-
-setTrapExit() {
-  # save stty and trap exit, to ensure echo is re-enabled if we are interrupted.
-  SBT_STTY="$(stty -g 2>/dev/null)"
-  export SBT_STTY
-
-  # restore stty settings (echo in particular)
-  onSbtRunnerExit() {
-    [ -t 0 ] || return
-    vlog ""
-    vlog "restoring stty: $SBT_STTY"
-    stty "$SBT_STTY"
-  }
-
-  vlog "saving stty: $SBT_STTY"
-  trap onSbtRunnerExit EXIT
-}
-
-# this seems to cover the bases on OSX, and someone will
-# have to tell me about the others.
-get_script_path() {
-  local path="$1"
-  [[ -L "$path" ]] || {
-    echo "$path"
-    return
-  }
-
-  local -r target="$(readlink "$path")"
-  if [[ "${target:0:1}" == "/" ]]; then
-    echo "$target"
-  else
-    echo "${path%/*}/$target"
-  fi
-}
-
-script_path="$(get_script_path "${BASH_SOURCE[0]}")"
-declare -r script_path
-script_name="${script_path##*/}"
-declare -r script_name
-
-init_default_option_file() {
-  local overriding_var="${!1}"
-  local default_file="$2"
-  if [[ ! -r "$default_file" && "$overriding_var" =~ ^@(.*)$ ]]; then
-    local envvar_file="${BASH_REMATCH[1]}"
-    if [[ -r "$envvar_file" ]]; then
-      default_file="$envvar_file"
-    fi
-  fi
-  echo "$default_file"
-}
-
-sbt_opts_file="$(init_default_option_file SBT_OPTS .sbtopts)"
-sbtx_opts_file="$(init_default_option_file SBTX_OPTS .sbtxopts)"
-jvm_opts_file="$(init_default_option_file JVM_OPTS .jvmopts)"
-
-build_props_sbt() {
-  [[ -r "$buildProps" ]] &&
-    grep '^sbt\.version' "$buildProps" | tr '=\r' ' ' | awk '{ print $2; }'
-}
-
-set_sbt_version() {
-  sbt_version="${sbt_explicit_version:-$(build_props_sbt)}"
-  [[ -n "$sbt_version" ]] || sbt_version=$sbt_release_version
-  export sbt_version
-}
-
-url_base() {
-  local version="$1"
-
-  case "$version" in
-    0.7.*)     echo "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/simple-build-tool" ;;
-    0.10.*)    echo "$sbt_launch_ivy_release_repo" ;;
-    0.11.[12]) echo "$sbt_launch_ivy_release_repo" ;;
-    0.*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]) # ie "*-yyyymmdd-hhMMss"
-      echo          "$sbt_launch_ivy_snapshot_repo" ;;
-    0.*)       echo "$sbt_launch_ivy_release_repo" ;;
-    *-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]T[0-9][0-9][0-9][0-9][0-9][0-9]) # ie "*-yyyymmddThhMMss"
-      echo          "$sbt_launch_mvn_snapshot_repo" ;;
-    *)         echo "$sbt_launch_mvn_release_repo" ;;
-  esac
-}
-
-make_url() {
-  local version="$1"
-
-  local base="${sbt_launch_repo:-$(url_base "$version")}"
-
-  case "$version" in
-    0.7.*)     echo "$base/sbt-launch-0.7.7.jar" ;;
-    0.10.*)    echo "$base/org.scala-tools.sbt/sbt-launch/$version/sbt-launch.jar" ;;
-    0.11.[12]) echo "$base/org.scala-tools.sbt/sbt-launch/$version/sbt-launch.jar" ;;
-    0.*)       echo "$base/org.scala-sbt/sbt-launch/$version/sbt-launch.jar" ;;
-    *)         echo "$base/org/scala-sbt/sbt-launch/$version/sbt-launch-${version}.jar" ;;
-  esac
-}
-
-addJava()      {
-  vlog "[addJava] arg = '$1'"
-  java_args+=("$1")
-}
-addSbt()       {
-  vlog "[addSbt] arg = '$1'"
-  sbt_commands+=("$1")
-}
-addScalac()    {
-  vlog "[addScalac] arg = '$1'"
-  scalac_args+=("$1")
-}
-addResidual()  {
-  vlog "[residual] arg = '$1'"
-  residual_args+=("$1")
-}
-
-addResolver() { addSbt "set resolvers += $1"; }
-
-addDebugger() { addJava "-Xdebug" && addJava "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1"; }
-
-setThisBuild() {
-  vlog "[addBuild] args = '$*'"
-  local key="$1" && shift
-  addSbt "set $key in ThisBuild := $*"
-}
-setScalaVersion() {
-  [[ "$1" == *"-SNAPSHOT" ]] && addResolver 'Resolver.sonatypeRepo("snapshots")'
-  addSbt "++ $1"
-}
-setJavaHome() {
-  java_cmd="$1/bin/java"
-  setThisBuild javaHome "_root_.scala.Some(file(\"$1\"))"
-  export JAVA_HOME="$1"
-  export JDK_HOME="$1"
-  export PATH="$JAVA_HOME/bin:$PATH"
-}
-
-getJavaVersion() {
-  local -r str=$("$1" -version 2>&1 | grep -E -e '(java|openjdk) version' | awk '{ print $3 }' | tr -d '"')
-
-  # java -version on java8 says 1.8.x
-  # but on 9 and 10 it's 9.x.y and 10.x.y.
-  if [[ "$str" =~ ^1\.([0-9]+)(\..*)?$ ]]; then
-    echo "${BASH_REMATCH[1]}"
-  # Fixes https://github.com/dwijnand/sbt-extras/issues/326
-  elif [[ "$str" =~ ^([0-9]+)(\..*)?(-ea)?$ ]]; then
-    echo "${BASH_REMATCH[1]}"
-  elif [[ -n "$str" ]]; then
-    echoerr "Can't parse java version from: $str"
-  fi
-}
-
-checkJava() {
-  # Warn if there is a Java version mismatch between PATH and JAVA_HOME/JDK_HOME
-
-  [[ -n "$JAVA_HOME" && -e "$JAVA_HOME/bin/java"    ]] && java="$JAVA_HOME/bin/java"
-  [[ -n "$JDK_HOME" && -e "$JDK_HOME/lib/tools.jar" ]] && java="$JDK_HOME/bin/java"
-
-  if [[ -n "$java" ]]; then
-    pathJavaVersion=$(getJavaVersion java)
-    homeJavaVersion=$(getJavaVersion "$java")
-    if [[ "$pathJavaVersion" != "$homeJavaVersion" ]]; then
-      echoerr "Warning: Java version mismatch between PATH and JAVA_HOME/JDK_HOME, sbt will use the one in PATH"
-      echoerr "  Either: fix your PATH, remove JAVA_HOME/JDK_HOME or use -java-home"
-      echoerr "  java version from PATH:               $pathJavaVersion"
-      echoerr "  java version from JAVA_HOME/JDK_HOME: $homeJavaVersion"
-    fi
-  fi
-}
-
-java_version() {
-  local -r version=$(getJavaVersion "$java_cmd")
-  vlog "Detected Java version: $version"
-  echo "$version"
-}
-
-is_apple_silicon() { [[ "$(uname -s)" == "Darwin" && "$(uname -m)" == "arm64" ]]; }
-
-# MaxPermSize critical on pre-8 JVMs but incurs noisy warning on 8+
-default_jvm_opts() {
-  local -r v="$(java_version)"
-  if [[ $v -ge 17 ]]; then
-    echo "$default_jvm_opts_common"
-  elif [[ $v -ge 10 ]]; then
-    if is_apple_silicon; then
-      # As of Dec 2020, JVM for Apple Silicon (M1) doesn't support JVMCI
-      echo "$default_jvm_opts_common"
-    else
-      echo "$default_jvm_opts_common -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler"
-    fi
-  elif [[ $v -ge 8 ]]; then
-    echo "$default_jvm_opts_common"
-  else
-    echo "-XX:MaxPermSize=384m $default_jvm_opts_common"
-  fi
-}
-
-execRunner() {
-  # print the arguments one to a line, quoting any containing spaces
-  vlog "# Executing command line:" && {
-    for arg; do
-      if [[ -n "$arg" ]]; then
-        if printf "%s\n" "$arg" | grep -q ' '; then
-          printf >&2 "\"%s\"\n" "$arg"
-        else
-          printf >&2 "%s\n" "$arg"
-        fi
-      fi
-    done
-    vlog ""
-  }
-
-  setTrapExit
-
-  if [[ -n "$batch" ]]; then
-    "$@" </dev/null
-  else
-    "$@"
-  fi
-}
-
-jar_url() { make_url "$1"; }
-
-is_cygwin() { [[ "$(uname -a)" == "CYGWIN"* ]]; }
-
-jar_file() {
-  is_cygwin &&
-    cygpath -w "$sbt_launch_dir/$1/sbt-launch.jar" ||
-    echo "$sbt_launch_dir/$1/sbt-launch.jar"
-}
-
-download_url() {
-  local url="$1"
-  local jar="$2"
-
-  mkdir -p "${jar%/*}" && {
-    if command -v curl >/dev/null 2>&1; then
-      curl --fail --silent --location "$url" --output "$jar"
-    elif command -v wget >/dev/null 2>&1; then
-      wget -q -O "$jar" "$url"
-    fi
-  } && [[ -r "$jar" ]]
-}
-
-acquire_sbt_jar() {
-  {
-    sbt_jar="$(jar_file "$sbt_version")"
-    [[ -r "$sbt_jar" ]]
-  } || {
-    sbt_jar="$HOME/.ivy2/local/org.scala-sbt/sbt-launch/$sbt_version/jars/sbt-launch.jar"
-    [[ -r "$sbt_jar" ]]
-  } || {
-    sbt_jar="$(jar_file "$sbt_version")"
-    jar_url="$(make_url "$sbt_version")"
-
-    echoerr "Downloading sbt launcher for ${sbt_version}:"
-    echoerr "  From  ${jar_url}"
-    echoerr "    To  ${sbt_jar}"
-
-    download_url "${jar_url}" "${sbt_jar}"
-
-    case "${sbt_version}" in
-      0.*)
-        vlog "SBT versions < 1.0 do not have published MD5 checksums, skipping check"
-        echo ""
-        ;;
-      *)   verify_sbt_jar "${sbt_jar}" ;;
-    esac
-  }
-}
-
-verify_sbt_jar() {
-  local jar="${1}"
-  local md5="${jar}.md5"
-  md5url="$(make_url "${sbt_version}").md5"
-
-  echoerr "Downloading sbt launcher ${sbt_version} md5 hash:"
-  echoerr "  From  ${md5url}"
-  echoerr "    To  ${md5}"
-
-  download_url "${md5url}" "${md5}" >/dev/null 2>&1
-
-  if command -v md5sum >/dev/null 2>&1; then
-    if echo "$(cat "${md5}")  ${jar}" | md5sum -c -; then
-      rm -rf "${md5}"
-      return 0
-    else
-      echoerr "Checksum does not match"
-      return 1
-    fi
-  elif command -v md5 >/dev/null 2>&1; then
-    if [ "$(md5 -q "${jar}")" == "$(cat "${md5}")" ]; then
-      rm -rf "${md5}"
-      return 0
-    else
-      echoerr "Checksum does not match"
-      return 1
-    fi
-  elif command -v openssl >/dev/null 2>&1; then
-    if [ "$(openssl md5 -r "${jar}" | awk '{print $1}')" == "$(cat "${md5}")" ]; then
-      rm -rf "${md5}"
-      return 0
-    else
-      echoerr "Checksum does not match"
-      return 1
-    fi
-  else
-    echoerr "Could not find an MD5 command"
-    return 1
-  fi
-}
-
-usage() {
-  set_sbt_version
-  cat <<EOM
-Usage: $script_name [options]
-
-Note that options which are passed along to sbt begin with -- whereas
-options to this runner use a single dash. Any sbt command can be scheduled
-to run first by prefixing the command with --, so --warn, --error and so on
-are not special.
-
-  -h | -help         print this message
-  -v                 verbose operation (this runner is chattier)
-  -d, -w, -q         aliases for --debug, --warn, --error (q means quiet)
-  -x                 debug this script
-  -trace <level>     display stack traces with a max of <level> frames (default: -1, traces suppressed)
-  -debug-inc         enable debugging log for the incremental compiler
-  -no-colors         disable ANSI color codes
-  -sbt-create        start sbt even if current directory contains no sbt project
-  -sbt-dir   <path>  path to global settings/plugins directory (default: ~/.sbt/<version>)
-  -sbt-boot  <path>  path to shared boot directory (default: ~/.sbt/boot in 0.11+)
-  -ivy       <path>  path to local Ivy repository (default: ~/.ivy2)
-  -no-share          use all local caches; no sharing
-  -offline           put sbt in offline mode
-  -jvm-debug <port>  Turn on JVM debugging, open at the given port.
-  -batch             Disable interactive mode
-  -prompt <expr>     Set the sbt prompt; in expr, 's' is the State and 'e' is Extracted
-  -script <file>     Run the specified file as a scala script
-
-  # sbt version (default: sbt.version from $buildProps if present, otherwise $sbt_release_version)
-  -sbt-version <version>  use the specified version of sbt (default: $sbt_release_version)
-  -sbt-force-latest       force the use of the latest release of sbt: $sbt_release_version
-  -sbt-dev                use the latest pre-release version of sbt: $sbt_unreleased_version
-  -sbt-jar      <path>    use the specified jar as the sbt launcher
-  -sbt-launch-dir <path>  directory to hold sbt launchers (default: $sbt_launch_dir)
-  -sbt-launch-repo <url>  repo url for downloading sbt launcher jar (default: $(url_base "$sbt_version"))
-
-  # scala version (default: as chosen by sbt)
-  -28                        use $latest_28
-  -29                        use $latest_29
-  -210                       use $latest_210
-  -211                       use $latest_211
-  -212                       use $latest_212
-  -213                       use $latest_213
-  -scala-home <path>         use the scala build at the specified directory
-  -scala-version <version>   use the specified version of scala
-  -binary-version <version>  use the specified scala version when searching for dependencies
-
-  # java version (default: java from PATH, currently $(java -version 2>&1 | grep version))
-  -java-home <path>          alternate JAVA_HOME
-
-  # passing options to the jvm - note it does NOT use JAVA_OPTS due to pollution
-  # The default set is used if JVM_OPTS is unset and no -jvm-opts file is found
-  <default>         $(default_jvm_opts)
-  JVM_OPTS          environment variable holding either the jvm args directly, or
-                    the reference to a file containing jvm args if given path is prepended by '@' (e.g. '@/etc/jvmopts')
-                    Note: "@"-file is overridden by local '.jvmopts' or '-jvm-opts' argument.
-  -jvm-opts <path>  file containing jvm args (if not given, .jvmopts in project root is used if present)
-  -Dkey=val         pass -Dkey=val directly to the jvm
-  -J-X              pass option -X directly to the jvm (-J is stripped)
-
-  # passing options to sbt, OR to this runner
-  SBT_OPTS          environment variable holding either the sbt args directly, or
-                    the reference to a file containing sbt args if given path is prepended by '@' (e.g. '@/etc/sbtopts')
-                    Note: "@"-file is overridden by local '.sbtopts' or '-sbt-opts' argument.
-  -sbt-opts <path>  file containing sbt args (if not given, .sbtopts in project root is used if present)
-  -S-X              add -X to sbt's scalacOptions (-S is stripped)
-
-  # passing options exclusively to this runner
-  SBTX_OPTS         environment variable holding either the sbt-extras args directly, or
-                    the reference to a file containing sbt-extras args if given path is prepended by '@' (e.g. '@/etc/sbtxopts')
-                    Note: "@"-file is overridden by local '.sbtxopts' or '-sbtx-opts' argument.
-  -sbtx-opts <path> file containing sbt-extras args (if not given, .sbtxopts in project root is used if present)
-EOM
-  exit 0
-}
-
-process_args() {
-  require_arg() {
-    local type="$1"
-    local opt="$2"
-    local arg="$3"
-
-    if [[ -z "$arg" ]] || [[ "${arg:0:1}" == "-" ]]; then
-      die "$opt requires <$type> argument"
-    fi
-  }
-  while [[ $# -gt 0 ]]; do
-    case "$1" in
-      -h |   -help) usage ;;
-      -v)           verbose=true && shift ;;
-      -d)           addSbt "--debug" && shift ;;
-      -w)           addSbt "--warn"  && shift ;;
-      -q)           addSbt "--error" && shift ;;
-      -x)           shift ;; # currently unused
-      -trace)       require_arg integer "$1" "$2" && trace_level="$2" && shift 2 ;;
-      -debug-inc)   addJava "-Dxsbt.inc.debug=true" && shift ;;
-
-      -no-colors)   addJava "-Dsbt.log.noformat=true" && addJava "-Dsbt.color=false" && shift ;;
-      -sbt-create)  sbt_create=true && shift ;;
-      -sbt-dir)     require_arg path "$1" "$2" && sbt_dir="$2" && shift 2 ;;
-      -sbt-boot)    require_arg path "$1" "$2" && addJava "-Dsbt.boot.directory=$2" && shift 2 ;;
-      -ivy)         require_arg path "$1" "$2" && addJava "-Dsbt.ivy.home=$2" && shift 2 ;;
-      -no-share)    noshare=true && shift ;;
-      -offline)     addSbt "set offline in Global := true" && shift ;;
-      -jvm-debug)   require_arg port "$1" "$2" && addDebugger "$2" && shift 2 ;;
-      -batch)       batch=true && shift ;;
-      -prompt)      require_arg "expr" "$1" "$2" && setThisBuild shellPrompt "(s => { val e = Project.extract(s) ; $2 })" && shift 2 ;;
-      -script)      require_arg file "$1" "$2" && sbt_script="$2" && addJava "-Dsbt.main.class=sbt.ScriptMain" && shift 2 ;;
-
-      -sbt-version) require_arg version "$1" "$2" && sbt_explicit_version="$2" && shift 2 ;;
-      -sbt-force-latest) sbt_explicit_version="$sbt_release_version" && shift ;;
-      -sbt-dev)     sbt_explicit_version="$sbt_unreleased_version" && shift ;;
-      -sbt-jar)     require_arg path "$1" "$2" && sbt_jar="$2" && shift 2 ;;
-      -sbt-launch-dir) require_arg path "$1" "$2" && sbt_launch_dir="$2" && shift 2 ;;
-      -sbt-launch-repo) require_arg path "$1" "$2" && sbt_launch_repo="$2" && shift 2 ;;
-
-      -28)          setScalaVersion "$latest_28"  && shift ;;
-      -29)          setScalaVersion "$latest_29"  && shift ;;
-      -210)         setScalaVersion "$latest_210" && shift ;;
-      -211)         setScalaVersion "$latest_211" && shift ;;
-      -212)         setScalaVersion "$latest_212" && shift ;;
-      -213)         setScalaVersion "$latest_213" && shift ;;
-
-      -scala-version) require_arg version "$1" "$2" && setScalaVersion "$2" && shift 2 ;;
-      -binary-version) require_arg version "$1" "$2" && setThisBuild scalaBinaryVersion "\"$2\"" && shift 2 ;;
-      -scala-home)  require_arg path "$1" "$2" && setThisBuild scalaHome "_root_.scala.Some(file(\"$2\"))" && shift 2 ;;
-      -java-home)   require_arg path "$1" "$2" && setJavaHome "$2" && shift 2 ;;
-      -sbt-opts)    require_arg path "$1" "$2" && sbt_opts_file="$2" && shift 2 ;;
-      -sbtx-opts) require_arg path "$1" "$2" && sbtx_opts_file="$2" && shift 2 ;;
-      -jvm-opts)    require_arg path "$1" "$2" && jvm_opts_file="$2" && shift 2 ;;
-
-      -D*)          addJava "$1" && shift ;;
-      -J*)          addJava "${1:2}" && shift ;;
-      -S*)          addScalac "${1:2}" && shift ;;
-
-      new)          sbt_new=true && : ${sbt_explicit_version:=$sbt_release_version} && addResidual "$1" && shift ;;
-
-      *)            addResidual "$1" && shift ;;
-    esac
-  done
-}
-
-# process the direct command line arguments
-process_args "$@"
-
-# skip #-styled comments and blank lines
-readConfigFile() {
-  local end=false
-  until $end; do
-    read -r || end=true
-    [[ $REPLY =~ ^# ]] || [[ -z $REPLY ]] || echo "$REPLY"
-  done <"$1"
-}
-
-# if there are file/environment sbt_opts, process again so we
-# can supply args to this runner
-if [[ -r "$sbt_opts_file" ]]; then
-  vlog "Using sbt options defined in file $sbt_opts_file"
-  while read -r opt; do extra_sbt_opts+=("$opt"); done < <(readConfigFile "$sbt_opts_file")
-elif [[ -n "$SBT_OPTS" && ! ("$SBT_OPTS" =~ ^@.*) ]]; then
-  vlog "Using sbt options defined in variable \$SBT_OPTS"
-  IFS=" " read -r -a extra_sbt_opts <<<"$SBT_OPTS"
-else
-  vlog "No extra sbt options have been defined"
-fi
-
-# if there are file/environment sbtx_opts, process again so we
-# can supply args to this runner
-if [[ -r "$sbtx_opts_file" ]]; then
-  vlog "Using sbt options defined in file $sbtx_opts_file"
-  while read -r opt; do extra_sbt_opts+=("$opt"); done < <(readConfigFile "$sbtx_opts_file")
-elif [[ -n "$SBTX_OPTS" && ! ("$SBTX_OPTS" =~ ^@.*) ]]; then
-  vlog "Using sbt options defined in variable \$SBTX_OPTS"
-  IFS=" " read -r -a extra_sbt_opts <<<"$SBTX_OPTS"
-else
-  vlog "No extra sbt options have been defined"
-fi
-
-[[ -n "${extra_sbt_opts[*]}" ]] && process_args "${extra_sbt_opts[@]}"
-
-# reset "$@" to the residual args
-set -- "${residual_args[@]}"
-argumentCount=$#
-
-# set sbt version
-set_sbt_version
-
-checkJava
-
-# only exists in 0.12+
-setTraceLevel() {
-  case "$sbt_version" in
-    "0.7."* | "0.10."* | "0.11."*) echoerr "Cannot set trace level in sbt version $sbt_version" ;;
-    *)                             setThisBuild traceLevel "$trace_level" ;;
-  esac
-}
-
-# set scalacOptions if we were given any -S opts
-[[ ${#scalac_args[@]} -eq 0 ]] || addSbt "set scalacOptions in ThisBuild += \"${scalac_args[*]}\""
-
-[[ -n "$sbt_explicit_version" && -z "$sbt_new" ]] && addJava "-Dsbt.version=$sbt_explicit_version"
-vlog "Detected sbt version $sbt_version"
-
-if [[ -n "$sbt_script" ]]; then
-  residual_args=("$sbt_script" "${residual_args[@]}")
-else
-  # no args - alert them there's stuff in here
-  ((argumentCount > 0)) || {
-    vlog "Starting $script_name: invoke with -help for other options"
-    residual_args=(shell)
-  }
-fi
-
-# verify this is an sbt dir, -create was given or user attempts to run a scala script
-[[ -r ./build.sbt || -d ./project || -n "$sbt_create" || -n "$sbt_script" || -n "$sbt_new" ]] || {
-  cat <<EOM
-$(pwd) doesn't appear to be an sbt project.
-If you want to start sbt anyway, run:
-  $0 -sbt-create
-
-EOM
-  exit 1
-}
-
-# pick up completion if present; todo
-# shellcheck disable=SC1091
-[[ -r .sbt_completion.sh ]] && source .sbt_completion.sh
-
-# directory to store sbt launchers
-[[ -d "$sbt_launch_dir" ]] || mkdir -p "$sbt_launch_dir"
-[[ -w "$sbt_launch_dir" ]] || sbt_launch_dir="$(mktemp -d -t sbt_extras_launchers.XXXXXX)"
-
-# no jar? download it.
-[[ -r "$sbt_jar" ]] || acquire_sbt_jar || {
-  # still no jar? uh-oh.
-  echo "Could not download and verify the launcher. Obtain the jar manually and place it at $sbt_jar"
-  exit 1
-}
-
-if [[ -n "$noshare" ]]; then
-  for opt in ${noshare_opts}; do
-    addJava "$opt"
-  done
-else
-  case "$sbt_version" in
-    "0.7."* | "0.10."* | "0.11."* | "0.12."*)
-      [[ -n "$sbt_dir" ]] || {
-        sbt_dir="$HOME/.sbt/$sbt_version"
-        vlog "Using $sbt_dir as sbt dir, -sbt-dir to override."
-      }
-      ;;
-  esac
-
-  if [[ -n "$sbt_dir" ]]; then
-    addJava "-Dsbt.global.base=$sbt_dir"
-  fi
-fi
-
-if [[ -r "$jvm_opts_file" ]]; then
-  vlog "Using jvm options defined in file $jvm_opts_file"
-  while read -r opt; do extra_jvm_opts+=("$opt"); done < <(readConfigFile "$jvm_opts_file")
-elif [[ -n "$JVM_OPTS" && ! ("$JVM_OPTS" =~ ^@.*) ]]; then
-  vlog "Using jvm options defined in \$JVM_OPTS variable"
-  IFS=" " read -r -a extra_jvm_opts <<<"$JVM_OPTS"
-else
-  vlog "Using default jvm options"
-  IFS=" " read -r -a extra_jvm_opts <<<"$( default_jvm_opts)"
-fi
-
-# traceLevel is 0.12+
-[[ -n "$trace_level" ]] && setTraceLevel
-
-execRunner "$java_cmd" \
-  "${extra_jvm_opts[@]}" \
-  "${java_args[@]}" \
-  -jar "$sbt_jar" \
-  "${sbt_commands[@]}" \
-  "${residual_args[@]}"

+ 1 - 1
frameworks/Scala/otavia/.mill-version

@@ -1 +1 @@
-0.11.8
+0.12.10

+ 1 - 1
frameworks/Scala/otavia/build.sc

@@ -5,7 +5,7 @@ def otaviaVersion = "0.4.5"
 
 object benchmark extends ScalaModule {
 
-    override def scalaVersion = "3.3.3"
+    override def scalaVersion = "3.3.4"
 
     override def ivyDeps = Agg(
       ivy"cc.otavia::otavia-codec-http:$otaviaVersion",

+ 2 - 1
frameworks/Scala/otavia/otavia-overshoot.dockerfile

@@ -1,7 +1,8 @@
-FROM nightscape/scala-mill:eclipse-temurin-17.0.8.1_1-jdk-focal_0.11.6_3.3.0
+FROM nightscape/scala-mill:eclipse-temurin-21.0.6_7-jdk-jammy_0.12.10
 WORKDIR /otavia
 COPY benchmark benchmark
 COPY build.sc build.sc
+COPY .mill-version .mill-version
 ENV COURSIER_REPOSITORIES=ivy2Local|central
 RUN mill benchmark.assembly
 

+ 2 - 1
frameworks/Scala/otavia/otavia.dockerfile

@@ -1,7 +1,8 @@
-FROM nightscape/scala-mill:eclipse-temurin-17.0.8.1_1-jdk-focal_0.11.6_3.3.0
+FROM nightscape/scala-mill:eclipse-temurin-21.0.6_7-jdk-jammy_0.12.10
 WORKDIR /otavia
 COPY benchmark benchmark
 COPY build.sc build.sc
+COPY .mill-version .mill-version
 ENV COURSIER_REPOSITORIES=ivy2Local|central
 RUN mill benchmark.assembly
 

+ 2 - 2
frameworks/Scala/pekko-http/pekko-http.dockerfile

@@ -1,4 +1,4 @@
-FROM sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.5_8_1.9.3_2.13.11 as build
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16 as build
 
 WORKDIR /pekko-http
 COPY pekko-http ./
@@ -10,7 +10,7 @@ RUN \
   sbt sbtVersion
 RUN sbt clean compile stage
 
-FROM eclipse-temurin:17-jre-jammy
+FROM eclipse-temurin:21-jre-noble
 COPY --from=build /pekko-http/target/universal/stage /pekko-http
 
 EXPOSE 9000

+ 1 - 1
frameworks/Scala/pekko-http/pekko-http/build.sbt

@@ -6,7 +6,7 @@ name := "pekko-http-benchmark"
 
 version := "0.1.0-SNAPSHOT"
 
-scalaVersion := "2.13.8"
+scalaVersion := "2.13.16"
 
 val pekkoV = "1.0.1"
 val pekkoHttpV = "1.0.0"

+ 1 - 1
frameworks/Scala/pekko-http/pekko-http/project/build.properties

@@ -1 +1 @@
-sbt.version=1.9.2
+sbt.version=1.10.11

+ 2 - 2
frameworks/Scala/play2-scala/benchmark_config.json

@@ -103,7 +103,7 @@
         "query_url": "/queries?queries=",
         "fortune_url": "/fortunes",
         "update_url": "/update?queries=",
-        "tags": ["broken"]
+        "tags": []
       },
       "reactivemongo-netty": {
         "display_name": "play2-scala-reactivemongo-netty",
@@ -126,7 +126,7 @@
         "query_url": "/queries?queries=",
         "fortune_url": "/fortunes",
         "update_url": "/update?queries=",
-        "tags": ["broken"]
+        "tags": []
       },
       "slick": {
         "display_name": "play2-scala-slick",

+ 3 - 2
frameworks/Scala/play2-scala/play2-scala-anorm-netty.dockerfile

@@ -1,4 +1,5 @@
-FROM hseeberger/scala-sbt:8u265_1.3.13_2.13.3
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16
+
 WORKDIR /play2
 COPY play2-scala-anorm .
 
@@ -8,4 +9,4 @@ RUN sbt stage
 
 EXPOSE 9000
 
-CMD target/universal/stage/bin/play2-scala-anorm -Dplay.server.provider=play.core.server.NettyServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:-UseBiasedLocking -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}') -Ddb_pool_size=$(( $(( $(nproc) * 2 )) + 1 ))
+CMD target/universal/stage/bin/play2-scala-anorm -Dplay.server.provider=play.core.server.NettyServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}') -Ddb_pool_size=$(( $(( $(nproc) * 2 )) + 1 ))

+ 3 - 2
frameworks/Scala/play2-scala/play2-scala-anorm.dockerfile

@@ -1,4 +1,5 @@
-FROM hseeberger/scala-sbt:8u265_1.3.13_2.13.3
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16
+
 WORKDIR /play2
 COPY play2-scala-anorm .
 
@@ -8,4 +9,4 @@ RUN sbt stage
 
 EXPOSE 9000
 
-CMD target/universal/stage/bin/play2-scala-anorm -Dplay.server.provider=play.core.server.AkkaHttpServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:-UseBiasedLocking -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}') -Ddb_pool_size=$(( $(( $(nproc) * 2 )) + 1 ))
+CMD target/universal/stage/bin/play2-scala-anorm -Dplay.server.provider=play.core.server.AkkaHttpServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}') -Ddb_pool_size=$(( $(( $(nproc) * 2 )) + 1 ))

+ 3 - 3
frameworks/Scala/play2-scala/play2-scala-anorm/build.sbt

@@ -4,11 +4,11 @@ version := "1.0-SNAPSHOT"
 
 lazy val root = (project in file(".")).enablePlugins(PlayScala, PlayNettyServer).disablePlugins(PlayFilters)
 
-scalaVersion := "2.13.3"
+scalaVersion := "2.13.16"
 
 libraryDependencies ++= Seq(
   guice,
   jdbc,
-  "org.playframework.anorm" %% "anorm" % "2.6.7",
-  "mysql" % "mysql-connector-java" % "8.0.21"
+  "org.playframework.anorm" %% "anorm" % "2.8.1",
+  "mysql" % "mysql-connector-java" % "8.0.33"
 )

+ 3 - 3
frameworks/Scala/play2-scala/play2-scala-anorm/conf/application.conf

@@ -29,8 +29,8 @@ play.server {
     option {
       SO_BACKLOG = 8192
       SO_REUSEADDR = true
-      "io.netty.channel.epoll.EpollChannelOption#SO_REUSEPORT" = true
-      "io.netty.channel.epoll.EpollChannelOption#TCP_FASTOPEN" = 1
+      "io.netty.channel.unix.UnixChannelOption#SO_REUSEPORT" = true
+      "io.netty.channel.ChannelOption#TCP_FASTOPEN" = 1
 
       child {
         SO_KEEPALIVE = true
@@ -40,7 +40,7 @@ play.server {
         # The default is 1 since Linux Kernel 3.13
         # You can check via "cat /proc/sys/net/ipv4/tcp_fastopen"
         # However 3 would be better, but we can't change it to that value because we don't have root permission when running the benchmarks
-        "io.netty.channel.epoll.EpollChannelOption#TCP_FASTOPEN" = 1
+        "io.netty.channel.ChannelOption#TCP_FASTOPEN" = 1
       }
     }
   }

+ 1 - 1
frameworks/Scala/play2-scala/play2-scala-anorm/project/build.properties

@@ -1 +1 @@
-sbt.version=1.3.13
+sbt.version=1.10.11

+ 1 - 1
frameworks/Scala/play2-scala/play2-scala-anorm/project/plugins.sbt

@@ -1 +1 @@
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.2")
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.9.7")

+ 2 - 2
frameworks/Scala/play2-scala/play2-scala-netty.dockerfile

@@ -1,4 +1,4 @@
-FROM hseeberger/scala-sbt:8u242_1.3.8_2.13.1
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16
 WORKDIR /play2
 COPY play2-scala .
 
@@ -8,4 +8,4 @@ RUN sbt stage
 
 EXPOSE 9000
 
-CMD target/universal/stage/bin/play2-scala -Dplay.server.provider=play.core.server.NettyServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:-UseBiasedLocking -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')
+CMD target/universal/stage/bin/play2-scala -Dplay.server.provider=play.core.server.NettyServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')

+ 2 - 2
frameworks/Scala/play2-scala/play2-scala-reactivemongo-netty.dockerfile

@@ -1,4 +1,4 @@
-FROM hseeberger/scala-sbt:8u242_1.3.8_2.13.1
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16
 WORKDIR /play2
 COPY play2-scala-reactivemongo .
 
@@ -8,4 +8,4 @@ RUN sbt stage
 
 EXPOSE 9000
 
-CMD target/universal/stage/bin/play2-scala-reactivemongo -Dplay.server.provider=play.core.server.NettyServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:-UseBiasedLocking -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')
+CMD target/universal/stage/bin/play2-scala-reactivemongo -Dplay.server.provider=play.core.server.NettyServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')

+ 2 - 2
frameworks/Scala/play2-scala/play2-scala-reactivemongo.dockerfile

@@ -1,4 +1,4 @@
-FROM hseeberger/scala-sbt:8u242_1.3.8_2.13.1
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16
 WORKDIR /play2
 COPY play2-scala-reactivemongo .
 
@@ -8,4 +8,4 @@ RUN sbt stage
 
 EXPOSE 9000
 
-CMD target/universal/stage/bin/play2-scala-reactivemongo -Dplay.server.provider=play.core.server.AkkaHttpServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:-UseBiasedLocking -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')
+CMD target/universal/stage/bin/play2-scala-reactivemongo -Dplay.server.provider=play.core.server.AkkaHttpServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')

+ 11 - 10
frameworks/Scala/play2-scala/play2-scala-reactivemongo/app/controllers/Application.scala

@@ -1,20 +1,21 @@
 package controllers
 
-import java.util.concurrent.ThreadLocalRandom
-
-import scala.concurrent.{ExecutionContext, Future}
 import play.api.libs.json.{JsObject, JsValue, Json}
 import play.api.mvc._
-import reactivemongo.api.{Cursor, ReadPreference}
-import reactivemongo.play.json.collection.JSONCollection
 import play.modules.reactivemongo.ReactiveMongoApi
-import reactivemongo.play.json._
+import reactivemongo.api.bson.collection.BSONCollection
+import reactivemongo.api.{Cursor, ReadPreference}
+import reactivemongo.play.json.compat.bson2json._
+import reactivemongo.play.json.compat.json2bson._
+
+import java.util.concurrent.ThreadLocalRandom
+import scala.concurrent.{ExecutionContext, Future}
 
 class Application (val controllerComponents: ControllerComponents, reactiveMongoApi: ReactiveMongoApi)(implicit ec: ExecutionContext)
   extends BaseController {
 
-  private def worldCollection: Future[JSONCollection] = reactiveMongoApi.database.map(_.collection[JSONCollection]("world"))
-  private def fortuneCollection: Future[JSONCollection] = reactiveMongoApi.database.map(_.collection[JSONCollection]("fortune"))
+  private def worldCollection: Future[BSONCollection] = reactiveMongoApi.database.map(_.collection[BSONCollection]("world"))
+  private def fortuneCollection: Future[BSONCollection] = reactiveMongoApi.database.map(_.collection[BSONCollection]("fortune"))
   private val projection = Json.obj("_id" -> 0)
 
   def getRandomWorlds(queries: Int): Future[Seq[Option[JsObject]]] = {
@@ -35,7 +36,7 @@ class Application (val controllerComponents: ControllerComponents, reactiveMongo
 
   def getFortunes: Future[List[JsObject]] = {
       fortuneCollection.map(_.find(Json.obj(), Option.empty[JsObject])
-        .cursor[JsObject](ReadPreference.primaryPreferred, false).collect[List](Int.MaxValue, (v, t) => Cursor.Fail(t))).flatten
+        .cursor[JsObject](ReadPreference.primaryPreferred).collect[List](Int.MaxValue, (v, t) => Cursor.Fail(t))).flatten
   }
 
   def updateWorlds(queries: Int): Future[Seq[JsObject]] = {
@@ -43,7 +44,7 @@ class Application (val controllerComponents: ControllerComponents, reactiveMongo
       .map(_.flatten)
       .map(_.map(oldWorld => {
         val newWorld = oldWorld ++ Json.obj("randomNumber" -> getNextRandom)
-        worldCollection.map(_.update(oldWorld, newWorld).map(result => newWorld)).flatten
+        worldCollection.map(_.update.one(oldWorld, newWorld).map(result => newWorld)).flatten
       }))
       .map(Future.sequence(_))
       .flatten

+ 3 - 3
frameworks/Scala/play2-scala/play2-scala-reactivemongo/build.sbt

@@ -4,11 +4,11 @@ version := "1.0-SNAPSHOT"
 
 lazy val root = (project in file(".")).enablePlugins(PlayScala, PlayNettyServer).disablePlugins(PlayFilters)
 
-scalaVersion := "2.13.1"
+scalaVersion := "2.13.16"
 
 libraryDependencies ++= Seq(
-  "org.reactivemongo" %% "play2-reactivemongo" % "0.20.3-play28",
-  "org.reactivemongo" %% "reactivemongo-play-json" % "0.20.3-play28",
+  "org.reactivemongo" %% "play2-reactivemongo" % "1.1.0-play29.RC15",
+  "org.reactivemongo" %% "reactivemongo-play-json-compat" % "1.1.0-play29.RC15",
   "com.softwaremill.macwire" %% "macros" % "2.3.3",
   "com.softwaremill.macwire" %% "util" % "2.3.3"
 )

+ 3 - 3
frameworks/Scala/play2-scala/play2-scala-reactivemongo/conf/application.conf

@@ -25,8 +25,8 @@ play.server {
     option {
       SO_BACKLOG = 8192
       SO_REUSEADDR = true
-      "io.netty.channel.epoll.EpollChannelOption#SO_REUSEPORT" = true
-      "io.netty.channel.epoll.EpollChannelOption#TCP_FASTOPEN" = 1
+      "io.netty.channel.unix.UnixChannelOption#SO_REUSEPORT" = true
+      "io.netty.channel.ChannelOption#TCP_FASTOPEN" = 1
 
       child {
         SO_KEEPALIVE = true
@@ -36,7 +36,7 @@ play.server {
         # The default is 1 since Linux Kernel 3.13
         # You can check via "cat /proc/sys/net/ipv4/tcp_fastopen"
         # However 3 would be better, but we can't change it to that value because we don't have root permission when running the benchmarks
-        "io.netty.channel.epoll.EpollChannelOption#TCP_FASTOPEN" = 1
+        "io.netty.channel.ChannelOption#TCP_FASTOPEN" = 1
       }
     }
   }

+ 1 - 1
frameworks/Scala/play2-scala/play2-scala-reactivemongo/project/build.properties

@@ -1 +1 @@
-sbt.version=1.3.8
+sbt.version=1.10.11

+ 1 - 1
frameworks/Scala/play2-scala/play2-scala-reactivemongo/project/plugins.sbt

@@ -1 +1 @@
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.1")
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.9.7")

+ 2 - 2
frameworks/Scala/play2-scala/play2-scala-slick-netty.dockerfile

@@ -1,4 +1,4 @@
-FROM hseeberger/scala-sbt:8u242_1.3.8_2.13.1
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16
 WORKDIR /play2
 COPY play2-scala-slick .
 
@@ -8,4 +8,4 @@ RUN sbt stage
 
 EXPOSE 9000
 
-CMD target/universal/stage/bin/play2-scala-slick -Dplay.server.provider=play.core.server.NettyServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:-UseBiasedLocking -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}') -Ddb_pool_size=$(( $(( $(nproc) * 2 )) + 1 ))
+CMD target/universal/stage/bin/play2-scala-slick -Dplay.server.provider=play.core.server.NettyServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}') -Ddb_pool_size=$(( $(( $(nproc) * 2 )) + 1 ))

+ 2 - 2
frameworks/Scala/play2-scala/play2-scala-slick.dockerfile

@@ -1,4 +1,4 @@
-FROM hseeberger/scala-sbt:8u242_1.3.8_2.13.1
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16
 WORKDIR /play2
 COPY play2-scala-slick .
 
@@ -8,4 +8,4 @@ RUN sbt stage
 
 EXPOSE 9000
 
-CMD target/universal/stage/bin/play2-scala-slick -Dplay.server.provider=play.core.server.AkkaHttpServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:-UseBiasedLocking -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}') -Ddb_pool_size=$(( $(( $(nproc) * 2 )) + 1 ))
+CMD target/universal/stage/bin/play2-scala-slick -Dplay.server.provider=play.core.server.AkkaHttpServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}') -Ddb_pool_size=$(( $(( $(nproc) * 2 )) + 1 ))

+ 5 - 9
frameworks/Scala/play2-scala/play2-scala-slick/app/controllers/Application.scala

@@ -23,15 +23,11 @@ class Application @Inject() (fortunesDAO: FortunesDAO, worldDAO: WorldDAO, val c
     fortunesDAO.getAll()
   }
 
-  def updateWorlds(n: Int): Future[Seq[World]] = {
-    val worlds: Seq[Future[World]] = for (_ <- 1 to n) yield {
-      val futureWorld: Future[World] = worldDAO.findById(getNextRandom)
-      val futureUpdatedWorld: Future[World] = futureWorld.map(_.copy(randomNumber = getNextRandom))
-      futureUpdatedWorld.map(world => worldDAO.updateRandom(world))
-      futureUpdatedWorld
-    }
-    Future.sequence(worlds)
-  }
+  def updateWorlds(n: Int): Future[Seq[World]] = for {
+    worlds <- getRandomWorlds(n)
+    updatedWorlds = worlds.map(_.copy(randomNumber = getNextRandom))
+    _ <- worldDAO.updateRandom(updatedWorlds)
+  } yield updatedWorlds
 
   def getNextRandom: Int = {
     ThreadLocalRandom.current().nextInt(TestDatabaseRows) + 1

+ 8 - 2
frameworks/Scala/play2-scala/play2-scala-slick/app/models/World.scala

@@ -34,8 +34,14 @@ class WorldDAO @Inject()(protected val dbConfigProvider: DatabaseConfigProvider)
     db.run(Worlds.filter(_.id === id).result.head)
   }
 
-  def updateRandom(world: World) = {
-    db.run(Worlds.filter(_.id === world.id).map(_.randomNumber).update(world.randomNumber))
+  def updateRandom(updatedWorlds: Seq[World]): Future[Seq[Int]] = {
+    val updateActions = updatedWorlds.map { uw =>
+      Worlds.filter(_.id === uw.id).map(_.randomNumber).update(uw.randomNumber)
+    }
+
+    val combinedUpdateAction: DBIO[Seq[Int]] = DBIO.sequence(updateActions)
+
+    db.run(combinedUpdateAction)
   }
 }
 

+ 3 - 3
frameworks/Scala/play2-scala/play2-scala-slick/build.sbt

@@ -4,11 +4,11 @@ version := "1.0-SNAPSHOT"
 
 lazy val root = (project in file(".")).enablePlugins(PlayScala, PlayNettyServer).disablePlugins(PlayFilters)
 
-scalaVersion := "2.13.1"
+scalaVersion := "2.13.16"
 
 libraryDependencies ++= Seq(
   guice,
-  "com.typesafe.play" %% "play-slick" % "5.0.0",
-  "mysql" % "mysql-connector-java" % "8.0.19",
+  "com.typesafe.play" %% "play-slick" % "5.3.0",
+  "mysql" % "mysql-connector-java" % "8.0.33",
   filters
 )

+ 5 - 5
frameworks/Scala/play2-scala/play2-scala-slick/conf/application.conf

@@ -29,8 +29,8 @@ play.server {
     option {
       SO_BACKLOG = 8192
       SO_REUSEADDR = true
-      "io.netty.channel.epoll.EpollChannelOption#SO_REUSEPORT" = true
-      "io.netty.channel.epoll.EpollChannelOption#TCP_FASTOPEN" = 1
+      "io.netty.channel.unix.UnixChannelOption#SO_REUSEPORT" = true
+      "io.netty.channel.ChannelOption#TCP_FASTOPEN" = 1
 
       child {
         SO_KEEPALIVE = true
@@ -40,7 +40,7 @@ play.server {
         # The default is 1 since Linux Kernel 3.13
         # You can check via "cat /proc/sys/net/ipv4/tcp_fastopen"
         # However 3 would be better, but we can't change it to that value because we don't have root permission when running the benchmarks
-        "io.netty.channel.epoll.EpollChannelOption#TCP_FASTOPEN" = 1
+        "io.netty.channel.ChannelOption#TCP_FASTOPEN" = 1
       }
     }
   }
@@ -78,7 +78,7 @@ slick.dbs.default {
   profile="slick.jdbc.MySQLProfile$"
   db {
     connectionPool=HikariCP
-    driver="com.mysql.jdbc.Driver"
+    driver="com.mysql.cj.jdbc.Driver"
     url="jdbc:mysql://tfb-database:3306/hello_world"
     user="benchmarkdbuser"
     password="benchmarkdbpass"
@@ -90,7 +90,7 @@ slick.dbs.default {
     numThreads=17
     numThreads=${?db_pool_size}
 
-    queueSize=2000
+    queueSize=20000
 
     properties {
       characterEncoding=UTF-8

+ 1 - 1
frameworks/Scala/play2-scala/play2-scala-slick/project/build.properties

@@ -1 +1 @@
-sbt.version=1.3.8
+sbt.version=1.10.11

+ 1 - 1
frameworks/Scala/play2-scala/play2-scala-slick/project/plugins.sbt

@@ -1 +1 @@
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.1")
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.9.7")

+ 2 - 2
frameworks/Scala/play2-scala/play2-scala.dockerfile

@@ -1,4 +1,4 @@
-FROM hseeberger/scala-sbt:8u242_1.3.8_2.13.1
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16
 WORKDIR /play2
 COPY play2-scala .
 
@@ -8,4 +8,4 @@ RUN sbt stage
 
 EXPOSE 9000
 
-CMD target/universal/stage/bin/play2-scala -Dplay.server.provider=play.core.server.AkkaHttpServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:-UseBiasedLocking -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')
+CMD target/universal/stage/bin/play2-scala -Dplay.server.provider=play.core.server.AkkaHttpServerProvider -J-server -J-Xms1g -J-Xmx1g -J-XX:NewSize=512m -J-XX:+UseG1GC -J-XX:MaxGCPauseMillis=30 -J-XX:+AlwaysPreTouch -Dthread_count=$(nproc) -Dphysical_cpu_count=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')

+ 1 - 1
frameworks/Scala/play2-scala/play2-scala/build.sbt

@@ -4,6 +4,6 @@ version := "1.0-SNAPSHOT"
 
 lazy val root = (project in file(".")).enablePlugins(PlayScala, PlayNettyServer).disablePlugins(PlayFilters)
 
-scalaVersion := "2.13.1"
+scalaVersion := "2.13.16"
 
 libraryDependencies += guice

+ 3 - 3
frameworks/Scala/play2-scala/play2-scala/conf/application.conf

@@ -29,8 +29,8 @@ play.server {
     option {
       SO_BACKLOG = 8192
       SO_REUSEADDR = true
-      "io.netty.channel.epoll.EpollChannelOption#SO_REUSEPORT" = true
-      "io.netty.channel.epoll.EpollChannelOption#TCP_FASTOPEN" = 1
+      "io.netty.channel.unix.UnixChannelOption#SO_REUSEPORT" = true
+      "io.netty.channel.ChannelOption#TCP_FASTOPEN" = 1
 
       child {
         SO_KEEPALIVE = true
@@ -40,7 +40,7 @@ play.server {
         # The default is 1 since Linux Kernel 3.13
         # You can check via "cat /proc/sys/net/ipv4/tcp_fastopen"
         # However 3 would be better, but we can't change it to that value because we don't have root permission when running the benchmarks
-        "io.netty.channel.epoll.EpollChannelOption#TCP_FASTOPEN" = 1
+        "io.netty.channel.ChannelOption#TCP_FASTOPEN" = 1
       }
     }
   }

+ 1 - 1
frameworks/Scala/play2-scala/play2-scala/project/build.properties

@@ -1 +1 @@
-sbt.version=1.3.8
+sbt.version=1.10.11

+ 1 - 1
frameworks/Scala/play2-scala/play2-scala/project/plugins.sbt

@@ -1 +1 @@
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.1")
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.9.7")

+ 1 - 11
frameworks/Scala/scalene/scalene.dockerfile

@@ -1,14 +1,4 @@
-FROM adoptopenjdk/openjdk13
-
-RUN apt-get update -yqq
-RUN apt-get install -yqq gnupg git
-
-# Install sbt
-RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list
-RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list
-RUN curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add
-RUN apt-get update -yqq
-RUN apt-get install -yqq sbt
+FROM sbtscala/scala-sbt:eclipse-temurin-17.0.14_7_1.10.11_2.13.16
 
 WORKDIR /scalene
 COPY project project

+ 1 - 1
frameworks/Scala/sharaf/.mill-version

@@ -1 +1 @@
-0.12.8
+0.12.10

+ 1 - 1
frameworks/Scala/sharaf/sharaf.dockerfile

@@ -1,4 +1,4 @@
-FROM eclipse-temurin:21-jdk-ubi9-minimal
+FROM nightscape/scala-mill:eclipse-temurin-21.0.6_7-jdk-jammy_0.12.10
 WORKDIR /sharaf
 
 COPY src src

+ 1 - 1
frameworks/Scala/vertx-web-scala/build.sbt

@@ -2,7 +2,7 @@ name := "vertx-web-scala"
 
 version := "1"
 
-scalaVersion := "2.12.17"
+scalaVersion := "2.12.20"
 
 lazy val root = (project in file(".")).enablePlugins(SbtTwirl)
 

+ 1 - 1
frameworks/Scala/vertx-web-scala/project/build.properties

@@ -1 +1 @@
-sbt.version=1.8.2
+sbt.version=1.10.11

+ 1 - 1
frameworks/Scala/vertx-web-scala/vertx-web-scala.dockerfile

@@ -1,4 +1,4 @@
-FROM sbtscala/scala-sbt:eclipse-temurin-17.0.5_8_1.8.2_2.12.17
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.12.20
 
 ARG SBT_VERSION=1.8.2
 

+ 1 - 1
frameworks/Scala/youi/build.sbt

@@ -1,6 +1,6 @@
 name := "youi-server"
 version := "1.0"
-scalaVersion := "2.13.3"
+scalaVersion := "2.13.16"
 
 libraryDependencies ++= Seq(
   "io.youi" %% "youi-server" % "0.13.17",

+ 1 - 1
frameworks/Scala/youi/project/build.properties

@@ -1 +1 @@
-sbt.version=1.4.2
+sbt.version=1.10.11

+ 3 - 1
frameworks/Scala/youi/project/plugins.sbt

@@ -1 +1,3 @@
-addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.13")
+addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.13")
+
+libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % "always"

+ 1 - 1
frameworks/Scala/youi/youi.dockerfile

@@ -1,4 +1,4 @@
-FROM hseeberger/scala-sbt:8u151-2.12.5-1.1.2
+FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.11_2.13.16
 WORKDIR /youi
 COPY project project
 COPY src src