These are chat archives for sbt/sbt

15th
Mar 2017
Amar Sood
@tekacs
Mar 15 11:20
Could anyone possibly help me with this issue, at all? kxbmap/sbt-jooq#1
I've tried to be detailed in the issue and the plugin itself is tiny, so I think it's more of a question about SBT
That is, I'm using dependsOn(otherProject % "jooq"), where dependencies used by that plugin go in the jooq scope (like libraryDependencies += "s" % "th" % "v" % "jooq")
does that sound immediately wrong to anyone?
Elijah Rippeth
@erip
Mar 15 12:15
Ahoy all. Quick question. I have a project with some homegrown dependencies. I can easily add these to my project by simply publishing them to ivy with sbt publish-local.
In my CI pipeline (gitlab CI), I'm finding that when I try to publish my dependencies after testing them, it doesn't try to publish them to ${home}/.ivy2/ but instead it attempts to publish them to the temp build directory. Has anyone run into this before?
Here are the interesting relevant logs:
Wrote /home/gitlab-runner/builds/$buildNum/0/${gitlabGroup}/${repoName}/target/scala-2.11/${repoName}_2.11.pom
...
java.io.FileNotFoundException: /home/gitlab-runner/.ivy2/local/${org}/${repoName}_2.11/0.2.0/poms/${repoName}_2.11.pom (No such file or directory)
Rafal Wachol
@charafau
Mar 15 13:53
hm.. local plugin uri's dont work when coursier plugin is enabled..
Jan
@fride
Mar 15 15:42
Hi there. I just tried to create a new project via 'sbt new http4s/http4s.g8' but the giter8 resolver insists on using http to checkout the template. Can I tell it to please use https? I couldn't anything in the docs.
Christian Kaps
@akkie
Mar 15 15:42

I've a strange issue and no idea how it can be solved. I've a multi project setup and a SBT plugin which can handle NPM commands. If I try to compile the code, I get a

java.io.FileNotFoundException: C:\Users\akkie\Projects\modeler\modeler-pmm\target\scala-2.11\classes.bak\sbt8086637868006707521.class (Permission denied)

It seems that the issue comes from this line in my SBT plugin:

compile in Npm := inc.Analysis.Empty,
compile in Npm := (compile in Npm).dependsOn(npmCompileTask).value,

The complete plugin can be found in the following gist: https://gist.github.com/akkie/f18823f592694717c61cd870b625cf66

I try to hook into the compile task so that my JavaScript code gets also compiled with the rest of my sources. Before I've converted the project into a multi project, the exception also occurred, but only sporadically. And now after the conversion, the code doesn't compile because the error occurred constantly.

This is the code of my build definition:

import com.typesafe.sbt.packager.archetypes.systemloader.SystemdPlugin
import com.typesafe.sbt.packager.debian.{ DebianPlugin, JDebPackaging }
import play.sbt.{ PlayLayoutPlugin, PlayScala }
import sbt.Keys._
import sbt._

val modelerTest: Project = Project(
  id = "modeler-test",
  base = file("modeler-test")
).enablePlugins(PlayScala).disablePlugins(PlayLayoutPlugin)

val modelerCore: Project = Project(
  id = "modeler-core",
  base = file("modeler-core"),
  dependencies = Seq(modelerTest % Test)
).enablePlugins(PlayScala).disablePlugins(PlayLayoutPlugin)

val modelerAuth: Project = Project(
  id = "modeler-auth",
  base = file("modeler-auth"),
  dependencies = Seq(modelerCore, modelerTest % Test)
).enablePlugins(PlayScala).disablePlugins(PlayLayoutPlugin)

val modelerPmm: Project = Project(
  id = "modeler-pmm",
  base = file("modeler-pmm"),
  dependencies = Seq(modelerCore, modelerTest % Test)
).enablePlugins(PlayScala).disablePlugins(PlayLayoutPlugin)

val root: Project = Project(
  id = "modeler",
  base = file("."),
  aggregate = Seq(
    modelerTest,
    modelerCore,
    modelerAuth,
    modelerPmm
  ),
  dependencies = Seq(
    modelerAuth,
    modelerPmm
  ),
  settings =
    Defaults.coreDefaultSettings ++
    NpmSettings.settings ++
    PackageSettings.settings ++
    Seq(
      publish := {}
    )
).enablePlugins(
  PlayScala,
  NpmPlugin,
  DebianPlugin,
  JDebPackaging,
  SystemdPlugin
).disablePlugins(PlayLayoutPlugin)

Does anyone has an idea what could cause this issue? Any help would be really appreciated!

Rafal Wachol
@charafau
Mar 15 15:49
@fride I think you can specify url there
no, you cant... it used to work in giter8 plugin I think
Jan
@fride
Mar 15 15:50
@charafau tried that too. But then I tells me it cant find the template.
The code looks like one could ;)
Rafal Wachol
@charafau
Mar 15 15:50
I just looked at sources haha
Jan
@fride
Mar 15 15:51
Dito.
Rafal Wachol
@charafau
Mar 15 15:52
guess some sbt guy needs to answer you
I'm just a guy
Jan
@fride
Mar 15 15:58
me too. It's not that urgent anyway.
Dale Wijnand
@dwijnand
Mar 15 16:37
Hey sbt guys are just guys too! :) Try sbt 0.13.14-RC1, we tweaked some of these details in part of the giter8 integration. Maybe related to https, so try, if you can.
Rafal Wachol
@charafau
Mar 15 16:46
nice. I just need to write scaffold fetcher plugin and I will scaffold all apps :D
how does giter8 handle git repositiores ? sbt includes jgit ?
Dale Wijnand
@dwijnand
Mar 15 16:51
Giter8 does, yes.
Rafal Wachol
@charafau
Mar 15 16:52
thanks
Dale Wijnand
@dwijnand
Mar 15 16:52
nw
Jan
@fride
Mar 15 18:07
@dwijnand works now. Thanks!
Dale Wijnand
@dwijnand
Mar 15 19:47
Cool. I did none of the work apart from review the PR and inform you. :^)
SimonCigoj
@SimonCigoj
Mar 15 20:46
@dwunsch tnx for the info ... actualy both the ~run and run are both slow when needs to reload, for example recompiling one file takes at least 2 seconds, with the run command it compiles on http reload and restarts the app and also takes about 3-4 seconds ... I have an sdd and an I7 cpu on windows ... I don't know, I'm actually new to scala an sbt but it seems the compile is quite slow ...
Perry
@pfn
Mar 15 20:47
compiling can be slow depending on how complex the source is
SimonCigoj
@SimonCigoj
Mar 15 20:49
@pfn the source is for example a simple scala template file in play app ... it compiles around 2 sec at least
pfn @pfn shrugs
Perry
@pfn
Mar 15 20:49
play templates are slow to compile, my guess
SimonCigoj
@SimonCigoj
Mar 15 20:53
@pfn ok let mi try now a scala file ....
[info] Compiling 1 Scala source to C:\repos\scala\SocerGladiatorWeb\target\scala-2.11\classes...
[success] Compiled in 9s
@pfn it was a simple controller of 40 lines ... took 9 sec to compile is that normal?
Perry
@pfn
Mar 15 20:55
dunno, I don't use play
Dale Wijnand
@dwijnand
Mar 15 21:19
It's the compiler. It takes time to warm up.
Clean and compile and I'll be faster this time.
Provided you're using sbt 0.13.13+
SimonCigoj
@SimonCigoj
Mar 15 21:22
@dwijnand i'm usinf sbt 0.13.13
@dwijnand what is a normal compile time in your experiance?
Perry
@pfn
Mar 15 21:31
depends on complexity of source, you'll have to ask someone that compiles play templates regularly
SimonCigoj
@SimonCigoj
Mar 15 21:33
@pfn also scala files that are not to complex takes 3s ....
Perry
@pfn
Mar 15 21:33
get more ram
SimonCigoj
@SimonCigoj
Mar 15 21:35
@pfn what is your experience in compile time? ... I have plenty of ram
Perry
@pfn
Mar 15 21:35
depending on complexity of source, anything from 0-multiple seconds
given a warmed up VM
ritschwumm
@ritschwumm
Mar 15 22:35
@SimonCigoj you do keep sbt running, right? and gave it enough heap?
Ichoran
@Ichoran
Mar 15 22:38

Is there a way to get my root project's tests to depend on another project's compile which depends on my root project's compile?

lazy val root: Project = (project in ".").dependsOn(examples % "test")
lazy val examples: Project = (project in "examples").dependsOn(root)

gives a stack overflow.

That it does isn't terribly surprising, but it does thwart the most obvious way to do it.
Perry
@pfn
Mar 15 22:50
what's a good way to detect that color (terminal codes) are available from within sbt?
how does it detect whether to turn on/off color?
I know @jastice kinda found this earlier
@ichoran make the compile/test tasks depend directly, rather than making the project depend
unless your goal is to depend on the output... in that case, yuck
I remember what'shisname complaining about this kind of circular dependency (that isn't really circular because of configurations) was it @lihaoyi
Ichoran
@Ichoran
Mar 15 22:59
Ah, okay, thanks @pfn that is where I forgot that I needed to look. Just need to figure out how to assemble it all
Perry
@pfn
Mar 15 22:59
@jastice so ConsoleAppender.formatEnabled -- that's great, thanks
ugh, ConsoleAppender isn't public...
was hoping I could just use that directly....
Justin Kaeser
@jastice
Mar 15 23:03
it isn’t?
Perry
@pfn
Mar 15 23:04
I don't think it is, doesn't show up when I go to class in intellij
Justin Kaeser
@jastice
Mar 15 23:05
from where?
Perry
@pfn
Mar 15 23:05
I just go-to-class from an sbt plugin project
ah, it's sbt.ConsoleLogger in 0.13
Justin Kaeser
@jastice
Mar 15 23:08
ah right