Skip to content

Commit 3daa5b0

Browse files
committed
Don't set the classpath if source starts with @
Because it means that it will be that all compiler arguments will be expanded by the compiler, and setting the classpath in the benchmark driver makes the empty classpath have precedence over the one in the compiler args file. Fixes #58.
1 parent 0666a94 commit 3daa5b0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

compilation/src/main/scalac/scala/tools/benchmark/BenchmarkDriver.scala

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ trait BenchmarkDriver extends BaseBenchmarkDriver {
2323

2424

2525
override protected def processSettingsHook(): Boolean = {
26-
if (source == "scala")
27-
settings.sourcepath.value = Paths.get(s"../corpus/$source/$corpusVersion/library").toAbsolutePath.normalize.toString
28-
else
29-
settings.classpath.value = findScalaJars
26+
if (!source.startsWith("@")) {
27+
// Don't set the classpath manually if it's to be loaded by the `@` processor
28+
if (source == "scala")
29+
settings.sourcepath.value = Paths.get(s"../corpus/$source/$corpusVersion/library").toAbsolutePath.normalize.toString
30+
else settings.classpath.value = findScalaJars
31+
if (depsClasspath != null && depsClasspath.nonEmpty)
32+
settings.processArgumentString(s"-cp $depsClasspath")
33+
}
34+
3035
settings.outdir.value = tempDir.getAbsolutePath
3136
settings.nowarn.value = true
32-
if (depsClasspath != null)
33-
settings.processArgumentString(s"-cp $depsClasspath")
3437
true
3538
}
3639
}

0 commit comments

Comments
 (0)