These are chat archives for sbt/sbt

17th
Sep 2015
smartnut007
@smartnut007
Sep 17 2015 00:07
sbt nube alert. I am getting a "sbt.ResolveException: unresolved dependency: com.nimbusds#nimbus-jose-jwt;[4.0,]: not found" while I try to "activator run" on this project https://github.com/pac4j/play-pac4j-scala-demo
Any ideas ?
I tried things like deleting ~/.ivy2/com.nimbusds directory.
I also added "Atlassian Releases" at "https://maven.atlassian.com/public/" to the top of the sbt resolvers list
But, no avail
Any pointers ?
Li Haoyi
@lihaoyi
Sep 17 2015 02:08
Is there a way to pass through java options to sbt assembly so that they apply when you run the resultant "script"?
I don't see anything https://github.com/sbt/sbt-assembly but maybe i'm missing something
i want to make the script have a max memory
Seth Tisue
@SethTisue
Sep 17 2015 02:20
@lihaoyi scriptedLaunchOpts?
Li Haoyi
@lihaoyi
Sep 17 2015 02:20
@SethTisue I don't see that string anywhere in that readme
where did it come from?
Seth Tisue
@SethTisue
Sep 17 2015 02:22
I found it with git grep Xmx in the sbt-assembly repo
Li Haoyi
@lihaoyi
Sep 17 2015 02:22
oh ok
lemme try that
thanks!
eugene yokota
@eed3si9n
Sep 17 2015 02:23
Seth Tisue
@SethTisue
Sep 17 2015 02:23
it seems to be a feature of the scripted plugin
Li Haoyi
@lihaoyi
Sep 17 2015 02:23
isn
t scripted different from assembly though?
eugene yokota
@eed3si9n
Sep 17 2015 02:24
yea. they are completely different things
Seth Tisue
@SethTisue
Sep 17 2015 02:24
Ima let Eugene talk, he actually knows something and isn’t just randomly grepping
Li Haoyi
@lihaoyi
Sep 17 2015 02:24
This seems to work
    assemblyOption in assembly := (assemblyOption in assembly).value.copy(
      prependShellScript = Some(
        Seq("#!/usr/bin/env sh", """exec java -jar -Xmx512M "$0" "$@"""")
      )
    )
kinda hacky but maybe it'll do for now
eugene yokota
@eed3si9n
Sep 17 2015 02:25
oh you're talking about completely different kind of script
@SethTisue and I thought you're talking about "scripted" plugin
Li Haoyi
@lihaoyi
Sep 17 2015 02:26
oh
yeah i'm referring to the weird "binary" bash script that sbt assembly spits out :P
eugene yokota
@eed3si9n
Sep 17 2015 02:26
that shebang prepending is a total hack
it's like a bar trick of JVM, but I accepted the pull request since someone sent it to me
Li Haoyi
@lihaoyi
Sep 17 2015 02:27
it's awesome
:D :D :D
Seth Tisue
@SethTisue
Sep 17 2015 02:29
ah, sbt/sbt-assembly#102
rejected ;-)
Li Haoyi
@lihaoyi
Sep 17 2015 02:30
burnnnn
Seth Tisue
@SethTisue
Sep 17 2015 02:30
ah, the original is sbt/sbt-assembly#97
it would be nice if this were documented a little more explicitly, but I’m not volunteering
Li Haoyi
@lihaoyi
Sep 17 2015 02:35
i wish it was possible to up the GC memory bounds while the program is running
Li Haoyi
@lihaoyi
Sep 17 2015 02:42
omg
the G1 garbage collector is amazing
ok problem solved
thanks all =)
eugene yokota
@eed3si9n
Sep 17 2015 02:43
np
Matthew de Detrich
@mdedetrich
Sep 17 2015 03:05
Does anyone any idea if "rubygems-proxy" at "http://rubygems-proxy.torquebox.org/releases” works fine with SBT as a resolver?
It was working fine at one point, and then we moved to another build server (so starting with empty ivy cache), and now its just FAILED, with no reason whatsoever
i.e. getting
[warn] ==== rubygems-proxy: tried
[warn]   http://rubygems-proxy.torquebox.org/releases/rubygems/nokogiri/1.6.6.2/nokogiri-1.6.6.2.gem
[warn]     [FAILED     ] rubygems#htmlentities;4.3.3!htmlentities.gem:  (0ms)
even though curl/wget works fine (on the file directly)
Matthew de Detrich
@mdedetrich
Sep 17 2015 03:10
Im going to try with SBT 0.13.8 or 0.13.7, may have been a regression
Matthew de Detrich
@mdedetrich
Sep 17 2015 03:17
Using last command doesn’t show anything extra either
Matthew de Detrich
@mdedetrich
Sep 17 2015 04:53
This is the repo that is being mentioned (note that mvn resolves these dependencies perfectly fine)
Matthew de Detrich
@mdedetrich
Sep 17 2015 05:19
Made an issue about it here sbt/sbt#2209
Matthew de Detrich
@mdedetrich
Sep 17 2015 05:57
@eed3si9n I am also online, so I can help here if it helps resolve #2209 faster
Its actually blocking us quite a bit at work because its freezing the entire build system
eugene yokota
@eed3si9n
Sep 17 2015 06:21
@mdedetrich I am going to Scala World starting tomorrow, so this won't be high on the priority. if you need urgent support, contact Typesafe
also could you add a reproducible build file to the case? you might get better chance at getting the attention, so we don't have to spend time trying to come up with one
Matthew de Detrich
@mdedetrich
Sep 17 2015 06:24

@eed3si9n Sure thing, will do. I am getting somewhere, if I change the http to https and do -Djsse.enableSNIExtension=false, I get a Server access Error: java.security.cert.CertificateException: No subject alternative DNS name matching rubygems-proxy.torquebox.org found.

Not sure if that means anything though

eugene yokota
@eed3si9n
Sep 17 2015 06:25
aha
so my cert theory is starting to hold some water
Matthew de Detrich
@mdedetrich
Sep 17 2015 06:27
I am going to gist a build.sbt that replicates the problem
eugene yokota
@eed3si9n
Sep 17 2015 06:28
sounds good
Matthew de Detrich
@mdedetrich
Sep 17 2015 06:29
Its a really trivial one, you don’t actually need any source files since the problem happens at resolution, https://gist.github.com/mdedetrich/ea95947c9b8e35a4d849
Have also updated the issue with the build.sbt gist, if you change http://rubygems-proxy.torquebox.org/releases to https://rubygems-proxy.torquebox.org/releases and use the -Djsse.enableSNIExtension=false, you get the problem I mentioned above
eugene yokota
@eed3si9n
Sep 17 2015 06:34
I get a completely different error
Matthew de Detrich
@mdedetrich
Sep 17 2015 06:36
I also get Server access Error: handshake alert: unrecognized_name url=https://rubygems-proxy.torquebox.org/releases/rubygems/css_parser/1.3.6/css_parser-1.3.6.gem If I change it to https but without the -Djsse.enableSNIExtension=false flag. What error are you getting?
eugene yokota
@eed3si9n
Sep 17 2015 06:36
yea that handshake thing
Matthew de Detrich
@mdedetrich
Sep 17 2015 06:38
I am making an issue on their end to see if they can help out, it might actually be a cert issue
eugene yokota
@eed3si9n
Sep 17 2015 06:38
[warn]  [NOT FOUND  ] rubygems#premailer;1.8.4!premailer.gem (0ms)
if it's http
Matthew de Detrich
@mdedetrich
Sep 17 2015 06:41
Yeah, thing is wget http://rubygems-proxy.torquebox.org/releases/rubygems/premailer/1.8.4/premailer-1.8.4.gem works
eugene yokota
@eed3si9n
Sep 17 2015 06:42
Ivy does try to do HEAD and other weird things to optimize the download
Matthew de Detrich
@mdedetrich
Sep 17 2015 06:43
It might be a cert issue, but its a really weird one. It causes a redirect to https://rubygems.global.ssl.fastly.net/gems/premailer-1.8.4.gem, which also works fine with curl/wget (and is a https). Actually I think it being a cert issue is a red herring. The HTTP is redirecting to a HTTPS link, I think it may be more to do with how Ivy is resolving stuff
eugene yokota
@eed3si9n
Sep 17 2015 06:44
but you said it worked before?
Matthew de Detrich
@mdedetrich
Sep 17 2015 06:45
Yes, its not working now because I have cleared the ivy cache, so maybe something on the server changed?
eugene yokota
@eed3si9n
Sep 17 2015 06:46
not sure
Matthew de Detrich
@mdedetrich
Sep 17 2015 06:46
@eed3si9n Ah, I think its this
Apparently ivy doesn’t follow redirects, is it possible to force SBT to use maven to resolve the repo, instead of ivy?
eugene yokota
@eed3si9n
Sep 17 2015 06:47
all sbt bits are hosted on Bintray, and we use redirect
repo.scala-sbt.org etc
Matthew de Detrich
@mdedetrich
Sep 17 2015 06:51
I activated debug mode in update to see if its giving more info
Yeah nothing, like it only says [warn] [FAILED ] rubygems#addressable;2.3.8!addressable.gem: (0ms), and it doesn’t give any reason as to why it failed
eugene yokota
@eed3si9n
Sep 17 2015 06:54
if you want the good stuff you need:
ivyLoggingLevel := UpdateLogging.Full
Matthew de Detrich
@mdedetrich
Sep 17 2015 06:55
Awesome thanks
eugene yokota
@eed3si9n
Sep 17 2015 06:55
that and > debug combined
Matthew de Detrich
@mdedetrich
Sep 17 2015 06:59
Still just get [warn] [FAILED ] rubygems#addressable;2.3.8!addressable.gem: (0ms), this is weird
All of the ivy info stuff is coming out, but its just stuck at FAILED for some reason
I dont think its a network error, because if you check the ivyLoggingLevel, it does resolve stuff from the rubygems torque repo, but its just failing for some reason
eugene yokota
@eed3si9n
Sep 17 2015 07:06
another potential source of the side effect may be http://search.maven.org/#search%7Cga%7C1%7Crubygems
Matthew de Detrich
@mdedetrich
Sep 17 2015 07:07
I think I am missing something, what could the side effect be?
eugene yokota
@eed3si9n
Sep 17 2015 07:08
I've heard of a situation in which a repository claims to have something, but it doesn't and causing issues esp at download phase
so i was wondering if those handful of rubygems published to Maven Central could leading your other gems astray
not really likely, since you do see it trying the correct repo I guess
Matthew de Detrich
@mdedetrich
Sep 17 2015 07:10
Yeah it is trying to get the actual correct repo
Is that FAILED coming from Ivy or from SBT?
What version of Ivy does SBT use (so I can mention it in the other github issue, may help us out)
eugene yokota
@eed3si9n
Sep 17 2015 07:12
a fork of 2.3.x
the FAIL is likely coming from Ivy
it's getting late, so I am going to bed soon. gluck
Matthew de Detrich
@mdedetrich
Sep 17 2015 07:17
Cheers, thanks for the help
Matthew de Detrich
@mdedetrich
Sep 17 2015 07:35
@eed3si9n Another issue was made at sbt/ivy#19, since its very likely its an issue with the forked ivy
Richard Gomes
@frgomes
Sep 17 2015 09:41
Could someone clarify why evictedJars in the link below does not list anything, please?
http://pastebin.com/qr46E7uH
Tobias Roeser
@lefou
Sep 17 2015 13:29
Hi. What do I need to setup to use an external zinc server process for compilation?
Richard Gomes
@frgomes
Sep 17 2015 14:53
Things evolved a lot, but I still don't see any evicted modules. Can anyone clarify what I'm doing wrong? Thanks a lot. The code is here: http://pastebin.com/wb0XHGjV
Dale Wijnand
@dwijnand
Sep 17 2015 15:30
@lefou don't even know if that's possible, why do you want to?
Perry
@pfn
Sep 17 2015 16:48
wtf, this is weird
val rel = project.in(file(".")).settings(androidBuild).settings(
  resolvers += Resolver.jcenterRepo,
  scalaVersion := "2.11.7",
  libraryDependencies ++= Seq(
    "org.macroid" %% "macroid" % "2.0.0-M4",
    "com.hanhuy.android" %% "scala-common" % "1.0",
    "ch.acra" % "acra" % "4.6.2",
    "com.android.support" % "support-v4" % "22.2.0",
    "com.android.support" % "recyclerview-v7" % "22.2.0",
    "com.android.support" % "appcompat-v7" % "22.2.0"
  ),
  proguardCache in Android += "macroid",
  javacOptions in Compile ++= Seq("-source", "1.7", "-target", "1.7")
)

val dev = flavorOf(rel, "dev").settings(
  dexShards in Android := true,
  dexMulti in Android := true,
  minSdkVersion in Android := "21"
)
for some reason, 'rel' doesn't show up in 'projects'
Richard Gomes
@frgomes
Sep 17 2015 17:00
@pfn: I usually make all modules lazy val and the root project (which is also lazy val) is just an aggregation of all modules.
Perry
@pfn
Sep 17 2015 17:05
this is in build.sbt, not .scala however
hmm, maybe it doesn't like file(".")
I have other projects that do it on a project in a subdirectory, and it's perfectly happy
Perry
@pfn
Sep 17 2015 17:12
yeah, it doesn't like doing what I want when it's on the root project
Dale Wijnand
@dwijnand
Sep 17 2015 17:30
I've done project in file(".") lots of times, must be something else
Perry
@pfn
Sep 17 2015 17:31
no, that's not the problem
the problem is that 2 projects in file(".")
build.sbt coalesces them into 1
build.scala doesn't
(use of reflectutils vs. base)
Dale Wijnand
@dwijnand
Sep 17 2015 17:31
ah right, yeah that's going to create problems
Perry
@pfn
Sep 17 2015 17:32
it's ok, I'll just define these projects in scala
and note that this is the behavior in my api
Dale Wijnand
@dwijnand
Sep 17 2015 17:33
when you say 2 projects in file(".") do you mean in two different build.sbt files?
Perry
@pfn
Sep 17 2015 17:33
no, 2 projects in .
Dale Wijnand
@dwijnand
Sep 17 2015 17:34
how does that even work in .scala?
Perry
@pfn
Sep 17 2015 17:35
object B extends Build { lazy val root1 = project.in(file(".")); lazy val root2 = project.in(file("."))
}
because of reflectutils, they're created as 2 different projects
hmm, interestingly, though, the coalescing doesn't occur on subproject names
Dale Wijnand
@dwijnand
Sep 17 2015 17:36
never seen that before
why is it you're doing that?
Perry
@pfn
Sep 17 2015 17:38
same project, different settings
code snippet I pasted earlier illustrates that
a 'release' configuration that generates a release artifact, and a 'dev' configuration that has dev-only settings
Dale Wijnand
@dwijnand
Sep 17 2015 17:40
I see now
Perry
@pfn
Sep 17 2015 17:46
I can't come up with a better solution in the framework of sbt
extending configurations is not useful
Dale Wijnand
@dwijnand
Sep 17 2015 18:03
what task(s) require different settings?
Richard Gomes
@frgomes
Sep 17 2015 18:08
@pfn : do you need to share code between two or more configurations? For example: you could compile a number of sources and generate code for the JVM but also generate Javascript (from Scala sources).
Perry
@pfn
Sep 17 2015 18:08
no
Richard Gomes
@frgomes
Sep 17 2015 18:12
@pfn : I think that multiple configurations is what you need. But I'm not fully skilled on that. I had problems before with one configuration which needed exportJars := false and another which needed exportJars := true. On the other hand, I have multiple configurations for some simple things, like running the same modules with distinct main classes.
Perry
@pfn
Sep 17 2015 18:13
nope, multiple configurations isn't what I need
that is most definitely impossible
Dale Wijnand
@dwijnand
Sep 17 2015 18:14
What task(s) require different settings? Just to understand the problem domain more
Seth Tisue
@SethTisue
Sep 17 2015 18:17
why are configurations not the right thing here? seems like a textbook case for that, from what you’ve told us so far, unless I’m missing something
Tobias Roeser
@lefou
Sep 17 2015 18:26
@dwijnand Because I have already a zinc server running and it is faster to reuse it instead of a cold start of sbt.
I currently work also on a greater Maven based Scala project, and the scala-maven-plugin is able to pick up the zinc server if running instead of starting the own compiler.
So, a reuse makes much sense to me, speed and memory wise.
Dale Wijnand
@dwijnand
Sep 17 2015 18:28
Yeah, that's why zinc is great for Maven, but for sbt, just keep sbt warm
Tobias Roeser
@lefou
Sep 17 2015 18:28
I thought, it must be easy, but looks like it is not. :(
Dale Wijnand
@dwijnand
Sep 17 2015 18:29
zinc is parts of sbt made available for maven (and other possible clients)
but fwiw what you say does make sense, which is what future sbt-server intends to do for sbt users, IntelliJ users, ensime etc. I'm actually not sure if it's also for mvn
@SethTisue good question
Tobias Roeser
@lefou
Sep 17 2015 18:33
Question is: Can we use an external zinc server from within sbt?
Perry
@pfn
Sep 17 2015 18:38
the problem domain is android build flavors
the problem with configurations is that a build of an android app involves multiple configurations already
so in order to add a build flavor via configuration, one would need to copy N configs (android, compile and test)
that sounds like an absolutely terrible approach
not to mention, each config should refer to the other config properly...
Dale Wijnand
@dwijnand
Sep 17 2015 18:43
@lefou AFAIK no
what's are Android build flavors? sorry, I really don't know
@pfn
Perry
@pfn
Sep 17 2015 18:45
a single code base that may have additional build setting sets (that may specify additional code directories, resources, package naming, etc)
Tobias Roeser
@lefou
Sep 17 2015 18:48
@dwijnand Thanks. Too bad.
Dale Wijnand
@dwijnand
Sep 17 2015 18:55
@pfn I genuinely curious, for what?
Perry
@pfn
Sep 17 2015 18:56
a single code base may be released as multiple products, or for different environments, or for development vs. release, or any product combination thereof
e.g. on one of my older client projects for a cable network, 1 single code-based was used to release 3 different applications, one for each of their channels
e.g. Disney could have a single code base that produced individual apps for DisneyChannel, ABC, and ABC Family
Dale Wijnand
@dwijnand
Sep 17 2015 19:00
Why aren't some of those solved with multiple projects, with dependencies and aggregation, and the Android equivalent of uber-jaring the sources into the seperate apps
ala DisneyWhitelable project dependee of DisneyChannel, ABC, etc
might be relevant, but one thing I've seen somewhat similar to what you're talking about, but for other reasons is @paulp's setup https://github.com/paulp/psp-std/blob/a204c0e69f9ba3d51c2d1453fb248863b57a8151/project/Build.scala#L88-L90
additional fake projects for the purposes of seperate settings
Perry
@pfn
Sep 17 2015 19:05
that's how it is solved
android.Plugin.flavorOf = faek project
no aggregation, though
because aggregation doesn't solve the problem nicely
Dale Wijnand
@dwijnand
Sep 17 2015 19:09
One difference that it's not the same base dir, and they brings in what they depend on, so you can group what tasks aggregate on a task-by-task
Perry
@pfn
Sep 17 2015 19:09
I suppose base could be relocated, don't know if that would work without immense tweaking
Dale Wijnand
@dwijnand
Sep 17 2015 19:10
I wouldn't be surprised, like your original build.sbt problem, that sbt assumes projects have their own different base directories
Perry
@pfn
Sep 17 2015 19:34
for the most part, things should work fine, since I have my own ProjectLayout model
the problem is things like resourceDirectories and such that I don't set explicitly
Perry
@pfn
Sep 17 2015 19:42
when are sbt settings evaluated? at project load? not lazily?
Perry
@pfn
Sep 17 2015 20:05
java.lang.RuntimeException: The incremental compiler requires absolute sources, but some were relative: .\src\main\scala\MainActivity.scala and 6 others
yeah, it really doesn't like it when I change the base directory out from under it...
Perry
@pfn
Sep 17 2015 20:32
hmm, a little better
Perry
@pfn
Sep 17 2015 20:51
  def flavorOf(p: Project, id: String, settings: Setting[_]*): Project = {
    val base = p.base / id
    p.copy(id = id, base = base).settings(Seq(
      (projectLayout in Android) := ProjectLayout(p.base.getCanonicalFile, Some(base.getCanonicalFile)),
      sbt.Keys.target := base) ++ settings:_*)
  }
this seems to work reasonably well
I pull most of the sbt settings for paths out of ProjectLayout, so everything behaves as desired