These are chat archives for sbt/sbt

26th
Apr 2017
Alessandro Vermeulen
@spockz
Apr 26 04:17
Is there a way I can get more output from the sbt resolving and downloading of plugins and dependencies than just 'resolving X' and 'download[ing|ed] dep X'? Setting log level to debug gives me a lot more info but not on resolving
Jeffrey Olchovy
@jeffreyolchovy
Apr 26 08:27
@eed3si9n @adelbertc regarding sbt-doge and sbt-release, I think the README isn't wrong now, but it's a little jumbled (I didn't contribute it in the first place, but I think whoever did based it on the changeset that I added to sbt-release). For example, it did and currently still mentions "Here is an example that substitues the regular test and publish steps with their cross build equivalents (the CrossPerProjectPlugin is also required". If you had that plugin enabled, I think you're release process would have succeeded in the first place. However, now that the example is using the so <command> variants, that entire sentence is unnecessary. This is obviously not a huge deal, but it doesn't really read well to me (as someone who uses this type of setup and the collaboration of these plugins in multiple projects).
Oscar Batori
@oscarbatori
Apr 26 14:56
What's the best place to follow sbt's current state?
Currently sbt being on 2.10 is a problem for me, and I see a 1.0 milestone, but not quite sure the best place to follow progress, as it would be nice to plan our work loosely around when that will become available.
Paulo "JCranky" Siqueira
@jcranky
Apr 26 14:58
might be this is a dumb question, but is it possible to run sbt new with a local template? I wanted to test a template before pushing it to github
other then installing g8 locally ...
Dale Wijnand
@dwijnand
Apr 26 14:59
@oscarbatori https://twitter.com/scala_sbt is probably one of the best ways to stay up to date
woah
Paulo "JCranky" Siqueira
@jcranky
Apr 26 15:00
oO
Oscar Batori
@oscarbatori
Apr 26 15:01
@dwijnand amazingly I was already following you, but not scala_sbt, :expressionless:
scala.meta + sbt seems like the promised land...
Thanks!
Dale Wijnand
@dwijnand
Apr 26 15:03
np
Paulo "JCranky" Siqueira
@jcranky
Apr 26 15:06
ah ha!
worked, thanks!
Dale Wijnand
@dwijnand
Apr 26 15:10
np
Alessandro Vermeulen
@spockz
Apr 26 15:34
I defined a commandAlias in my root build.sbt file. Now I want to use this command for a specific sub-module but sbt tells me that submodule/myAlias isn’t a valid key. Any ideas on how to fix this?
OlegYch
@OlegYch
Apr 26 15:50
commands are build-wide
Alessandro Vermeulen
@spockz
Apr 26 16:13
it does work if I do sbt ;project submodule; myAlias
So at least I got what I wanted, thanks @OlegYch
andy scott
@andyscott
Apr 26 17:46
How can I add a new configuration with source in src/foo/scala and its own run task? I don’t want it to depend on the output of src/main/scala, but I do want it to share the same set of dependencies.
Kaushik Chakraborty
@kaychaks
Apr 26 17:49

I’m having a weird issue with sbt-assembly if anyone could help

When trying to create fat jar to deploy to Spark with shading applied to shapeless libraries, I am seeing some classes not being renamed when ran in an Ubuntu machine while everything gets renamed fine when the sbt assembly is ran in Mac.

Here’s the shading config

assemblyShadeRules in assembly := Seq(
  ShadeRule.rename("shapeless.**" -> "shadedshapeless.@1")
    .inLibrary("com.chuusai" % "shapeless_2.11" % "2.3.2")
    .inLibrary("com.github.pureconfig" % "pureconfig_2.11" % "0.7.0")
    .inProject)

When ran in Mac, these classes are renamed for pattern shapeless/Generic*

Renamed shapeless/Generic$.class -> shadedshapeless/Generic$.class
Renamed shapeless/Generic.class -> shadedshapeless/Generic.class
Renamed shapeless/Generic1$.class -> shadedshapeless/Generic1$.class
Renamed shapeless/Generic1$class.class -> shadedshapeless/Generic1$class.class
Renamed shapeless/Generic1.class -> shadedshapeless/Generic1.class
Renamed shapeless/Generic10$class.class -> shadedshapeless/Generic10$class.class
Renamed shapeless/Generic10.class -> shadedshapeless/Generic10.class
Renamed shapeless/Generic1Macros$$anonfun$1.class -> shadedshapeless/Generic1Macros$$anonfun$1.class
Renamed shapeless/Generic1Macros$$anonfun$2.class -> shadedshapeless/Generic1Macros$$anonfun$2.class
Renamed shapeless/Generic1Macros.class -> shadedshapeless/Generic1Macros.class
Renamed shapeless/GenericMacros$$anonfun$23.class -> shadedshapeless/GenericMacros$$anonfun$23.class
Renamed shapeless/GenericMacros.class -> shadedshapeless/GenericMacros.class

but when ran in Ubuntu, for the pattern shapless/Generic* only these things are renamed

Renamed shapeless/GenericMacros$$anonfun$23.class -> shadedshapeless/GenericMacros$$anonfun$23.class
Renamed shapeless/Generic1Macros$$anonfun$1.class -> shadedshapeless/Generic1Macros$$anonfun$1.class
Renamed shapeless/Generic1$.class -> shadedshapeless/Generic1$.class
Renamed shapeless/Generic1.class -> shadedshapeless/Generic1.class

I chose the pattern shapeless/Generic* coz when am providing the fat jar (produced in Ubuntu) to spark-submit then am getting the error right away (probably coming from pureconfig)

Exception in thread "main" java.lang.NoClassDefFoundError: shadedshapeless/Generic

No error occurs when fat jar produced in Mac is being fed to spark-submit

Anthony Garo
@agaro1121
Apr 26 18:51
Hi everyone, what’s the easiest way to extract the value from an SBT Settings Key ?
Brian Topping
@briantopping
Apr 26 19:31
@agaro1121 If you are in a macro context, such as the rhs of :=, +=, ++=, or Def.task, just use .value
Anthony Garo
@agaro1121
Apr 26 19:32
thank you @briantopping I’ve tried those. Is there no way to do it outside of a macro context?
Brian Topping
@briantopping
Apr 26 19:32
nope
Anthony Garo
@agaro1121
Apr 26 19:32
thank you
Brian Topping
@briantopping
Apr 26 19:32
:thumbsup:
@agaro1121 I think of the macro context as the mechanics to solve the transitive closure of dynamic dependencies. If you don't have that context, there's no static way for the runtime to give you a value
Anthony Garo
@agaro1121
Apr 26 19:35
makes sense. Thank you for the quick response
David Knapp
@Falmarri
Apr 26 19:36
when cross building, is there a way to choose a dependency based on the scala version being compiled? not just the _2.11 version, but an actual artifact version. eg: for 2.11 i want to use "com.github.tototoshi" %% "slick-joda-mapper" % "2.3.0-custom" but for 2.12 i want to use "com.github.tototoshi" %% "slick-joda-mapper" % "2.3.0"
Shane Delmore
@ShaneDelmore
Apr 26 19:36
I have a weird issue where I add an sbt-plugin (that creates a synthetic subproject) it breaks root commands that are meant to run across projects in my multi-project build. When I run sbt test it runs 0 test suites, and when I run sbt it:compile it says > it:compile
[error] No such setting/task
[error] it:compile
[error]
Is this a known issue? Should I file a bug or are there steps I should take to troubleshoot further first?
Shane Delmore
@ShaneDelmore
Apr 26 19:38
Even adding the plugin without enabling it causes the breakage. The specific plugin is https://github.com/ShaneDelmore/imclipitly
David Knapp
@Falmarri
Apr 26 19:38
@briantopping possibly, thanks. let me play with that a little
Shane Delmore
@ShaneDelmore
Apr 26 20:25
I bet this is because I am not manually aggregating in my root project, because manually aggregating means if someone adds a new project and forgets to add it to aggregate then they end up not running tests in ci.
Brian Topping
@briantopping
Apr 26 20:30
sounds like you are getting pretty close to the thing working
charlesrgould
@charlesrgould
Apr 26 20:31
I'm using sbt-scapegoat with sbt-native-packager
When I make a package it includes scalac-scapegoat-plugin.jar in the artifact lib folder
How can I prevent this?
Brian Topping
@briantopping
Apr 26 20:33
are you declaring scapegoat in your project dependencies or plugins.sbt?
Assuming the latter...
Toby Thain
@toby5box
Apr 26 22:03
@eed3si9n between .13 and .15, something changed in the .deb, and I can no longer install sbt vs openjdk-8-jdk-headless
eugene yokota
@eed3si9n
Apr 26 22:04
@toby5box there's a discussion around this here - sbt/sbt#3105
Toby Thain
@toby5box
Apr 26 22:04
Selecting previously unselected package sbt.
(Reading database ... 9859 files and directories currently installed.)
Preparing to unpack sbt-0.13.15.deb ...
Unpacking sbt (0.13.15) ...
dpkg: dependency problems prevent configuration of sbt:
 sbt depends on openjdk-8-jdk; however:
  Package openjdk-8-jdk is not installed.

dpkg: error processing package sbt (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 sbt
The command '/bin/sh -c dpkg -i sbt-0.13.15.deb' returned a non-zero code: 1
ah.
thanks
eugene yokota
@eed3si9n
Apr 26 22:05
basically Ubuntu thought it would be a good idea to change the semantics of "java6-runtime-headless" to mean JDK 9
so we said, "you know what, i'll depend on openjdk8"
Toby Thain
@toby5box
Apr 26 22:06
which would almost work for me, but i'm using openjdk-8-jdk-headless
eugene yokota
@eed3si9n
Apr 26 22:06
now older Ubuntu is broken, and if we remove all requirements Debian is going to flog us
is there a compatibility matrix of openjdk8 vs different Ubuntu/Debian distros?
Toby Thain
@toby5box
Apr 26 22:19
That I do not know. But it seems that a proper "virtual package" is not implemented in Debian
eugene yokota
@eed3si9n
Apr 26 22:19
I blame the word "devel"
Toby Thain
@toby5box
Apr 26 22:20
which is disappointing, because JRE is kind of like the trivial example of a runtime dependency.
eugene yokota
@eed3si9n
Apr 26 22:20
somewhere along the line devel turned into cutting edge thing instead of development
Brian Topping
@briantopping
Apr 26 22:43

Hi all, can some kind soul explain the use of identityMap here?

    packagedArtifact in(Compile, packageBin) += (artifact in(Compile, packageBin), OsgiKeys.bundle).identityMap

OsgiKeys.bundle is a TaskKey[File] and I'd like to replace it with a Initialize[Task[File]] (ie from a taskDyn, but identityMap isn't defined for it and I can't even figure out what it does. I'm guessing it has something to do with taking a tuple and (mumble) to (mumble)...

eugene yokota
@eed3si9n
Apr 26 22:46
I think it basically means identity in Scala sense
sbt uses map method on tuple to mean something that's not an actual Functor law map
Brian Topping
@briantopping
Apr 26 22:48
yes that's exactly the method it's calling
eugene yokota
@eed3si9n
Apr 26 22:49
so " taking a tuple and (mumble) to (mumble)" is right i think
Brian Topping
@briantopping
Apr 26 22:50
lol. have to admit the last 48 hours have been gratifying that i'm not the only one that's lost on these problems, ty