diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d34c58..64dcd08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased] +* Replace sbt-extras with direct sbt launcher installation. ([#291](https://github.com/heroku/heroku-buildpack-scala/pull/291)) * Remove build directory symlinking. Modern sbt versions no longer require a stable build path for caching. ([#290](https://github.com/heroku/heroku-buildpack-scala/pull/290)) ## [v103] - 2025-10-27 diff --git a/bin/compile b/bin/compile index 4914cd4..1fe87d7 100755 --- a/bin/compile +++ b/bin/compile @@ -26,6 +26,8 @@ source "${BUILDPACK_DIR}/lib/metrics.sh" source "${BUILDPACK_DIR}/lib/util.sh" # shellcheck source=lib/openjdk.sh source "${BUILDPACK_DIR}/lib/openjdk.sh" +# shellcheck source=lib/sbt.sh +source "${BUILDPACK_DIR}/lib/sbt.sh" metrics::init "${CACHE_DIR}" "scala" metrics::setup @@ -51,27 +53,6 @@ done # Install the JDK openjdk::install_openjdk_via_jvm_common_buildpack "${BUILD_DIR}" "${BUILDPACK_DIR}" -#create the cache dir if it doesn't exist -mkdir -p "${CACHE_DIR}" - -# home directory from perspective of SBT; we rename -# it because otherwise the project root and $HOME -# are the same, and by default .sbt has a (different) -# meaning in those two places -SBT_USER_HOME=".sbt_home" -SBT_USER_HOME_ABSOLUTE="${BUILD_DIR}/${SBT_USER_HOME}" -# where we put the SBT binaries -SBT_BINDIR="${SBT_USER_HOME}/bin" - -# chdir as sbt expects -cd "${BUILD_DIR}" - -# unpack cache -CACHED_DIRS="${SBT_USER_HOME} target project/target project/boot .coursier" -for DIR in ${CACHED_DIRS}; do - cache_copy "${DIR}" "${CACHE_DIR}" "${BUILD_DIR}" -done - sbt_version="$(java_properties::get "${BUILD_DIR}/project/build.properties" "sbt.version")" metrics::set_string "sbt_version" "${sbt_version:-"unknown"}" @@ -150,6 +131,15 @@ if has_old_preset_sbt_opts; then EOF fi +# Copy the target dir from cache to speed up compilation. This is legacy buildpack +# behavior that other JVM buildpacks don't implement. It can cause cache bloat, stale artifacts, +# and reduced build reproducibility. We've observed customers using SBT_CLEAN (which will remove these files) +# much more than expected (~10% of builds), presumably to work around issues. +# This will be removed in a future version. +target_dir_cache_restore_start_time=$(util::nowms) +util::cache_copy "target" "${CACHE_DIR}" "${BUILD_DIR}" +metrics::set_duration "target_dir_cache_restore_duration" "${target_dir_cache_restore_start_time}" + if [[ -n "${SBT_PROJECT}" ]]; then SBT_TASKS="${SBT_PROJECT}/compile ${SBT_PROJECT}/stage" else @@ -166,27 +156,55 @@ fi # See: https://devcenter.heroku.com/articles/scala-support#clean-builds [[ "${SBT_CLEAN}" = "true" ]] && SBT_TASKS="clean ${SBT_TASKS}" -# Install the custom sbt script -install_sbt_extras "${BUILDPACK_DIR}/opt" "${SBT_BINDIR}" +# Disable log formatting (which would modify already printed lines...) +util::prepend_to_env "SBT_OPTS" "-Dsbt.log.noformat=true" +# Disable colored output +util::prepend_to_env "SBT_OPTS" "-Dsbt.color=false" + +ivy_home_dir="${CACHE_DIR}/ivy_home" +util::prepend_to_env "SBT_OPTS" "-Dsbt.ivy.home=${ivy_home_dir}" +mkdir -p "${ivy_home_dir}" + +coursier_home_dir="${CACHE_DIR}/coursier_home" +util::prepend_to_env "SBT_OPTS" "-Dsbt.coursier.home=${coursier_home_dir}" +mkdir -p "${coursier_home_dir}" + +sbt_boot_dir="${CACHE_DIR}/sbt_boot" +util::prepend_to_env "SBT_OPTS" "-Dsbt.boot.directory=${sbt_boot_dir}" +mkdir -p "${sbt_boot_dir}" + +# See: https://www.scala-sbt.org/1.x/docs/Command-Line-Reference.html +sbt_global_dir="${CACHE_DIR}/sbt_global" +util::prepend_to_env "SBT_OPTS" "-Dsbt.global.base=${sbt_global_dir}" +mkdir -p "${sbt_global_dir}" -# copy in heroku sbt plugin +# Install the Heroku sbt plugin if the exising version differs (or is missing). We do this conditionally to +# ensure we can cache the compiled class files of the plugin between builds, speeding up the build overall. case "${sbt_version}" in 1.*) - HEROKU_PLUGIN="HerokuBuildpackPlugin_sbt1.scala" + plugin_source_path="${BUILDPACK_DIR}/opt/HerokuBuildpackPlugin_sbt1.scala" ;; *) - HEROKU_PLUGIN="HerokuBuildpackPlugin.scala" + plugin_source_path="${BUILDPACK_DIR}/opt/HerokuBuildpackPlugin.scala" ;; esac -mkdir -p "${SBT_USER_HOME}/plugins" -rm -f "${SBT_USER_HOME}/plugins/HerokuPlugin.scala" # remove the old ambiguously named plugin -rm -f "${SBT_USER_HOME}/plugins/HerokuBuildpackPlugin_sbt1.scala" # remove the old poorly named plugin -rm -f "${SBT_USER_HOME}/plugins/HerokuBuildpackPlugin.scala" # remove the old plugin -cp -p "${BUILDPACK_DIR}/opt/${HEROKU_PLUGIN}" "${SBT_USER_HOME}/plugins/HerokuBuildpackPlugin.scala" +plugins_dir="${sbt_global_dir}/plugins" +plugin_destination_path="${plugins_dir}/HerokuBuildpackPlugin.scala" +source_checksum="$(sha256sum "${plugin_source_path}" | awk '{print $1}')" -# Collect metrics +if [[ ! -f "${plugin_destination_path}" ]] || [[ "${source_checksum}" != "$(sha256sum "${plugin_destination_path}" | awk '{print $1}')" ]]; then + # We remove the whole directory since we also want to remove the (cached) compiled files + # for the older version of the plugin in the ./target directory. + rm -rf "${plugins_dir}" + + mkdir -p "${plugins_dir}" + cp "${plugin_source_path}" "${plugin_destination_path}" +fi +sbt::install_sbt_launcher "${sbt_version}" "${CACHE_DIR}/sbt-launcher" + +# Collect metrics if is_sbt_native_packager "${BUILD_DIR}"; then metrics::set_raw "uses_sbt_native_packager" "true" else @@ -199,66 +217,41 @@ else metrics::set_raw "is_play_app" "false" fi -# Manually pre-clean because sbt-native-packager doesn't clobber this dir -rm -rf "${BUILD_DIR}/target/universal/stage" - # build app -run_sbt "${SBT_USER_HOME_ABSOLUTE}" "${SBT_TASKS}" +cd "${BUILD_DIR}" + +run_sbt "${SBT_TASKS}" if [[ -z "${DISABLE_DEPENDENCY_CLASSPATH_LOG:-}" ]]; then - write_sbt_dependency_classpath_log "${SBT_USER_HOME_ABSOLUTE}" + write_sbt_dependency_classpath_log fi -# repack cache -mkdir -p "${CACHE_DIR}" -for DIR in ${CACHED_DIRS}; do - cache_copy "${DIR}" "${BUILD_DIR}" "${CACHE_DIR}" -done - -# drop useless directories from slug for play and sbt-native-launcher only -if is_sbt_native_packager "${BUILD_DIR}" || is_play "${BUILD_DIR}"; then - if [[ "${KEEP_SBT_CACHE:-}" != "true" ]]; then - if [[ "${KEEP_IVY_CACHE:-}" != "true" ]] && [[ -d "${SBT_USER_HOME}/.ivy2" ]]; then - output::step "Dropping ivy cache from the slug" - rm -rf "${SBT_USER_HOME:?}/.ivy2" - fi - if [[ "${KEEP_COURSIER_CACHE:-}" != "true" ]] && [[ -d "${SBT_USER_HOME}/.coursier" ]]; then - output::step "Dropping coursier cache from the slug" - rm -rf "${SBT_USER_HOME:?}/.coursier" - fi - if [[ -d "${SBT_USER_HOME}/boot" ]]; then - output::step "Dropping sbt boot dir from the slug" - rm -rf "${SBT_USER_HOME:?}/boot" - fi - if [[ -d "${SBT_USER_HOME}/.cache" ]]; then - output::step "Dropping sbt cache dir from the slug" - rm -rf "${SBT_USER_HOME:?}/.cache" - fi - if [[ -d "${BUILD_DIR}/project/boot" ]]; then - output::step "Dropping project boot dir from the slug" - rm -rf "${BUILD_DIR}/project/boot" - fi - if [[ -d "${BUILD_DIR}/target" ]]; then - output::step "Dropping compilation artifacts from the slug" - rm -rf "${BUILD_DIR}/target/scala-"* - rm -rf "${BUILD_DIR}/target/streams" - if [[ -d "${BUILD_DIR}/target/resolution-cache" ]]; then - find "${BUILD_DIR}/target/resolution-cache"/* ! -name "reports" ! -name "*-compile.xml" -print0 | xargs -0 rm -rf -- - fi - fi - fi +# Copy the target dir back to cache for the next build (see cache restore comment above for context) +target_dir_cache_write_start_time=$(util::nowms) +util::cache_copy "target" "${BUILD_DIR}" "${CACHE_DIR}" +metrics::set_duration "target_dir_cache_write_duration" "${target_dir_cache_write_start_time}" + +# When sbt-native-packager is used (either directly or implicitly by the Play framework), a standalone JAR file with +# all code and dependencies is created. This makes the other JAR and class files redundant since they are not used by +# the running application. We remove these files here to reduce the slug size. However, this is a broad assumption that +# is often but not always correct. Users might want to use these files to run the application differently or for other +# purposes. This is legacy behavior that we will not change at this point to avoid users running into slug size limits +# needlessly. Ideally customers would curate their builds to not include extraneous files. +if (is_sbt_native_packager "${BUILD_DIR}" || is_play "${BUILD_DIR}") && [[ "${KEEP_SBT_CACHE:-}" != "true" ]]; then + output::step "Dropping compilation artifacts from the slug" + rm -rf "${BUILD_DIR}/target/scala-"* + rm -rf "${BUILD_DIR}/target/streams" + find "${BUILD_DIR}/target/resolution-cache" -mindepth 1 ! -name "reports" ! -name "*-compile.xml" -exec rm -rf {} + 2>/dev/null || true fi # write profile.d script profile_script="${BUILD_DIR}/.profile.d/scala.sh" mkdir -p "$(dirname "${profile_script}")" cat <<-EOF >"${profile_script}" - export SBT_HOME="\$HOME/${SBT_USER_HOME}" export PATH="\$SBT_HOME/bin:\$PATH" EOF # write export script cat <<-EOF >"${BASE_DIR}/export" - export SBT_HOME="${BUILD_DIR}/${SBT_USER_HOME}" export PATH="\$SBT_HOME/bin:\$PATH" EOF diff --git a/lib/common.sh b/lib/common.sh index 3e6a6ee..2f270ad 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -50,54 +50,23 @@ output() { esac } -install_sbt_extras() { - local opt_dir="${1}" - local sbt_bin_dir="${2}" - - rm -f "${sbt_bin_dir}"/sbt-launch*.jar #legacy launcher - mkdir -p "${sbt_bin_dir}" - cp -p "${opt_dir}"/sbt-extras.sh "${sbt_bin_dir}"/sbt-extras - cp -p "${opt_dir}"/sbt-wrapper.sh "${sbt_bin_dir}"/sbt - - chmod 0755 "${sbt_bin_dir}"/sbt-extras - chmod 0755 "${sbt_bin_dir}"/sbt - - export PATH="${sbt_bin_dir}:${PATH}" -} - run_sbt() { - local home="${1}" - local tasks="${2}" + local tasks="${1}" local build_log_file=".heroku/sbt-build.log" - + mkdir -p "$(dirname "${build_log_file}")" echo "" >"${build_log_file}" - export SBT_EXTRAS_OPTS="${SBT_EXTRAS_OPTS:-}" - output::step "Running: sbt ${tasks}" # shellcheck disable=SC2086 # We want word splitting for tasks - if ! SBT_HOME="${home}" sbt ${tasks} | output "${build_log_file}"; then + if ! sbt ${tasks} | output "${build_log_file}"; then handle_sbt_errors "${build_log_file}" exit 1 fi } write_sbt_dependency_classpath_log() { - local home="${1}" - export SBT_EXTRAS_OPTS="${SBT_EXTRAS_OPTS:-}" output::step "Collecting dependency information" - SBT_HOME="${home}" sbt "show dependencyClasspath" | grep -o "Attributed\(.*\)" >.heroku/sbt-dependency-classpath.log || true -} - -cache_copy() { - rel_dir="${1}" - from_dir="${2}" - to_dir="${3}" - rm -rf "${to_dir:?}/${rel_dir}" - if [[ -d "${from_dir}/${rel_dir}" ]]; then - mkdir -p "${to_dir}/${rel_dir}" - cp -pr "${from_dir}/${rel_dir}"/. "${to_dir}/${rel_dir}" - fi + sbt "show dependencyClasspath" | grep -o "Attributed\(.*\)" >.heroku/sbt-dependency-classpath.log || true } diff --git a/lib/sbt.sh b/lib/sbt.sh new file mode 100644 index 0000000..c50cf90 --- /dev/null +++ b/lib/sbt.sh @@ -0,0 +1,128 @@ +#!/usr/bin/env bash + +# This is technically redundant, since all consumers of this lib will have enabled these, +# however, it helps Shellcheck realise the options under which these functions will run. +set -euo pipefail + +function sbt::install_sbt_launcher() { + local sbt_version="${1}" + local sbt_launcher_dir="${2}" + + mkdir -p "${sbt_launcher_dir}" + local launcher_jar_path="${sbt_launcher_dir}/sbt-launch-${sbt_version}.jar" + + if [[ ! -f "${launcher_jar_path}" ]]; then + output::step "Downloading sbt launcher ${sbt_version}..." + sbt::download_sbt_launcher_jar "${sbt_version}" "${launcher_jar_path}" + fi + + output::step "Setting up sbt launcher..." + mkdir -p "${sbt_launcher_dir}/bin" + cat <<-EOF >"${sbt_launcher_dir}/bin/sbt" + #!/usr/bin/env bash + script_dir="\$(cd "\$(dirname "\${BASH_SOURCE[0]}")" && pwd)" + java \${SBT_OPTS:-} -jar "\${script_dir}/../sbt-launch-${sbt_version}.jar" "\$@" + EOF + + chmod +x "${sbt_launcher_dir}/bin/sbt" + export PATH="${sbt_launcher_dir}/bin:${PATH}" +} + +function sbt::download_sbt_launcher_jar() { + local sbt_version="${1}" + local destination_path="${2}" + + local sbt_launcher_jar_url + if [[ "${sbt_version}" == 0.* ]]; then + sbt_launcher_jar_url="https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/${sbt_version}/sbt-launch.jar" + else + sbt_launcher_jar_url="https://repo.maven.apache.org/maven2/org/scala-sbt/sbt-launch/${sbt_version}/sbt-launch-${sbt_version}.jar" + fi + + local http_status_code + http_status_code=$(curl \ + --retry 3 \ + --retry-connrefused \ + --connect-timeout 5 \ + --silent \ + --show-error \ + --max-time 60 \ + --location \ + --write-out "%{http_code}" \ + --output "${destination_path}" \ + "${sbt_launcher_jar_url}") + + local curl_exit_code=$? + + if [[ "${http_status_code}" == "404" ]]; then + output::error <<-EOF + Error: The requested sbt launcher version isn't available. + + We couldn't find sbt launcher version ${sbt_version} in the + Maven repository. + + Check that this sbt version has been released upstream: + https://github.com/sbt/sbt/releases + + If it has, make sure that you are using the latest version + of this buildpack, and haven't pinned to an older release: + https://devcenter.heroku.com/articles/managing-buildpacks#view-your-buildpacks + https://devcenter.heroku.com/articles/managing-buildpacks#classic-buildpacks-references + EOF + + metrics::set_string "failure_reason" "install_sbt::version_unavailable" + exit 1 + elif [[ "${curl_exit_code}" -ne 0 || "${http_status_code}" != "200" ]]; then + output::error <<-EOF + Error: Unable to download sbt launcher. + + An error occurred while downloading the sbt launcher from: + ${sbt_launcher_jar_url} + + In some cases, this happens due to a temporary issue with + the network connection or server. + + First, make sure that you are using the latest version + of this buildpack, and haven't pinned to an older release: + https://devcenter.heroku.com/articles/managing-buildpacks#view-your-buildpacks + https://devcenter.heroku.com/articles/managing-buildpacks#classic-buildpacks-references + + Then try building again to see if the error resolves itself. + + HTTP status code: ${http_status_code}, curl exit code: ${curl_exit_code} + EOF + + metrics::set_string "failure_reason" "install_sbt::download_error" + exit 1 + fi + + local sha1_path + sha1_path=$(mktemp) + + if ! curl --silent --show-error --location "${sbt_launcher_jar_url}.sha1" >"${sha1_path}" 2>/dev/null; then + output::error <<-EOF + Error: Unable to download SHA-1 checksum for sbt launcher. + EOF + + metrics::set_string "failure_reason" "install_sbt::checksum_unavailable" + exit 1 + fi + + local expected_sha1 + expected_sha1=$(cat "${sha1_path}") + + local actual_sha1 + actual_sha1=$(sha1sum "${destination_path}" | cut -d' ' -f1) + + if [[ "${actual_sha1}" != "${expected_sha1}" ]]; then + output::error <<-EOF + Error: Checksum verification failed for sbt launcher. + + Expected: ${expected_sha1} + Actual: ${actual_sha1} + EOF + + metrics::set_string "failure_reason" "install_sbt::checksum_mismatch" + exit 1 + fi +} diff --git a/lib/util.sh b/lib/util.sh index 2ef0390..9527c71 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -61,3 +61,19 @@ function util::cache_copy() { function util::nowms() { date +%s%3N } + +# Prepends a value to an environment variable with an optional delimiter. +# +# Usage: +# ``` +# util::prepend_to_env "PATH" "/usr/local/bin" ":" +# util::prepend_to_env "OPTS" "-Xmx512m" +# ``` +function util::prepend_to_env() { + local env_var="${1}" + local value="${2}" + local delimiter="${3:- }" + + local env_var_value="${!env_var:-}" + declare -gx "${env_var}=${value}${env_var_value:+${delimiter}${env_var_value}}" +} diff --git a/opt/sbt-extras.sh b/opt/sbt-extras.sh deleted file mode 100755 index 9fb2a82..0000000 --- a/opt/sbt-extras.sh +++ /dev/null @@ -1,664 +0,0 @@ -#!/usr/bin/env bash -# -# A more capable sbt runner, coincidentally also called sbt. -# Author: Paul Phillips -# 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.6.2" -declare -r sbt_unreleased_version="1.6.2" - -declare -r latest_213="2.13.8" -declare -r latest_212="2.12.15" -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 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 < display stack traces with a max of 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 to global settings/plugins directory (default: ~/.sbt/) - -sbt-boot path to shared boot directory (default: ~/.sbt/boot in 0.11+) - -ivy path to local Ivy repository (default: ~/.ivy2) - -no-share use all local caches; no sharing - -offline put sbt in offline mode - -jvm-debug Turn on JVM debugging, open at the given port. - -batch Disable interactive mode - -prompt Set the sbt prompt; in expr, 's' is the State and 'e' is Extracted - -script Run the specified file as a scala script - - # sbt version (default: sbt.version from $buildProps if present, otherwise $sbt_release_version) - -sbt-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 use the specified jar as the sbt launcher - -sbt-launch-dir directory to hold sbt launchers (default: $sbt_launch_dir) - -sbt-launch-repo 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 use the scala build at the specified directory - -scala-version use the specified version of scala - -binary-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 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_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 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 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 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 < Scala app detected remote: -----> Installing Azul Zulu OpenJDK 21.0.[0-9]+ + remote: -----> Downloading sbt launcher 1.11.7... + remote: -----> Setting up sbt launcher... remote: -----> Running: sbt compile stage - remote: Downloading sbt launcher for 1.11.7: - remote: From https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.11.7/sbt-launch-1.11.7.jar - remote: To /tmp/[^/]+/.sbt_home/launchers/1.11.7/sbt-launch.jar - remote: Downloading sbt launcher 1.11.7 md5 hash: - remote: From https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.11.7/sbt-launch-1.11.7.jar.md5 - remote: To /tmp/[^/]+/.sbt_home/launchers/1.11.7/sbt-launch.jar.md5 - remote: /tmp/[^/]+/.sbt_home/launchers/1.11.7/sbt-launch.jar: OK remote: \\[info\\] \\[launcher\\] getting org.scala-sbt sbt 1.11.7 \\(this may take some time\\)... remote: \\[info\\] \\[launcher\\] getting Scala 2.12.20 \\(for sbt\\)... remote: \\[info\\] welcome to sbt 1.11.7 \\(Azul Systems, Inc. Java 21.0.[0-9]+\\) - remote: \\[info\\] loading global plugins from /tmp/[^/]+/.sbt_home/plugins - remote: \\[info\\] compiling 1 Scala source to /tmp/[^/]+/.sbt_home/plugins/target/scala-2.12/sbt-1.0/classes ... + remote: \\[info\\] loading global plugins from .*/plugins + remote: \\[info\\] compiling 1 Scala source to .* ... remote: \\[info\\] Non-compiled module 'compiler-bridge_2.12' for Scala 2.12.20. Compiling... remote: \\[info\\] Compilation completed in .*s. remote: \\[info\\] done compiling @@ -48,9 +43,6 @@ remote: \\[info\\] Wrote /tmp/[^/]+/target/scala-2.13/sbt-0-11-7-play-3-x-scala-2-13-x_2.13-1.0-SNAPSHOT.pom remote: \\[success\\] Total time: .* remote: -----> Collecting dependency information - remote: -----> Dropping ivy cache from the slug - remote: -----> Dropping sbt boot dir from the slug - remote: -----> Dropping sbt cache dir from the slug remote: -----> Dropping compilation artifacts from the slug remote: -----> Discovering process types remote: Procfile declares types -> \\(none\\) @@ -66,9 +58,10 @@ expect(clean_output(app.output)).to match(Regexp.new(<<~REGEX, Regexp::MULTILINE)) remote: -----> Scala app detected remote: -----> Installing Azul Zulu OpenJDK 21.0.[0-9]+ + remote: -----> Setting up sbt launcher... remote: -----> Running: sbt compile stage remote: \\[info\\] welcome to sbt 1.11.7 \\(Azul Systems, Inc. Java 21.0.[0-9]+\\) - remote: \\[info\\] loading global plugins from /tmp/[^/]+/.sbt_home/plugins + remote: \\[info\\] loading global plugins from .*/plugins remote: \\[info\\] loading settings for project [^\\s]+-build from plugins.sbt... remote: \\[info\\] loading project definition from /tmp/[^/]+/project remote: \\[info\\] loading settings for project root from build.sbt... @@ -89,9 +82,6 @@ remote: \\[info\\] Wrote /tmp/[^/]+/target/scala-2.13/sbt-0-11-7-play-3-x-scala-2-13-x_2.13-1.0-SNAPSHOT.pom remote: \\[success\\] Total time: .* remote: -----> Collecting dependency information - remote: -----> Dropping ivy cache from the slug - remote: -----> Dropping sbt boot dir from the slug - remote: -----> Dropping sbt cache dir from the slug remote: -----> Dropping compilation artifacts from the slug remote: -----> Discovering process types remote: Procfile declares types -> \\(none\\) diff --git a/test/spec/ci_spec.rb b/test/spec/ci_spec.rb index 148230f..2c7d368 100644 --- a/test/spec/ci_spec.rb +++ b/test/spec/ci_spec.rb @@ -20,8 +20,8 @@ \\[info\\] \\[launcher\\] getting org.scala-sbt sbt 1.11.7 \\(this may take some time\\)... \\[info\\] \\[launcher\\] getting Scala 2.12.20 \\(for sbt\\)... \\[info\\] welcome to sbt 1.11.7 \\(Azul Systems, Inc. Java 21.0.[0-9]+\\) - \\[info\\] loading global plugins from /app/.sbt_home/plugins - \\[info\\] compiling 1 Scala source to /app/.sbt_home/plugins/target/scala-2.12/sbt-1.0/classes ... + \\[info\\] loading global plugins from .*/plugins + \\[info\\] compiling 1 Scala source to .* ... \\[info\\] Non-compiled module 'compiler-bridge_2.12' for Scala 2.12.20. Compiling... \\[info\\] Compilation completed in .*s. \\[info\\] done compiling @@ -47,7 +47,7 @@ -----> Running Scala buildpack tests... Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -XX:MaxRAM=2684354560 -XX:MaxRAMPercentage=80.0 \\[info\\] welcome to sbt 1.11.7 \\(Azul Systems, Inc. Java 21.0.[0-9]+\\) - \\[info\\] loading global plugins from /app/.sbt_home/plugins + \\[info\\] loading global plugins from .*/plugins \\[info\\] loading project definition from /app/project/project \\[info\\] loading settings for project app-build from ._plugins.sbt, plugins.sbt... \\[info\\] loading project definition from /app/project @@ -78,7 +78,7 @@ -----> Installing Azul Zulu OpenJDK 21.0.[0-9]+ -----> Running: sbt update \\[info\\] welcome to sbt 1.11.7 \\(Azul Systems, Inc. Java 21.0.[0-9]+\\) - \\[info\\] loading global plugins from /app/.sbt_home/plugins + \\[info\\] loading global plugins from .*/plugins \\[info\\] loading project definition from /app/project/project \\[info\\] loading settings for project app-build from ._plugins.sbt, plugins.sbt... \\[info\\] loading project definition from /app/project @@ -101,7 +101,7 @@ -----> Running Scala buildpack tests... Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -XX:MaxRAM=2684354560 -XX:MaxRAMPercentage=80.0 \\[info\\] welcome to sbt 1.11.7 \\(Azul Systems, Inc. Java 21.0.[0-9]+\\) - \\[info\\] loading global plugins from /app/.sbt_home/plugins + \\[info\\] loading global plugins from .*/plugins \\[info\\] loading project definition from /app/project/project \\[info\\] loading settings for project app-build from ._plugins.sbt, plugins.sbt... \\[info\\] loading project definition from /app/project