From 2c529c6295720560fdaac222cf45836e0860cc70 Mon Sep 17 00:00:00 2001 From: Liu Fengyun Date: Sat, 31 Aug 2019 13:22:47 +0200 Subject: [PATCH 1/3] Fix #7146: make dotty-staging available in REPL --- dist/bin/dotr | 2 +- project/Build.scala | 2 +- project/scripts/bootstrapCmdTests | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dist/bin/dotr b/dist/bin/dotr index 0dd677bb48ee..5d8808a3ed4d 100755 --- a/dist/bin/dotr +++ b/dist/bin/dotr @@ -102,7 +102,7 @@ elif [ $execute_repl == true ] || [ ${#residual_args[@]} -ne 0 ]; then echo "warning: multiple classpaths are found, dotr only use the last one." fi if [ $with_compiler == true ]; then - cp_arg+="$PSEP$DOTTY_COMP$PSEP$DOTTY_INTF$PSEP$SCALA_ASM$DOTTY_STAGING" + cp_arg+="$PSEP$DOTTY_COMP$PSEP$DOTTY_INTF$PSEP$SCALA_ASM$PSEP$DOTTY_STAGING" fi eval exec "\"$JAVACMD\"" "$DEBUG" "-classpath \"$cp_arg\"" "${jvm_options[@]}" "${residual_args[@]}" else diff --git a/project/Build.scala b/project/Build.scala index fb33f286fa02..f9f74e7b4462 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1288,7 +1288,7 @@ object Build { def asDist(implicit mode: Mode): Project = project. enablePlugins(PackPlugin). withCommonSettings. - dependsOn(`dotty-interfaces`, dottyCompiler, dottyLibrary, dottyDoc). + dependsOn(`dotty-interfaces`, dottyCompiler, dottyLibrary, `dotty-staging`, dottyDoc). settings(commonDistSettings). bootstrappedSettings( target := baseDirectory.value / "target" // override setting in commonBootstrappedSettings diff --git a/project/scripts/bootstrapCmdTests b/project/scripts/bootstrapCmdTests index 4f683aedb5c3..af3e6356baa4 100755 --- a/project/scripts/bootstrapCmdTests +++ b/project/scripts/bootstrapCmdTests @@ -23,6 +23,11 @@ clear_out "$OUT" ./bin/dotr -classpath "$OUT" "$MAIN" > "$tmp" test "$EXPECTED_OUTPUT" = "$(cat "$tmp")" +# check that `dotc` and `dotr` works for staging +clear_out "$OUT" +./bin/dotc tests/run-staging/i4044f.scala -d "$OUT" +./bin/dotr -classpath "$OUT" Test > "$tmp" + # check that `dotc -from-tasty` compiles and `dotr` runs it echo "testing ./bin/dotc -from-tasty and dotr -classpath" clear_out "$OUT1" From b945c962c518af4c92be0cba0ce24d4a2a2a0694 Mon Sep 17 00:00:00 2001 From: Liu Fengyun Date: Sat, 31 Aug 2019 15:58:50 +0200 Subject: [PATCH 2/3] Fix CI: make dotty-staging available in dotc and dotd --- dist/bin/dotc | 1 + dist/bin/dotd | 2 +- project/scripts/bootstrapCmdTests | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/bin/dotc b/dist/bin/dotc index b94fbe4ad95d..b442f27a36c5 100755 --- a/dist/bin/dotc +++ b/dist/bin/dotc @@ -61,6 +61,7 @@ classpathArgs () { toolchain+="$SBT_INTF$PSEP" toolchain+="$DOTTY_INTF$PSEP" toolchain+="$DOTTY_COMP$PSEP" + toolchain+="$DOTTY_STAGING$PSEP" # jine toolchain+="$JLINE_READER$PSEP" diff --git a/dist/bin/dotd b/dist/bin/dotd index 2cc6037dc46a..0475e81ad68a 100755 --- a/dist/bin/dotd +++ b/dist/bin/dotd @@ -76,7 +76,7 @@ ST4_LIB=$(find_lib "*ST4*") # Set jsoup dep: JSOUP_LIB=$(find_lib "*jsoup*") -CLASS_PATH="$DOTTY_LIB$PSEP$DOTTY_COMP$PSEP$DOTTY_DOC_LIB$PSEP$DOTTY_INTF$PSEP$SBT_INTF" +CLASS_PATH="$DOTTY_LIB$PSEP$DOTTY_COMP$PSEP$DOTTY_DOC_LIB$PSEP$DOTTY_INTF$PSEP$SBT_INTF$PSEP$DOTTY_STAGING" CLASS_PATH="$CLASS_PATH$PSEP$SCALA_LIB" CLASS_PATH="$CLASS_PATH$PSEP$FLEXMARK_LIBS" CLASS_PATH="$CLASS_PATH$PSEP$JACKSON_LIBS" diff --git a/project/scripts/bootstrapCmdTests b/project/scripts/bootstrapCmdTests index af3e6356baa4..5f7b955cbf14 100755 --- a/project/scripts/bootstrapCmdTests +++ b/project/scripts/bootstrapCmdTests @@ -27,6 +27,7 @@ test "$EXPECTED_OUTPUT" = "$(cat "$tmp")" clear_out "$OUT" ./bin/dotc tests/run-staging/i4044f.scala -d "$OUT" ./bin/dotr -classpath "$OUT" Test > "$tmp" +./bin/dotd -project Staging -siteroot "$OUT" "tests/run-staging/i4044f.scala" # check that `dotc -from-tasty` compiles and `dotr` runs it echo "testing ./bin/dotc -from-tasty and dotr -classpath" From 5c509df764cb9f711c529d1bbeb0578950ab1bb2 Mon Sep 17 00:00:00 2001 From: Liu Fengyun Date: Sat, 31 Aug 2019 17:07:12 +0200 Subject: [PATCH 3/3] Run staging test with -with-compiler --- project/scripts/bootstrapCmdTests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/scripts/bootstrapCmdTests b/project/scripts/bootstrapCmdTests index 5f7b955cbf14..598cedf068e6 100755 --- a/project/scripts/bootstrapCmdTests +++ b/project/scripts/bootstrapCmdTests @@ -26,7 +26,7 @@ test "$EXPECTED_OUTPUT" = "$(cat "$tmp")" # check that `dotc` and `dotr` works for staging clear_out "$OUT" ./bin/dotc tests/run-staging/i4044f.scala -d "$OUT" -./bin/dotr -classpath "$OUT" Test > "$tmp" +./bin/dotr -with-compiler -classpath "$OUT" Test > "$tmp" ./bin/dotd -project Staging -siteroot "$OUT" "tests/run-staging/i4044f.scala" # check that `dotc -from-tasty` compiles and `dotr` runs it