These are chat archives for sbt/sbt

20th
Jun 2017
Krishna Padmasola
@kpadmasola
Jun 20 02:39

Hi, I am trying to run some gatling simulations via sbt, but I am getting this error:

[error] Uncaught exception when running tests: java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)Lscala/collection/mutable/ArrayOps;
sbt.ForkMain$ForkError: java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)Lscala/collection/mutable/ArrayOps;
        at io.gatling.sbt.GatlingRunner.tasks(GatlingRunner.scala:30)
        at sbt.ForkMain$Run.runTests(ForkMain.java:253)
        at sbt.ForkMain$Run.run(ForkMain.java:139)
        at sbt.ForkMain.main(ForkMain.java:121)

any pointers on how to resolve this error ?

Thomas Sutton
@thsutton
Jun 20 02:48
Maybe you have a plugin and an SBT build that were built against different versions of Scala?
Krishna Padmasola
@kpadmasola
Jun 20 02:57

@thsutton I am using these plugins:

> plugins                                                                
In file:/E:/perf/                                     
        sbt.plugins.IvyPlugin: enabled in perf                           
        sbt.plugins.JvmPlugin: enabled in perf                           
        sbt.plugins.CorePlugin: enabled in perf                          
        sbt.plugins.JUnitXmlReportPlugin: enabled in perf                
        sbt.plugins.Giter8TemplatePlugin: enabled in perf                
        com.typesafe.sbteclipse.plugin.EclipsePlugin: enabled in perf    
        coursier.CoursierPlugin: enabled in perf                         
        io.gatling.sbt.GatlingPlugin: enabled in perf

in build.sbt I have scalaVersion := "2.12.2"
how do I find out which plugin is incompatible with this version of scala ?

Krishna Padmasola
@kpadmasola
Jun 20 03:10
@thsutton figured it out by looking at https://github.com/gatling/gatling-sbt-plugin-demo/blob/master/build.sbt. I changed scalaVersion := "2.11.8" in my build.sbt and the error is gone. Thanks!
Sukant Hajra
@shajra
Jun 20 03:22
Is the "requires" field of an AutoPlugin used at all if the "trigger" is set to "noTrigger"? I think I understand how it's used when the trigger is set to "allRequirements".
Thomas Sutton
@thsutton
Jun 20 03:23
@kpadmasola No worries. It's a rare question in here that I can try to help with. :-)
eugene yokota
@eed3si9n
Jun 20 07:15
@shajra without requires your plugin will load at quasi random order potentially before all the sbt default settings
Sukant Hajra
@shajra
Jun 20 13:29
This message was deleted
Han van Venrooij
@irundaia
Jun 20 14:49

Hi guys,

I've got an issue where I package a native lib in a jar along with my sbt plugin. When the user of the plugin has a different version on his machine, there is the possibility for linking issues when the library is loaded with Native.loadLibrary.
Do you know of a way to force loading the library from the jar?

soronpo
@soronpo
Jun 20 14:59
How do I remove options of scalacOptions by pattern matching?
Dale Wijnand
@dwijnand
Jun 20 15:10
Such as?
soronpo
@soronpo
Jun 20 15:12
I have
... "-Xplugin:/home/soronpo/.ivy2/cache/org.scalamacros/paradise_2.12.2/jars/paradise_2.12.2-2.1.0.jar", ... "-Xplugin:/home/soronpo/.ivy2/cache/org.scalameta/paradise_2.12.2/jars/paradise_2.12.2-3.0.0-M9.jar" ... and want to just remove .*paradise.*
Dale Wijnand
@dwijnand
Jun 20 15:29
scalacOptions ~= { opts => ... }
soronpo
@soronpo
Jun 20 15:32
What does ~= do? I cannot find documentations for it
Dale Wijnand
@dwijnand
Jun 20 15:34
modifies the value of the key
Hmm, wow, we really don't have ~= in the docs
soronpo
@soronpo
Jun 20 15:44
@dwijnand I'm sorry, but I still don't follow. How does this allow me to remove the specific settings?
Here is my setting. I want to remove the entries which have paradise in their value.
[info] * -deprecation
[info] * -encoding
[info] * UTF-8
[info] * -feature
[info] * -language:existentials
[info] * -language:experimental.macros
[info] * -language:higherKinds
[info] * -language:implicitConversions
[info] * -unchecked
[info] * -Xfatal-warnings
[info] * -Xfuture
[info] * -Xlint:-unused,_
[info] * -Yliteral-types
[info] * -Yno-adapted-args
[info] * -Ywarn-numeric-widen
[info] * -Xplugin-require:macroparadise
[info] * -Xplugin:/home/soronpo/.ivy2/cache/org.scalamacros/paradise_2.12.2/jars/paradise_2.12.2-2.1.0.jar
[info] * -Xplugin:/home/soronpo/.ivy2/cache/org.scalameta/paradise_2.12.2/jars/paradise_2.12.2-3.0.0-M9.jar
Dale Wijnand
@dwijnand
Jun 20 16:08
Sorry, @soronpo, got distracted. scalacOptions ~= (_ filterNot (_ contains "paradise"))
Though really I think you should fix the upstream issue of having different paradise plugins in your build
soronpo
@soronpo
Jun 20 16:09
@dwijnand It's a workaround, since meta isn't currently working in REPL. So actually I'll be doing scalacOptions in (Compile, console) ~= (_ filterNot (_ contains "paradise")).
Dale Wijnand
@dwijnand
Jun 20 16:10
gotcha
soronpo
@soronpo
Jun 20 16:11
??
missing parameter type for expanded function ((x$1) => x$1.filterNot(((x$2) => x$2.contains("paradise"))))
scalacOptions in (Compile, console) ~= (_ filterNot (_ contains "paradise"))
^
Dale Wijnand
@dwijnand
Jun 20 16:11
scalameta/paradise#10 ?
soronpo
@soronpo
Jun 20 16:11
scalameta/paradise#10 ?
yes
Dale Wijnand
@dwijnand
Jun 20 16:12
That message is confusing
worked in my mini repro
soronpo
@soronpo
Jun 20 16:13
OK, my bad. Forgot a comma somewhere .
Yes! Works like a charm. Many thanks.
Dale Wijnand
@dwijnand
Jun 20 16:14
cool
Sukant Hajra
@shajra
Jun 20 16:42
@eed3si9n question about sbt-doge. Would enabling it with an AutoPlugin on all projects (not just an aggregate root) be a bad idea?
Sorry, I mean CrossCompilePerProjectPlugin.
Jose C
@jmcardon
Jun 20 17:32
Hey guys, is sbt-onejar the preferred way of packaging?
Adelbert Chang
@adelbertc
Jun 20 18:23
@jmcardon i think sbt-onejar is no longer maintained is it? sbt-assembly seems to be the way to go. also less classloader voodoo
Sukant Hajra
@shajra
Jun 20 18:56
I just looked at the sbt-coursier project. Maybe I'm a bit dense, but which problem does it solve that people find most useful? Resolutions taking a while?
Sam Halliday
@fommil
Jun 20 20:10
is there an option that when a macro is changed, all downstream code is marked dirty?
it's really hard to find it given that most google for "sbt macro incremental compiler" give completely the wrong thing
Jorge
@jvican
Jun 20 22:11
yes, there's a way.
and it's been proven to work well. i would like to try to merge it in the future inside Zinc (in a minor release, after sbt 1.0) @fommil
have a look at Martin Duhem's thesis on incremental macro compilation https://infoscience.epfl.ch/record/204855/files/MacrosInSbtProblemSolved.pdf
Thomas Sutton
@thsutton
Jun 20 22:43
@shajra Being faster and not having the ridiculous Ivy lock are the two reasons that leap to mind. I've found the concurrent downloading is especially pleasing when I'm stuck behind particularly obnoxious corporate proxies with rate limiting, etc.
Sukant Hajra
@shajra
Jun 20 22:44
I see... I'm not having incredible problems with this right now, but I'll keep it in mind.