Skip to content

usejavacp leaks a lot of dependency into the benchmarked project #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dragos opened this issue Nov 29, 2017 · 5 comments
Closed

usejavacp leaks a lot of dependency into the benchmarked project #46

dragos opened this issue Nov 29, 2017 · 5 comments

Comments

@dragos
Copy link
Contributor

dragos commented Nov 29, 2017

I noticed this while trying to benchmark akka-actors, and the version of Typesafe Config used by Akka is newer than what infrastructure depends on, so compilation fails. It seems dangerous to include so many dependencies in every benchmark.

Is there a good reason to set settings.usejavacp.value = true? (I guess there must be, since it's explicitly added).

[info] * Attributed(/Users/dragos/workspace/triplequote/compiler-benchmark/infrastructure/target/classes)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.11.11.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.11.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.11.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.5.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.4.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/pl.project13.scala/sbt-jmh-extras/jars/sbt-jmh-extras-0.2.25.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.openjdk.jmh/jmh-core/jars/jmh-core-1.19.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/net.sf.jopt-simple/jopt-simple/jars/jopt-simple-4.6.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.apache.commons/commons-math3/jars/commons-math3-3.2.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.openjdk.jmh/jmh-generator-bytecode/jars/jmh-generator-bytecode-1.19.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.openjdk.jmh/jmh-generator-reflection/jars/jmh-generator-reflection-1.19.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.openjdk.jmh/jmh-generator-asm/jars/jmh-generator-asm-1.19.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.ow2.asm/asm/jars/asm-5.0.3.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.influxdb/influxdb-java/jars/influxdb-java-2.5.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/com.google.guava/guava/bundles/guava-21.0.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/com.squareup.retrofit2/retrofit/jars/retrofit-2.1.0.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/com.squareup.okhttp3/okhttp/jars/okhttp-3.5.0.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/com.squareup.okio/okio/jars/okio-1.11.0.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/com.squareup.retrofit2/converter-moshi/jars/converter-moshi-2.1.0.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/com.squareup.moshi/moshi/jars/moshi-1.2.0.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/com.squareup.okhttp3/logging-interceptor/jars/logging-interceptor-3.5.0.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.eclipse.jgit/org.eclipse.jgit/jars/org.eclipse.jgit-4.6.0.201612231935-r.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/com.jcraft/jsch/jars/jsch-0.1.53.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/com.googlecode.javaewah/JavaEWAH/bundles/JavaEWAH-1.1.6.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.apache.httpcomponents/httpclient/jars/httpclient-4.3.6.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.apache.httpcomponents/httpcore/jars/httpcore-4.3.3.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/commons-logging/commons-logging/jars/commons-logging-1.1.3.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/commons-codec/commons-codec/jars/commons-codec-1.6.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.7.24.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.apache.commons/commons-lang3/jars/commons-lang3-3.5.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/com.typesafe/config/bundles/config-1.3.2.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/org.slf4j/log4j-over-slf4j/jars/log4j-over-slf4j-1.7.24.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/ch.qos.logback/logback-classic/jars/logback-classic-1.2.1.jar)
[info] * Attributed(/Users/dragos/.ivy2/cache/ch.qos.logback/logback-core/jars/logback-core-1.2.1.jar)
@retronym
Copy link
Member

Of those, we should only need scala-library.jar. We could either A) modify the SBT build to find that within the fullClasspath, pass it in a as dedicated a system property, and add just that to the classpath or B) parse System.property("java.class.path") for entries matching **/scala-library*.jar/

@retronym
Copy link
Member

retronym commented Dec 1, 2017

I've gone for option A.The scalap benchmark assumes the reflect and compiler are available, so I've included them too.

@jvican
Copy link
Member

jvican commented Feb 16, 2018

@retronym Would you accept a PR adding xml to the classpath? It's necessary to compile some projects in the community, and may prove useful to others.

@retronym
Copy link
Member

I'd expect that to work by adding it as a dependency, as we do for scala-asm in the scala corpus.

⚡ pwd; cat deps.txt
/code/compiler-benchmark/corpus/scala/latest
http://repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/5.1.0-scala-2/scala-asm-5.1.0-scala-2.jar

@jvican
Copy link
Member

jvican commented Feb 16, 2018

See https://github.com/scala/compiler-benchmark/pull/60/files for an unrelated fix that solves this issue too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants