These are chat archives for sbt/sbt

20th
Jan 2016
chris vale
@crispywalrus
Jan 20 2016 00:32
This message was deleted
Stefan Larsson
@lastsys
Jan 20 2016 12:04
Is there any way to limit the number of worker threads in sbt?
Heather Miller
@heathermiller
Jan 20 2016 16:05
Basic sbt question... I have a multi-project build. When sbt starts, I want one of my specific sub-projects to be the default project that sbt starts up with
Josh Suereth
@jsuereth
Jan 20 2016 16:06
@heathermiller open ticket, we never implemented/fixed it :)
Heather Miller
@heathermiller
Jan 20 2016 16:06
oh wow, (a) that was quick, and (b) i thought that i must've been doing something wrong
Josh Suereth
@jsuereth
Jan 20 2016 16:06
nope
Perry
@pfn
Jan 20 2016 16:06
an onLoad is the only way to do it
Josh Suereth
@jsuereth
Jan 20 2016 16:06
you can do it, it's just ugly
Heather Miller
@heathermiller
Jan 20 2016 16:06
ok, i'll open a ticket, sure thing.
Josh Suereth
@jsuereth
Jan 20 2016 16:06
i think there IS a ticket already
I tried to fix it once
forget why it was so tricksy
InTheNow
@InTheNow
Jan 20 2016 16:07
renaming coreJVM to your project
Heather Miller
@heathermiller
Jan 20 2016 16:08
ah ok, thanks @InTheNow! i'm just a little confused what this is?
AHA
InTheNow
@InTheNow
Jan 20 2016 16:09
got it?
Heather Miller
@heathermiller
Jan 20 2016 16:09
ok, sorry. i see now .sbtrc is stuff that runs on startup
Perry
@pfn
Jan 20 2016 16:09
@heathermiller, onLoad in Global := (onLoad in Global).value andThen (Command.process("project mobile", _))
Heather Miller
@heathermiller
Jan 20 2016 16:09
(never knew)
Perry
@pfn
Jan 20 2016 16:10
in your case, project coreJVM
Heather Miller
@heathermiller
Jan 20 2016 16:10
ok gotcha
InTheNow
@InTheNow
Jan 20 2016 16:10
We added it that way so it is not the default
Heather Miller
@heathermiller
Jan 20 2016 16:10
awesome, thanks guys!
InTheNow
@InTheNow
Jan 20 2016 16:10
np
Perry
@pfn
Jan 20 2016 16:11
using an sbtrc like that sucks if you work on more than just one project
use onLoad instead
InTheNow
@InTheNow
Jan 20 2016 16:12
erm, seems to work for some folks
pfn @pfn has a shitton of projects he actively works on via sbt
Perry
@pfn
Jan 20 2016 16:12
setting up sbtrc like that would suck
onLoad is better
Heather Miller
@heathermiller
Jan 20 2016 16:13
yeah i was going to try the onLoad trick first
seems like it might work.
Dale Wijnand
@dwijnand
Jan 20 2016 16:14
:+1: for onLoad. Keeps it visible, verbosity aside
Perry
@pfn
Jan 20 2016 16:14
just throw it into a mysetup.sbt
you could write a helper that makes it less verbose
InTheNow
@InTheNow
Jan 20 2016 16:14
how do you set the project name per sbt?
Perry
@pfn
Jan 20 2016 16:15
throw it in ~/.sbt/0.13/plugins/loadhelper.scala
InTheNow
@InTheNow
Jan 20 2016 16:16
as in for project "cats" i want the default project to be "coreJVM" but "core" in shapeless
Perry
@pfn
Jan 20 2016 16:16
package sbt; object x { def defaultProject(s: String) = onLoad in Global := onLoad in Global.value andThen...
then just toss that into your local.sbt as defaultProject("coreJVM")
er, x.defaultProject
Dale Wijnand
@dwijnand
Jan 20 2016 16:17
.. and submit an improvement to sbt :p
Perry
@pfn
Jan 20 2016 16:18
I assume scala files in plugins/ get compiled and thrown into the project classpath as I would expect
for spending the vast majority of my hobby time working with sbt, I never contribute :-/
unfortunate side effect of using onLoad is it's noisy, it gets called once per project
you'd need to set some state so that it only occurs once
but that is only cosmetic
Heather Miller
@heathermiller
Jan 20 2016 16:22
:+1: thanks @pfn and @InTheNow. onLoad works perfectly
InTheNow
@InTheNow
Jan 20 2016 16:23
:+1:
Simon Schäfer
@sschaef
Jan 20 2016 18:41
I have to run a sbt build on Java 6 but I get a OOM because there is not enough PermGen space. I tried to run it as SBT_OPTS="-Xms512m -Xmx2G -Xss1M -XX:MaxPermSize=512M" sbt compile but I still receive the same error.
Any other ideas on how to fix it?
Sam Halliday
@fommil
Jan 20 2016 18:55
@sschaef that sets the perm gen for SBT itself, is your application causing the exception?
Oh, is the compile. Hmm. Have you tried sbt-extras and .sbtopts just to be sure? Or, increase the memory OR (weird) clean everything and do it again
We see stack overflows when compiling ensime without enough stack, it requires a clean before proceeding. I never got to the bottom of why.
Simon Schäfer
@sschaef
Jan 20 2016 18:57
I don't want to touch any global sbt config files. This needs to work preferable through a shell script
I tried a clean but it didn't help
Sam Halliday
@fommil
Jan 20 2016 18:59
.sbtopts is project specific. Can you confirm that your flags are being used?
htop or jvisualvm
Simon Schäfer
@sschaef
Jan 20 2016 19:07
Neither .sbtopts or .jvmopts seem to have an effect
How do I see with htop if the flags are used?
Sam Halliday
@fommil
Jan 20 2016 19:08
You're right, it's .jvmopts sorry
maybe ps is easier: ps -ef | grep java
Simon Schäfer
@sschaef
Jan 20 2016 19:09
That tells me
antoras 12642 12641 99 20:08 pts/6 00:00:11 java -Xmx1G -jar /home/antoras/.conscript/sbt-launch.jar @/home/antoras/.conscript/sbt/sbt/sbt/launchconfig compile
Does that mean the params are not used?
Sam Halliday
@fommil
Jan 20 2016 19:10
Yup!
Simon Schäfer
@sschaef
Jan 20 2016 19:10
Oh man indeed, my sbt is aliased to that conscript thing
completely forgot about that
Sam Halliday
@fommil
Jan 20 2016 19:11
I have no idea what that is. sbt-extras or bust
Simon Schäfer
@sschaef
Jan 20 2016 19:12
I can't remember either
;)
Sam Halliday
@fommil
Jan 20 2016 19:12
You've been conned
Simon Schäfer
@sschaef
Jan 20 2016 19:13
Seems to be dead
Without it everything works fine
I kill it
Simon Schäfer
@sschaef
Jan 20 2016 23:30
I could need your help once again: I need to add a sbt plugin only in case a condition is true. Something like
if (condTask.value)
  addSbtPlugin("a" % "b" % "c")
Any ideas on how to solve this problem
I thought of creating a task and then to set the task on sbt startup, something like sbt 'set condTask := true' compile
but maybe there exists a simpler solution
Perry
@pfn
Jan 20 2016 23:35
@sschaef, `if (cond) List(addSbtPlugin...) else Nil
Simon Schäfer
@sschaef
Jan 20 2016 23:39
cond actually needs to be a task I think. At least I wouldn't know how to set it from cmd otherwise
Perry
@pfn
Jan 20 2016 23:40
be specific about what you're trying to accomplish
Simon Schäfer
@sschaef
Jan 20 2016 23:41
Well, I would like to add a sbt plugin only in case a shell variable is set
I wouldn't know how to read shell variables from within of sbt
therefore my thought to go through an indirection of a task
which is only set to true in case the shell variable is set
Perry
@pfn
Jan 20 2016 23:48
sys.env
! sys.env("HOME")
oops,no multibot here
Simon Schäfer
@sschaef
Jan 20 2016 23:50
That seems to be cool
Simon Schäfer
@sschaef
Jan 20 2016 23:56
That works. Thanks!