These are chat archives for sbt/sbt

31st
Aug 2017
jilen
@jilen
Aug 31 01:12
Hi folks, could you give some help about this question
OlegYch
@OlegYch
Aug 31 01:20
are you using some kind of unconventional file system?
Chenai Nakam
@chenakam
Aug 31 02:36
When set name := "wallet", how to get the key-value of this setting?
OlegYch
@OlegYch
Aug 31 02:39
sbt-buildinfo likely
Chenai Nakam
@chenakam
Aug 31 02:42
lazy val root = Project(id = "wallet", base = file(".")), i want to replace the id string by find from name := ... setting.
Maciej Kowalski
@fkowal
Aug 31 06:02
Thanks @bpholt
Ferdinand Svehla
@fsvehla
Aug 31 07:52
SBT takes a long time (3, 4 seconds) to notice source code changes changes — with and without changing pollInterval, how can I start to debug this?
I’ve switched to having the sources watched by Guard and type 'testQuick' into the SBT console with tmux, but that’s not a real solution. I’m on macOS in case there are some OS differences with the new NIO watchers
nafg
@nafg
Aug 31 08:50
@fsvehla have you tried sbt 1.0?
Ferdinand Svehla
@fsvehla
Aug 31 08:50
Yes, I’m on 1.0.1
N.S. Cutler
@godenji
Aug 31 11:05
well, that's disappointing news, was hoping that sbt 1.0 would improve lag times wrt to code change recognition -- same in 0.13.16, pay a 3-4 second "tax" before target command actually kicks off.
OlegYch
@OlegYch
Aug 31 11:30
macos doesn't support that afaik
sbt/io#47
Ferdinand Svehla
@fsvehla
Aug 31 14:44
There was no real difference between 0.13.x and 1.x in that regard for me
N.S. Cutler
@godenji
Aug 31 15:15
somewhere along the line in 0.13.x there was a serious regression in this area -- it's horrendously bad for iterative development.
Rob Norris
@tpolecat
Aug 31 15:16
What platform are you on? It works pretty well for me. Faster than you say.
Also how many source files do you have?
N.S. Cutler
@godenji
Aug 31 15:19
@tpolecat it's more the number of subprojects (25 or so) than file and loc count.
Rob Norris
@tpolecat
Aug 31 15:21
I see. Yeah I try to only ~compile within the subproject where i'm currently working.
N.S. Cutler
@godenji
Aug 31 15:21
fwiw, around 1k files and 32kloc
Alexey Alekhin
@laughedelic
Aug 31 15:21
I notice this just sometimes. Also had it with sbt 0.13.15 (or 16?).
N.S. Cutler
@godenji
Aug 31 15:22
@tpolecat same, but sometimes I have to run application from top-level project
that's where all the pain lies
Alexey Alekhin
@laughedelic
Aug 31 15:22
Just now I had this on a really simple project with one source of 30loc. So I don't think the root cuase is in the size of the project.
Brian P. Holt
@bpholt
Aug 31 15:23
FWIW I’ve noticed this being slow too, using ScalaJS’s ~fastOptJS command on OSX Sierra with ~20 source files (so a very small project) on sbt 1.0.1
OlegYch
@OlegYch
Aug 31 15:23
even a really simple project can be hurt buy cold vm
N.S. Cutler
@godenji
Aug 31 15:24
Scala.js is actually snappy in comparison to Play, the latter being an absolute dog wrt to code change/feedback cycle
@OlegYch sure, but the 3-4 second delay I'm talking about is on an already warm vm (cold, it's a repeatable 25 second delay before anything happens)
OlegYch
@OlegYch
Aug 31 15:25
play recompiles on page refresh
godenji macos?
N.S. Cutler
@godenji
Aug 31 15:26
linux, fedora 25
machine's a beast, 32gb ram, i7 quad, dual ssd, ramdisk compile target: still, sbt defeats it.
OlegYch
@OlegYch
Aug 31 15:27
well see what profiler tells you
N.S. Cutler
@godenji
Aug 31 15:28
debug log tells me everything I need to know
takes 3-4 seconds for sbt to discover that nothing has changed
N.S. Cutler
@godenji
Aug 31 15:29
that's the time it takes to go through sources of each subproject
eugene yokota
@eed3si9n
Aug 31 15:29
@godenji if this is reproducible, could you open issue on sbt/io plz?
maybe we made some mistake implementing the NIO watcher
N.S. Cutler
@godenji
Aug 31 15:30
@eed3si9n sure.
OlegYch
@OlegYch
Aug 31 15:30
that's with 0.13 though, isn't it?
N.S. Cutler
@godenji
Aug 31 15:30
it's ponderously slow
yes, 0.13.16
^ someone above said they're experiencing the same in 1.0
OlegYch
@OlegYch
Aug 31 15:31
'the same' is pretty obscure
try remove any global sbt plugins
or just rm -rf ~/.sbt
N.S. Cutler
@godenji
Aug 31 15:32
:point_up: August 31, 2017 3:52 AM @OlegYch
I've done it all, blew away .ivy, .coursier, .m2, ~/.sbt -- started from scratch, zero difference.
asachdeva
@asachdeva
Aug 31 15:35
We just bumped our sbt to 1.0.1, and noticed the performance lag on sbt interactive shell launch as well. Its discernible. ..but so far the most annoying regressions are in sbt/sbt#3482 and having to clear your /target if you switch to a branch with 0.13.x …I recognize both issues have workarounds but workarounds when compiling branching building are aggravating to the flow.
OlegYch
@OlegYch
Aug 31 15:35
well, see what debugger tells you
*profiler
Brian P. Holt
@bpholt
Aug 31 15:36
@OlegYch is there documentation somewhere on running a profiler on sbt? I haven’t done that before but it would be useful to know how
OlegYch
@OlegYch
Aug 31 15:38
that's kinda specific to the profiler
you could start with jvisualvm and just attach it to running sbt vm
http://prntscr.com/gfg1ru - sbt 0.13.16 on windows ~1 sec for detecting changes on 1k sources
just a couple of modules though
Eric K Richardson
@ekrich
Aug 31 15:47
I'm trying to get rid of target/scala-2.11/classes because it is empty. I tried.
val classpath = fullClasspath.value.map { case p if p.data.exists => p.data }
But I get scala.MatchError: Attributed(/Users/eric/workspace/gc/target/scala-2.11/classes) (of class sbt.Attributed)
Sorry, not empty but not there. Pure test project.
Eric K Richardson
@ekrich
Aug 31 17:27
No worries, I used filter instead. I found that in the build I was working on so I'm now wondering if that is dead code.
Michael Stringer
@stringbean
Aug 31 17:40
is there a gitter channel (or similar) for discussing plugins hosted under the sbt org?
I’ve got a load of changes/fixes I’d like to do to sbt/jacoco4sbt but would like to discuss some of them before I go start
eugene yokota
@eed3si9n
Aug 31 17:45
I don't think there is specific channel, but I do occasionally talk to the plugin authors
when someone is interested in Joachim's plugins, I send him emails, and with his blessings, I add ppl as plugin committer
most recently I've added a committer for sbt-testng
Michael Stringer
@stringbean
Aug 31 17:49
@eed3si9n would you be able to do that for me please?
eugene yokota
@eed3si9n
Aug 31 17:50
sure. jacoco4sbt and anything else?
Michael Stringer
@stringbean
Aug 31 17:50
at the moment I’m just looking at jacoco4sbt, can’t guarantee that I won’t get stuck into others later though!
eugene yokota
@eed3si9n
Aug 31 17:51
what's your email address?
Michael Stringer
@stringbean
Aug 31 17:51
eugene yokota
@eed3si9n
Aug 31 17:51
cool
eugene yokota
@eed3si9n
Aug 31 18:05
@stringbean you should have invites to https://github.com/orgs/sbt/teams/jacoco4sbt-team/members. also added @xuwei-k in there for good measures
nafg
@nafg
Aug 31 18:19
How can I make scalajs-bundler not run webpack simultaneously for multiple projects?
I just did set parallelExecution in ThisBuild := false and it didn't seem to work
eugene yokota
@eed3si9n
Aug 31 18:22
^^ @julienrf
nafg
@nafg
Aug 31 18:23
@eed3si9n assuming the task name for webpacking is X what would the sbt syntax be?
Julien Richard-Foy
@julienrf
Aug 31 18:23
disable aggregation?
nafg
@nafg
Aug 31 18:24
Or should what I wrote work (albeit being a bit of a hammer)
eugene yokota
@eed3si9n
Aug 31 18:25
aggregate in x := false?
nafg
@nafg
Aug 31 18:26
@eed3si9n huh? I need it to run for all subprojects but sequentially
eugene yokota
@eed3si9n
Aug 31 18:26
oh
then you need to tag that stuff
nafg
@nafg
Aug 31 18:26
I think too many webpack processes are being launched at a time running out of machine memory (outside JVM)
eugene yokota
@eed3si9n
Aug 31 18:26
and set concurrent restriction to 1 for the tag
nafg
@nafg
Aug 31 18:27
@eed3si9n I don't mind if nothing runs in parallel
I want to pass something from the command line (e.g. a set command)
eugene yokota
@eed3si9n
Aug 31 18:27
concurrentRestrictions in Global := Seq(Tags.limitAll(1))
that should give you the Maven mode :)
nafg
@nafg
Aug 31 18:28
preferably
eugene yokota
@eed3si9n
Aug 31 18:30
i did that on sbt 1 for clean
that should run one clean at a time
nafg
@nafg
Aug 31 19:15
@eed3si9n thanks, CI passed now!
Rob Norris
@tpolecat
Aug 31 20:45
I asked this before but nobody answered, so I'm doing it again. I have a project that always shows debug output when I do runMain and I have no idea why. Does anyone know the setting that controls this?
> runMain doobie.example.Trace
[info] Compiling 1 Scala source to /Users/rnorris/Scala/doobie/modules/core/target/scala-2.12/classes...
[info] Compiling 1 Scala source to /Users/rnorris/Scala/doobie/modules/example/target/scala-2.12/classes...
background log: info: Running doobie.example.Trace
background log: debug: Waiting for threads to exit or System.exit to be called.
background log: debug: Waiting for thread run-main-1 to terminate.
background log: debug:   Classpath:
        /Users/rnorris/Scala/doobie/modules/example/target/scala-2.12/classes
        /Users/rnorris/Scala/doobie/modules/core/target/scala-2.12/classes
        /Users/rnorris/Scala/doobie/modules/free/target/scala-2.12/classes
        [... rest of the classpath]
[actual program output]
background log: debug:  Thread run-main-1 exited.
background log: debug: Interrupting remaining threads (should be all daemons).
background log: debug: Sandboxed run complete..
background log: debug: Exited with code 0
[success] Total time: 17 s, completed Aug 31, 2017 1:47:02 PM
>
like that
eugene yokota
@eed3si9n
Aug 31 20:50
is that a new behavior that started with sbt 1.0.1? if so could you open an issue for it?
Rob Norris
@tpolecat
Aug 31 20:50
sbt 0.13.16
eugene yokota
@eed3si9n
Aug 31 20:51
or that version
Rob Norris
@tpolecat
Aug 31 20:51
ok
eugene yokota
@eed3si9n
Aug 31 20:55
@tpolecat also do you have BackgroundRunPlugin enabled for your project?
Rob Norris
@tpolecat
Aug 31 20:55
Not that I know of.
I have never heard of it.
eugene yokota
@eed3si9n
Aug 31 20:56
> plugins should show it
Rob Norris
@tpolecat
Aug 31 20:58
Ok, yes. It is enabled.
eugene yokota
@eed3si9n
Aug 31 20:59
that's part of sbt-core-next, which gets injected if you used Typesafe Activator
which I am happy to say it's now EOLed
Rob Norris
@tpolecat
Aug 31 21:00
Hm, I never used activator.
Other than to poke it with a stick.
eugene yokota
@eed3si9n
Aug 31 21:01
then some plugin pulled in sbt-core-next for whatever reason
BackgroundRunPlugin is actually a useful feature that survived into sbt 1 tho
Rob Norris
@tpolecat
Aug 31 21:02
Curious.
eugene yokota
@eed3si9n
Aug 31 21:03
i guess you can comment out your plugins one by one and see which plugin is pulling it in
or if it's one or two subproject call .disablePlugins(BackgroundRunPlugin )
Rob Norris
@tpolecat
Aug 31 21:03
Ok, cool. I will try that.
Rob Norris
@tpolecat
Aug 31 21:09
Cool, it was sbt-pgp
I was using 1.0.1 instead of 1.1.0 … I'll bet that was it.
Mmm nope, upgrading didn't fix it.
Interesting. Should I file a bug with sbt-pgp? Is it something they can fix?
eugene yokota
@eed3si9n
Aug 31 21:12
ah that makes kind of sense because sbt-pgp needs another plugin out of sbt-core-next called InteractionServicePlugin
feel free to file issue on sbt-pgp
Rob Norris
@tpolecat
Aug 31 21:14
Ok, thanks
Is there any downside to doing .disablePlugins(BackgroundRunPlugin) everywhere?
That fixes it for me.
Darcy Shen
@sadhen
Aug 31 21:42
@eed3si9n it is too slow to download plugins from https://dl.bintray.com/sbt/sbt-plugin-releases/ in China
I plan to solve this problem by mirroring https://dl.bintray.com/sbt/sbt-plugin-releases/
I wonder if it is the right way for security and others
eugene yokota
@eed3si9n
Aug 31 21:46
@sadhen part of the problem is the fact that sbt is stupid about network hits. coursier and sbt 1.x parallelizes the artifact download so that might make the situation a bit better
Darcy Shen
@sadhen
Aug 31 21:47
already enjoyed sbt 1.x
eugene yokota
@eed3si9n
Aug 31 21:47
if you want to proxy things, JFrog's Artifactory is pretty good at it
you can set it up either for yourself or in your company
it works mostly transparently
Darcy Shen
@sadhen
Aug 31 21:48
I was a member of maintainers of mirrors.ustc.edu.cn when I was a student
eugene yokota
@eed3si9n
Aug 31 21:50
as long as it works, I don't have a problem from my end
Darcy Shen
@sadhen
Aug 31 21:51
I don't know if it is the "right" thing to mirror it, that's what I am concerning about.
eugene yokota
@eed3si9n
Aug 31 21:51
oh in terms of which repositories?
but we don't want to directly expose Bintray URL since we can change hosting later, so sbt will hit https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/
Darcy Shen
@sadhen
Aug 31 21:56
Some open source projects encourage the mirroring action and they provide an official way to mirror their files
I have no idea of sbt and it's eco
eugene yokota
@eed3si9n
Aug 31 21:57
theoretically that's the service Bintray provides, but it's not free
Darcy Shen
@sadhen
Aug 31 21:58
I don't know if it is encouraged to mirror the community plugins
If it is , I am willing to spend some time writing scripts ...
eugene yokota
@eed3si9n
Aug 31 22:00
I am personally neutral on the topic. if you have a lot of ppl who can get benefit from it, they might thank you
but if it only works 90% of the time, they might complain
Darcy Shen
@sadhen
Aug 31 22:02
I will have a try this weekend, thanks
Darcy Shen
@sadhen
Aug 31 22:07
btw sbt 1.0.0 is awesome
eugene yokota
@eed3si9n
Aug 31 22:07
good to hear