From 3daa5b0c4ae7b8d480cefd1d6fccd44f39582455 Mon Sep 17 00:00:00 2001 From: jvican Date: Fri, 16 Feb 2018 11:28:28 +0100 Subject: [PATCH] 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 scala/compiler-benchmark#58. --- .../scala/tools/benchmark/BenchmarkDriver.scala | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/compilation/src/main/scalac/scala/tools/benchmark/BenchmarkDriver.scala b/compilation/src/main/scalac/scala/tools/benchmark/BenchmarkDriver.scala index d585bb5..403bf77 100644 --- a/compilation/src/main/scalac/scala/tools/benchmark/BenchmarkDriver.scala +++ b/compilation/src/main/scalac/scala/tools/benchmark/BenchmarkDriver.scala @@ -23,14 +23,17 @@ trait BenchmarkDriver extends BaseBenchmarkDriver { override protected def processSettingsHook(): Boolean = { - if (source == "scala") - settings.sourcepath.value = Paths.get(s"../corpus/$source/$corpusVersion/library").toAbsolutePath.normalize.toString - else - settings.classpath.value = findScalaJars + if (!source.startsWith("@")) { + // Don't set the classpath manually if it's to be loaded by the `@` processor + if (source == "scala") + settings.sourcepath.value = Paths.get(s"../corpus/$source/$corpusVersion/library").toAbsolutePath.normalize.toString + else settings.classpath.value = findScalaJars + if (depsClasspath != null && depsClasspath.nonEmpty) + settings.processArgumentString(s"-cp $depsClasspath") + } + settings.outdir.value = tempDir.getAbsolutePath settings.nowarn.value = true - if (depsClasspath != null) - settings.processArgumentString(s"-cp $depsClasspath") true } }