Skip to content

Commit 0d7b645

Browse files
committed
don't load scala version from java properties
1 parent 573b083 commit 0d7b645

File tree

5 files changed

+22
-46
lines changed

5 files changed

+22
-46
lines changed

compiler/src/dotty/tools/dotc/Run.scala

+1-3
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
307307
else doTypeCheck()
308308
)
309309

310-
inContext(unitCtx) {
311-
process()
312-
}
310+
process()(using unitCtx)
313311
}
314312

315313
private sealed trait PrintedTree

project/scripts/bootstrapCmdTests

+14-3
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,22 @@ clear_out "$OUT"
8484
echo "Bug12973().check" | TERM=dumb ./bin/scala -cp "$OUT/out.jar" > "$tmp" 2>&1
8585
grep -qe "Bug12973 is fixed" "$tmp"
8686

87+
echo "capturing scala version from dist/target/pack/VERSION"
88+
cwd=$(pwd)
89+
IFS=':=' read -ra versionProps < "$cwd/dist/target/pack/VERSION" # temporarily set IFS to ':=' to split versionProps
90+
[ ${#versionProps[@]} -eq 3 ] && \
91+
[ ${versionProps[0]} = "version" ] && \
92+
[ -n ${versionProps[2]} ] || die "Expected non-empty 'version' property in $cwd/dist/target/pack/VERSION"
93+
scala_version=${versionProps[2]}
94+
8795
echo "testing -sourcepath with inlining"
96+
# Here we will test that an inline method symbol loaded from the sourcepath (-sourcepath compiler option)
97+
# will have its `defTree` correctly set when its method body is required for inlining.
98+
# So far I have not found a way to replicate issue https://github.com/lampepfl/dotty/issues/13994
99+
# with sbt scripted tests, if a way is found, move this test there.
88100
cwd=$(pwd)
89-
java_prop="-Dpack.version.file=$cwd/dist/target/pack/VERSION"
90-
sbt_test_command=";clean;prepareSources;compile;copyChanges;compile"
91-
(cd "$cwd/tests/cmdTest-sbt-tests/sourcepath-with-inline" && "$SBT" "$java_prop" "$sbt_test_command")
101+
sbt_test_command="++${scala_version}!;clean;prepareSources;compile;copyChanges;compile"
102+
(cd "$cwd/tests/cmdTest-sbt-tests/sourcepath-with-inline" && "$SBT" "$sbt_test_command")
92103
rm -rf "$cwd/tests/cmdTest-sbt-tests/sourcepath-with-inline/target"
93104
rm -rf "$cwd/tests/cmdTest-sbt-tests/sourcepath-with-inline/project/target"
94105
rm -f "$cwd/tests/cmdTest-sbt-tests/sourcepath-with-inline/src/main/scala/a/zz.scala"

project/scripts/cmdTestsCommon.inc.sh

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ OUT=$(mktemp -d)
1414
OUT1=$(mktemp -d)
1515
tmp=$(mktemp)
1616

17+
die () {
18+
echo >&2 "$@"
19+
exit 1
20+
}
21+
1722
clear_out()
1823
{
1924
local out="$1"

project/scripts/sbt

+2-13
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,12 @@
22
set -e
33

44
# Usage:
5-
# ./sbt <props*> <cmd>
5+
# ./sbt <cmd>
66

7-
declare -a sys_props
8-
declare -a sbt_commands
9-
10-
while [[ $# -gt 0 ]]; do
11-
case "$1" in
12-
-D*) sys_props+=("$1") && shift ;;
13-
*) sbt_commands+=("$1") && shift ;;
14-
esac
15-
done
16-
17-
CMD="${sbt_commands[0]:?Missing sbt command}"
7+
CMD="${1:?Missing sbt command}"
188

199
# run sbt with the supplied arg
2010
sbt -J-XX:ReservedCodeCacheSize=512m \
2111
-DSBT_PGP_USE_GPG=false \
22-
"${sys_props[@]}" \
2312
-no-colors \
2413
"$CMD"

tests/cmdTest-sbt-tests/sourcepath-with-inline/project/DottyInjectedPlugin.scala

-27
This file was deleted.

0 commit comments

Comments
 (0)