These are chat archives for sbt/sbt

7th
Jul 2015
Grant Henke
@granthenke
Jul 07 2015 01:13
Is there an easy way to do case insensitive string literal parsing with sbt.complete.Parsers?
Josh Suereth
@jsuereth
Jul 07 2015 12:37
probably DefaultParsers.ID map (_.toLowerCase(locale))
don't remember what we called the string literal parser
Grant Henke
@granthenke
Jul 07 2015 13:23
@jsuereth doesn’t the map occur after the match? I think that would just make the result lowercase
There is likely a better way to write this, but the best I came up with was to create a charClass for each letter and then reduce that into a string:
def equalsIgnoreCase(a: Char, b: Char) = a.toLower == b.toLower
val ignoreCaseParser = {
      str.toSeq.map{ c => charClass(equalsIgnoreCase(_, c)).map(_.toString) } // Match Chars and convert to String parser
        .reduce { (p1, p2) => (p1 ~ p2).map(_.productIterator.mkString) } // Reduce into a single String
    }
Jean Helou
@jeantil
Jul 07 2015 14:41
is there a ticket open for the pergen/metaspace leaks in sbt ?
Capture d’écran 2015-07-07 à 16.40.23.png
after a session of ~test
I get a large number of sbt.classpath.ClasspathUtilities retained in memory which seem to hold most of the class references
looks like I have one for each "test" run
eugene yokota
@eed3si9n
Jul 07 2015 14:44
@jeantil which version of sbt are you using?
sbt 0.13.9-RC1 contains a fix related to permgen leak
Jean Helou
@jeantil
Jul 07 2015 14:45
0.13.8
I'll try it right away
sbt/sbt#1223
Jean Helou
@jeantil
Jul 07 2015 14:45
thanks a lot
Jean Helou
@jeantil
Jul 07 2015 14:52
it is indeed much better !
thanks a lot
eugene yokota
@eed3si9n
Jul 07 2015 15:03
awesome. thanks for confirming the fix prior to the release
nafg
@nafg
Jul 07 2015 17:09
Where do you output managed sources to get them compiled?
Josh Suereth
@jsuereth
Jul 07 2015 17:28
it's up to the source generator
It could be anywhere, but we recommend using sourceManaged in Compile key
nafg
@nafg
Jul 07 2015 17:40
@jsuereth thanks
Does intellij use sbt-server?
it keeps fighting with command line sbt when i update the build
Josh Suereth
@jsuereth
Jul 07 2015 17:42
@notxcain Yes
@notxcain You can do soething like Key := Key.?.value.getOrElse(ifNotDefinedAvalue)
@nafg There's a prototype that does, but the sbt command line does NOT use server yet
nafg
@nafg
Jul 07 2015 17:44
A prototype of command line or of intellij?
Josh Suereth
@jsuereth
Jul 07 2015 17:44
both
but the intellij on sbt-server is far more developed than the command line :)
nafg
@nafg
Jul 07 2015 17:45
well i'm looking forward :)
what remains to be done?
Josh Suereth
@jsuereth
Jul 07 2015 17:47
ironically, the incremental compiler
it's our interface into the scala REPL
and we need to make that friendly for sbt-server
which means we need the incremental compiler to expose REPL interface we can use form server, which means we need scala-version-dependent interface sources
Martin Duhem is working on that now
nafg
@nafg
Jul 07 2015 17:54
@jsuereth seems source generators run on every compile, is there a way to avoid that?
never mind
My slick codegen'd models take 5 minutes to compile
nafg
@nafg
Jul 07 2015 18:00
what does the REPL have to do with incremental compiler?
Josh Suereth
@jsuereth
Jul 07 2015 18:01
@nafg GREAT QUESTION. Sbt uses the incremental compiler to invoke the REPL. i.e. when you run "console" or "consoleQuick" the interface we use to do so exists in the incremental compiler
It's literally the interface to ALL of scala tools, not just scalac (so scaladoc, REPL, scalac, etc.)
nafg
@nafg
Jul 07 2015 18:04
wow compile took 309 secs, doc 288
Simeon H.K. Fitch
@metasim
Jul 07 2015 18:04
@nafg Curious: did it load all the cores?
nafg
@nafg
Jul 07 2015 18:05
didn't check :(
why do you ask
Simeon H.K. Fitch
@metasim
Jul 07 2015 18:06
Curious as to whether SBT is parallelizing everything correctly and it's just a CPU bound problme, or if it's an I/O bound issue.
Or something isn't getting parallelized properly because of some singular dependency.
If it's loading all the cores, then it's just a scalac thing.
nafg
@nafg
Jul 07 2015 18:09
@metasim SBT can't parallelize a single scalac invocation
If you have multiple subprojects sbt can compile them in parallel
I assume it's CPU
Simeon H.K. Fitch
@metasim
Jul 07 2015 18:10
D'oh. Good point.
nafg
@nafg
Jul 07 2015 18:10
It can't know the dependency graph within a (sub)project without compiling it
@jsuereth I'm publishing to S3 using "com.frugalmechanic" % "fm-sbt-s3-resolver", should I use maven style or ivy layout?
nafg
@nafg
Jul 07 2015 19:03
anyone?
Starting a new repo, should I use maven or ivy layout?
Dale Wijnand
@dwijnand
Jul 07 2015 19:31
is it a plugin?
I think for plugins you need to use Ivy, for anything else I've stuck with Maven, as the lowest-level lingua franca
nafg
@nafg
Jul 07 2015 19:40
@dwijnand no, just company-internal artifacts
Josh Suereth
@jsuereth
Jul 07 2015 19:50
yeah, stick with maven if you need to work with maven. The translation between ivy-maven is lossy
nafg
@nafg
Jul 07 2015 20:33
I don't foresee needing to work with maven