Commit 8e1e229
authored
Wrap the arguments passed to test scalac task between " (#21322)
When running `scalac` in the sbt shell, the following task will invoke
the compiler's main method and forward the arguments as a single string.
If we do the following:
```sh
sbt:scala3> scalac "test.scala" "-Wconf:msg=Given search preference:silent"
```
The compiiler will not correctly parse the provided arguments, resulting
in the following behaviour:
```sh
[info] running (fork) dotty.tools.dotc.Main -d <redacted>/scala3/compiler/../out/default-last-scalac-out.jar -classpath <redacted>/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.14/scala-library-2.13.14.jar:<redacted>/scala3/library/../out/bootstrap/scala3-library-bootstrapped/scala-3.6.0-RC1-bin-SNAPSHOT-nonbootstrapped/scala3-library_3-3.6.0-RC1-bin-SNAPSHOT.jar test.scala -Wconf:msg=Given search preference:silent
source file not found: test.scala
source file not found: search
source file not found: preference:silent
```
This PR fixes the following discribed issue by wrapping each argument
between `"` before calling the compiler's main method.1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
844 | 844 | | |
845 | 845 | | |
846 | 846 | | |
847 | | - | |
| 847 | + | |
| 848 | + | |
848 | 849 | | |
849 | 850 | | |
850 | 851 | | |
| |||
0 commit comments