Skip to content

Commit 7d59d4f

Browse files
committed
Adapt the scripts to sbt-native-packager
1 parent 1e2be00 commit 7d59d4f

File tree

11 files changed

+22
-72
lines changed

11 files changed

+22
-72
lines changed

.github/workflows/ci.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ jobs:
8787
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true
8888

8989
- name: Test
90-
# DON'T add dist/pack!
91-
# Adding dist/pack bootstraps the compiler
90+
# DON'T add dist/Universal/stage!
91+
# Adding dist/Universal/stage bootstraps the compiler
9292
# which undermines the point of these tests:
9393
# to quickly run the tests without the cost of bootstrapping
9494
# and also to run tests when the compiler doesn't bootstrap
@@ -231,7 +231,7 @@ jobs:
231231
shell: cmd
232232

233233
- name: build binary
234-
run: sbt "dist-win-x86_64/pack" & bash -version
234+
run: sbt "dist-win-x86_64/Universal/stage" & bash -version
235235
shell: cmd
236236

237237
- name: cygwin tests
@@ -271,7 +271,7 @@ jobs:
271271
uses: actions/checkout@v4
272272

273273
- name: build binary
274-
run: sbt "dist-win-x86_64/pack"
274+
run: sbt "dist-win-x86_64/Universal/stage"
275275
shell: cmd
276276

277277
- name: Test

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ To try it in your project see also the [Getting Started User Guide](https://docs
1111

1212
Building a Local Distribution
1313
=============================
14-
1. `sbt dist/packArchive`
14+
1. `sbt dist/Universal/packageBin`
1515
2. Find the newly-built distributions in `dist/target/`
1616

1717
Code of Conduct

bin/common

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ shift # Mutates $@ by deleting the first element ($1)
1313
source "$ROOT/bin/common-platform"
1414

1515
# Marker file used to obtain the date of latest call to sbt-back
16-
version="$ROOT/$DIST_DIR/target/pack/VERSION"
16+
version="$ROOT/$DIST_DIR/target/universal/stage/VERSION"
1717

1818
# Create the target if absent or if file changed in ROOT/compiler
1919
new_files="$(find "$ROOT/compiler" \( -iname "*.scala" -o -iname "*.java" \) -newer "$version" 2> /dev/null)"
2020

2121
if [ ! -f "$version" ] || [ ! -z "$new_files" ]; then
2222
echo "Building Dotty..."
23-
(cd $ROOT && sbt "$DIST_PROJECT/pack")
23+
(cd $ROOT && sbt "$DIST_PROJECT/Universal/packageBin")
2424
fi
2525

26-
"$ROOT/$DIST_DIR/target/pack/bin/$target" "$@"
26+
"$ROOT/$DIST_DIR/target/universal/stage/bin/$target" "$@"

compiler/test/dotty/tools/scripting/ClasspathTests.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class ClasspathTests:
6767
(hashbangJars.toSet -- packlibJars.toSet , "only in hashbang classpath")
6868
}
6969
// verify that the script hasbang classpath setting was effective at supplementing the classpath
70-
// (a minimal subset of jars below dist*/target/pack/lib are always be in the classpath)
70+
// (a minimal subset of jars below dist*/target/universal/stage/lib are always be in the classpath)
7171
val missingClasspathEntries = if hashbangClasspathJars.size != packlibJars.size then
7272
printf("packlib dir [%s]\n", packlibDir)
7373
printf("hashbangClasspathJars: %s\n", hashbangJars.map { _.relpath.norm }.mkString("\n ", "\n ", ""))

compiler/test/dotty/tools/scripting/ScriptTestEnv.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import scala.jdk.CollectionConverters.*
1616
/**
1717
* Common Code for supporting scripting tests.
1818
* To override the path to the bash executable, set TEST_BASH=<path-to-bash.exe>
19-
* To specify where `dist[*]/target/pack/bin` resides, set TEST_CWD=<working-directory>
19+
* To specify where `dist[*]/target/universal/stage/bin` resides, set TEST_CWD=<working-directory>
2020
* Test scripts run in a bash env, so paths are converted to forward slash via .norm.
2121
*/
2222
object ScriptTestEnv {
@@ -48,7 +48,7 @@ object ScriptTestEnv {
4848
}
4949

5050
lazy val nativePackDir: Option[String] = {
51-
def nativeDir(os: String, arch: String) = Some(s"dist/$os-$arch/target/pack")
51+
def nativeDir(os: String, arch: String) = Some(s"dist/$os-$arch/target/universal/stage")
5252
def nativeOs(os: String) = archNorm match
5353
case arch @ ("aarch64" | "x86_64") => nativeDir(os, arch)
5454
case _ => None
@@ -61,7 +61,7 @@ object ScriptTestEnv {
6161

6262
def jvmPackDir() =
6363
println("warning: unknown OS architecture combination, defaulting to JVM launcher.")
64-
"dist/target/pack"
64+
"dist/target/universal/stage"
6565

6666
def packDir: String = nativePackDir.getOrElse(jvmPackDir())
6767

@@ -302,7 +302,7 @@ object ScriptTestEnv {
302302
// use optional TEST_BASH if defined, otherwise, bash must be in PATH
303303

304304
// envScalaHome is:
305-
// dist[*]/target/pack, if present
305+
// dist[*]/target/universal/stage, if present
306306
// else, SCALA_HOME if defined
307307
// else, not defined
308308
lazy val envScalaHome =

project/DistributionPlugin.scala

-50
This file was deleted.

project/scripts/bootstrappedOnlyCmdTests

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ echo "testing scala.quoted.Expr.run from sbt scala"
1515
grep -qe "val a: scala.Int = 3" "$tmp"
1616

1717
# setup for `scalac`/`scala` script tests
18-
"$SBT" "$DIST_PROJECT/pack"
18+
"$SBT" "$DIST_PROJECT/universal/stage"
1919

20-
echo "capturing scala version from $DIST_DIR/target/pack/VERSION"
21-
IFS=':=' read -ra versionProps < "$ROOT/$DIST_DIR/target/pack/VERSION" # temporarily set IFS to ':=' to split versionProps
20+
echo "capturing scala version from $DIST_DIR/target/universal/stage/VERSION"
21+
IFS=':=' read -ra versionProps < "$ROOT/$DIST_DIR/target/universal/stage/VERSION" # temporarily set IFS to ':=' to split versionProps
2222
[ ${#versionProps[@]} -eq 3 ] && \
2323
[ ${versionProps[0]} = "version" ] && \
24-
[ -n ${versionProps[2]} ] || die "Expected non-empty 'version' property in $ROOT/$DIST_DIR/target/pack/VERSION"
24+
[ -n ${versionProps[2]} ] || die "Expected non-empty 'version' property in $ROOT/$DIST_DIR/target/universal/stage/VERSION"
2525
scala_version=${versionProps[2]}
2626

2727
# check that `scalac` compiles and `scala` runs it
@@ -77,7 +77,7 @@ echo "testing sbt scalac with suspension"
7777
clear_out "$OUT"
7878
"$SBT" "scala3-compiler-bootstrapped/scalac -d $OUT tests/pos-macros/macros-in-same-project-1/Bar.scala tests/pos-macros/macros-in-same-project-1/Foo.scala" > "$tmp"
7979

80-
# echo ":quit" | ./$DIST_DIR/target/pack/bin/scala # not supported by CI
80+
# echo ":quit" | ./$DIST_DIR/target/universal/stage/bin/scala # not supported by CI
8181

8282
echo "testing ./bin/scaladoc"
8383
clear_out "$OUT1"

project/scripts/buildScalaBinary

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ SBT="$ROOT/project/scripts/sbt" # if run on CI
99
source "$ROOT/bin/common-platform"
1010

1111
# build the scala/scalac/scaladoc binary, where scala is native for the current platform.
12-
"$SBT" "$DIST_PROJECT/pack"
12+
"$SBT" "$DIST_PROJECT/Universal/stage"

project/scripts/cmdScaladocTests

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ SOURCE_LINKS_REPOSITORY="scala/scala3"
2020
SOURCE_LINKS_VERSION="${GITHUB_SHA:-$DOTTY_BOOTSTRAPPED_VERSION}"
2121

2222
"$SBT" "scaladoc/generateTestcasesDocumentation" > "$tmp" 2>&1 || echo "generated testcases project with sbt"
23-
dist/target/pack/bin/scaladoc \
23+
dist/target/universal/stage/bin/scaladoc \
2424
-d "$OUT1" \
2525
-project "scaladoc testcases" \
2626
-source-links:out/bootstrap/scala2-library-bootstrapped/scala-"${DOTTY_NONBOOTSTRAPPED_VERSION}"/src_managed/main/scala-library-src=github://scala/scala/v"${STDLIB_VERSION}"#src/library \

project/scripts/winCmdTests

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
set -e
4-
PREFIX="dist/win-x86_64/target/pack"
4+
PREFIX="dist/win-x86_64/target/universal/stage"
55
SOURCE="tests/pos/HelloWorld.scala"
66
$PREFIX/bin/scalac @project/scripts/options "$SOURCE"
77
$PREFIX/bin/scalac -d out "$SOURCE"

project/scripts/winCmdTests.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
setlocal
33

44
@rem paths are relative to the root project directory
5-
set "_PREFIX=dist\win-x86_64\target\pack"
5+
set "_PREFIX=dist\win-x86_64\target\universal\stage"
66
set "_SOURCE=tests\pos\HelloWorld.scala"
77
set "_OUT_DIR=out"
88
set "_SITE_DIR=_site"

0 commit comments

Comments
 (0)