These are chat archives for sbt/sbt

10th
Mar 2015
eugene yokota
@eed3si9n
Mar 10 2015 01:54
@jsuereth can I merge sbt/sbt#1904 ?
Josh Suereth
@jsuereth
Mar 10 2015 01:58
lost my comment trail
eugene yokota
@eed3si9n
Mar 10 2015 01:59
oops. I rebased it to 0.13 to skip scripted publish-local
half the comments were on picklers, which is now gone
Josh Suereth
@jsuereth
Mar 10 2015 01:59
no problem, just curious what you had to say about the hintStaticallyElided
eugene yokota
@eed3si9n
Mar 10 2015 02:01
another thing I noticed maybe for 0.13.9 is the Scala 2.10.5, which I think fixes XML bug
eugene yokota
@eed3si9n
Mar 10 2015 02:07
the comment I made hintStaticallyElided was that I wanted $type for consistency
Josh Suereth
@jsuereth
Mar 10 2015 02:07
right, we can do that in 0.13.9
And htat's ok, I guess.
eugene yokota
@eed3si9n
Mar 10 2015 02:07

@havocp wrote:

We can always technically omit $type except when it's a discriminator for a sealed trait, but our convention has been to include it for case classes while omitting it for primitives, lists, and maps. Our other convention is that after including it, it's a bug to use it since it would break duck typing based compat hacks. That's the rules we followed to date.

Josh Suereth
@jsuereth
Mar 10 2015 02:07
If you're running out of memory, it's not service a purpose right now
eugene yokota
@eed3si9n
Mar 10 2015 02:08
the point at which it runs out is during the merge of case classes
Josh Suereth
@jsuereth
Mar 10 2015 02:13
yeah, so I guess the PR is fine as is then.
eugene yokota
@eed3si9n
Mar 10 2015 02:18
cool. I'll merge once I get green
I'm going to make the final date 3/16 since it's likely going to get pushed by bug fix
the Travis is looking red, but likely legit. I'm guessing this is due to Throwable -> IOException change.
eugene yokota
@eed3si9n
Mar 10 2015 02:35
reproduced it locally:
[info] [error] (*:update) scala.pickling.PicklingException: failed to parse "/private/var/folders/7g/l96y5q310h90xsz109qqjpmc0000gn/T/sbt_2372f57c/add-alias/target/streams/$global/update/$global/streams/update_cache_2.10/output" as JSON: /private/var/folders/7g/l96y5q310h90xsz109qqjpmc0000gn/T/sbt_2372f57c/add-alias/target/streams/$global/update/$global/streams/update_cache_2.10/output (No such file or directory)
Josh Suereth
@jsuereth
Mar 10 2015 02:36
you may need to catch less/more
looks like "PicklingExcecpiton" needs to be caught
eugene yokota
@eed3si9n
Mar 10 2015 02:36
yea. i just have to catch scala.pickling.PicklingException instead of pokemon pattern (gotta catch'em all)
Dale Wijnand
@dwijnand
Mar 10 2015 06:10
lol
Dale Wijnand
@dwijnand
Mar 10 2015 06:24
what generates html from .notes?
Dale Wijnand
@dwijnand
Mar 10 2015 08:48
oh ok
eugene yokota
@eed3si9n
Mar 10 2015 12:23
sbt 0.13.8-RC1 is published
Josh Suereth
@jsuereth
Mar 10 2015 13:12
awesome!
Matt Hughes
@matthughes
Mar 10 2015 18:42
Is there a way to check the contents of a ivy.xml file from sbt-scripted plugin?
Or more generally, sbt-scripted appears to clean up the tmp directory after run. Is there any way to turn this off so I can see what files are in the tmp target directory?
eugene yokota
@eed3si9n
Mar 10 2015 18:43
you can use pause command
Matt Hughes
@matthughes
Mar 10 2015 18:44
neat
oh in the 'test' file
eugene yokota
@eed3si9n
Mar 10 2015 18:44
yea
Matt Hughes
@matthughes
Mar 10 2015 18:46
hmm I have this as my first two lines, but scripted continues past it without me hitting enter
> publishLocal
$ pause
`
eugene yokota
@eed3si9n
Mar 10 2015 18:48
that's odd
could you try putting pause as the first test command?
Matt Hughes
@matthughes
Mar 10 2015 18:49
Yeah. Issue was publishLocal failed. Trying to figure out why.
Simeon H.K. Fitch
@metasim
Mar 10 2015 18:52
Question: If I’m running a subprocess in a task, and want the output of the task to be echoed to the console and captured as a string, shouldn’t this do this trick?:
// Inside a task with dependency on `streams`
val output = “ls -l”.!!(streams.log)
…
In my real use case (not using ls) I’m getting content in output, but nothing written to the screen.
eugene yokota
@eed3si9n
Mar 10 2015 18:53
@metasim is this for developing sbt code base or a plugin?
Simeon H.K. Fitch
@metasim
Mar 10 2015 18:53
plugin
Wrong forum?
eugene yokota
@eed3si9n
Mar 10 2015 18:54
plugin dev is fine
Simeon H.K. Fitch
@metasim
Mar 10 2015 18:54
Sorry about that. Do you know if they have a gitter?
eugene yokota
@eed3si9n
Mar 10 2015 18:55
if you're working on a plugin, this forum is the right place to be
Simeon H.K. Fitch
@metasim
Mar 10 2015 18:55
OK. Working on something to manage docker images.
eugene yokota
@eed3si9n
Mar 10 2015 19:00
if you're not seeing the output it's likely a bug
another possibility is stdout vs stderr
Simeon H.K. Fitch
@metasim
Mar 10 2015 19:02
Need to investigate that. When I type last I just get [debug] > shell as a result.

Yeh, maybe a bug? My test:

TaskKey[String]("ls") <<= (streams) map { streams =>
    val output = s"ls -l".!!(streams.log)
    "Captuted output: " + output
}

If I run ls there’s no output logged. Run show ls and I get what I’d expect.

eugene yokota
@eed3si9n
Mar 10 2015 19:07
I might have run into that since I see log.info here - https://github.com/sbt/sbt-sh/blob/master/src/main/scala/sbtsh/Sh.scala#L33-L34
Simeon H.K. Fitch
@metasim
Mar 10 2015 19:09

Thanks that’s helpful. To be fair to the docs, they do only say stderr:

Starts the process represented by this builder, blocks until it exits, and returns the output as a String. Standard error is sent to the provided ProcessLogger. If the exit code is non-zero, an exception is thrown.

Thanks for the github link. :-)
Matt Hughes
@matthughes
Mar 10 2015 19:35
I'm writing a plugin task that might generate an artifact: Task[Option[File]]. In the case that this artifact is built, I would like to attach it to the build. Any points for how to do that with addArtifact?
eugene yokota
@eed3si9n
Mar 10 2015 19:36
I've seen the question somewhere maybe here
the answer at the time was read Defaults.scala and mimic what addArtifact is doing, iirc
Matt Hughes
@matthughes
Mar 10 2015 19:42
I did look at that but having issues with how to translate that to Option. This is my current method that doesn't compile.
  /**
  `value` can only be called on a task within a task definition macro, such as :=, +=, ++=, or Def.task.
  [error]     taskDef.value.map { builtArtifact =>
  **/ 
  def addOptionalArtifact(a: Artifact, taskDef: TaskKey[Option[File]]): SettingsDefinition = {
    taskDef.value.map { builtArtifact => 
      val pkgd = packagedArtifacts := packagedArtifacts.value updated (a, builtArtifact)
      seq(artifacts += a, pkgd)
    }.getOrElse(Nil)
  }
This is related to sbt/sbt#1839 btw. I'm trying to rewrite my plugin to see if I can get around the issue.
Like, maybe I'm just not adding artifacts in the expected way.
Matt Hughes
@matthughes
Mar 10 2015 19:56
  def addOptionalArtifact(a: Artifact, taskDef: TaskKey[Option[File]]): SettingsDefinition = {
      val pkgd = packagedArtifacts := (taskDef.value.map { builtArtifact => 
        packagedArtifacts.value updated (a, builtArtifact) 
      }.getOrElse(packagedArtifacts.value))
      seq(artifacts += a, pkgd)
  }
Have that now, but even when I run publishLocal, that doesn't seem to trigger my task. I would think publishLocal would trigger packageArtifacts which would trigger anything that called addArtifact.