These are chat archives for sbt/sbt

2nd
Feb 2016
nafg
@nafg
Feb 02 2016 02:30
I'm running a bunch of sbt commands prefixed with ~ in a play project and it runs many times even without me changing sources. Apparently something that's being written automatically is triggering it to run again. Is there a way to find out what file that is (so I can exclude it?)?
Perry
@pfn
Feb 02 2016 03:13
@nafg nope, commonly it's temporary files from your editor
nafg
@nafg
Feb 02 2016 03:14
@pfn no editor open
pfn @pfn shrugs
nafg
@nafg
Feb 02 2016 03:20
[debug] 
[debug] Initial source changes: 
[debug]     removed:Set()
[debug]     added: Set()
[debug]     modified: Set()
[debug] Invalidated products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set()
[debug] 
[debug] Sources indirectly invalidated by:
[debug]     product: Set()
[debug]     binary dep: Set()
[debug]     external source: Set()
[debug] All initially invalidated sources: Set()
[debug] Copy resource mappings: 
[debug]     (/code/conf/messages.es,/code/target/scala-2.11/classes/messages.es)
[debug]     (/code/conf/routes,/code/target/scala-2.11/classes/routes)
[debug]     (/code/conf/messages.es~,/code/target/scala-2.11/classes/messages.es~)
[debug]     (/code/conf/messages.en,/code/target/scala-2.11/classes/messages.en)
[debug]     (/code/conf/application.conf,/code/target/scala-2.11/classes/application.conf)
[debug] 
[debug] Initial source changes: 
[debug]     removed:Set()
[debug]     added: Set()
[debug]     modified: Set()
[debug] Invalidated products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set()
[debug] 
[debug] Sources indirectly invalidated by:
[debug]     product: Set()
[debug]     binary dep: Set()
[debug]     external source: Set()
[debug] All initially invalidated sources: Set()
[debug] Copy resource mappings: 
[debug]
with debug enabled
Is "copy resource mappings" just listing all resources? Or is it a clue about what changed?
Because nothing should be writing to those
Perry
@pfn
Feb 02 2016 07:06
@nafg, show watchSources
although I think play does something on its own
Dale Wijnand
@dwijnand
Feb 02 2016 07:12
interesting
nafg
@nafg
Feb 02 2016 17:49
@pfn that doesn't show what actually changed
Perry
@pfn
Feb 02 2016 17:50
it doesn't, no
but it shows you what it's watching, so you can guess at what's changing
nafg
@nafg
Feb 02 2016 19:27
@pfn unfortunately I can't guess :(
Sam Halliday
@fommil
Feb 02 2016 20:56
is there any way for a project to override the auto loading of a plugin? I'm trying to diagnose why the ensime-sbt plugin is not automatically running in this project https://github.com/quasar-analytics/quasar (we create a new ivy configuration, but it isn't being added)
Sam Halliday
@fommil
Feb 02 2016 22:20
are .jar files not copied to the temporary directory in scripted tests?
e.g. in a lib folder
Tim Harper
@timcharper
Feb 02 2016 22:41
I am having the WORST time with sbt-gpg :(
I'm trying so desperately hard to upgrade. It's what led me to finally submit the auto-plugin patch (which ended up breaking plugins which depended on the broken behavior lol).
now I'm getting errors that it can't read my key
and geez if I downgrade it works again
Trying to create a new key:
> pgp-cmd gen-key
Failed to run pgp-cmd: GeneratePgpKey().   Please report this issue at http://github.com/sbt/sbt-pgp/issues
This message was deleted
I don't mean to sound overly negative.
Matthew de Detrich
@mdedetrich
Feb 02 2016 22:45
Which version are you using (sbt and sbt-gpg)? I use sbt-gpg and havent had an issue
Tim Harper
@timcharper
Feb 02 2016 22:45
1.0.0
Matthew de Detrich
@mdedetrich
Feb 02 2016 22:46
can you use last to produce a stack trace?
Tim Harper
@timcharper
Feb 02 2016 22:46
> pgp-cmd gen-key
Failed to run pgp-cmd: GeneratePgpKey().   Please report this issue at http://github.com/sbt/sbt-pgp/issues
> last
>
:(
Matthew de Detrich
@mdedetrich
Feb 02 2016 22:46
hmmm…..
Oh wait, I mean last pgp-cmd
or last pgp-cmd:*
one of those version should produce a stack trace
Tim Harper
@timcharper
Feb 02 2016 22:48
> last pgp-cmd:*
[error] Expected '::'
[error] last pgp-cmd:*
[error]               ^
> last pgp-cmd
[error] Not a valid project ID: pgp-cmd
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: pgp-cmd (similar: gpg-command, pgp-context)
[error] last pgp-cmd
[error]
Matthew de Detrich
@mdedetrich
Feb 02 2016 22:48
gimme a sec, let me to actually try find the command
Dale Wijnand
@dwijnand
Feb 02 2016 22:50
last I think is for tasks, and looks like pgp-cmd is a command
Matthew de Detrich
@mdedetrich
Feb 02 2016 22:51
yeah, I think your right @dwijnand
Tim Harper
@timcharper
Feb 02 2016 22:58
It's quitting on this line:
    if(pub.exists) sys.error("Public key ring (" + pub.getAbsolutePath + ") already exists!")
Why isn't the error printing though ???
> consoleProject
...
scala> sys.error("hi")
java.lang.RuntimeException: hi
    at scala.sys.package$.error(package.scala:27)
    at .<init>(<console>:53)
    at .<clinit>(<console>)
    at .<init>(<console>:7)
...
sys.error throws an exception, but sbt doesn't seem to be showing it in the case of sbt-pgp
Using sbt 0.13.9
I compiled the plugin with a println statement for that branch and sure enough here is the error message it was trying to tell me:
Public key ring (/Users/timcharper/.gnupg/pubring.gpg) already exists!
Failed to run pgp-cmd: GeneratePgpKey().   Please report this issue at http://github.com/sbt/sbt-pgp/issues
anyone have any idea why sbt would just be swallowing the error?
Tim Harper
@timcharper
Feb 02 2016 23:05
/Users/timcharper/src/oss/sbt-pgp/pgp-plugin/src/main/scala/com/typesafe/sbt/pgp/PgpSettings.scala

  45 |     def runPgpCmd(ctx: cli.PgpCommandContext): Unit = 
  46 |       try cmd run ctx
  47 |       catch {
  48 |         case e: Exception =>
  49 |           System.err.println("Failed to run pgp-cmd: " + cmd + ".   Please report this issue at http://github.com/sbt/sbt-pgp/issues")
  50 |           throw e
  51 |       }
  52 |     // Create a new task that executes the command.
It's re-throwing the exception
Matthew de Detrich
@mdedetrich
Feb 02 2016 23:15
@timcharper I think it may be best to may an issue, I don’t enough of php-plugin to know why its failing
Tim Harper
@timcharper
Feb 02 2016 23:15
I don't have any hope that the issue will be attended :(
Matthew de Detrich
@mdedetrich
Feb 02 2016 23:15
But it appears the reason why the command is failing is because you already have a key in /Users/timcharper/.gnupg/pubring.gpg
Tim Harper
@timcharper
Feb 02 2016 23:15
looking at the commit log, sbt-pgp looks all but abandoned
@mdedetrich yes it is
so there are two issues
  1. It can't load my gpg key which is perfectly valid.
  2. pgp-cmd is swallowing errors
Matthew de Detrich
@mdedetrich
Feb 02 2016 23:24
How do you know its not loading your gpg-key?
Matthew de Detrich
@mdedetrich
Feb 02 2016 23:36
gen-key creates a new key, its meant to be used if you don’t have one, can you run check-pgp-signatures?
that should tell you if its valid or not
Tim Harper
@timcharper
Feb 02 2016 23:38
I can't publishSigned, that's how I know it's breaking
Matthew de Detrich
@mdedetrich
Feb 02 2016 23:38
Can you run check-pgp-signatures and provide the output?
Tim Harper
@timcharper
Feb 02 2016 23:39
sure!
Matthew de Detrich
@mdedetrich
Feb 02 2016 23:39
Thanks!
Tim Harper
@timcharper
Feb 02 2016 23:39

BTW I just confirmed that

EvaluateTask.runTask(task, state, streams, extracted.structure.index.triggers, config)(nodeView(state, streams, Nil))

is where the error is getting swallowed.

https://github.com/timcharper/sbt-pgp/blob/master/pgp-plugin/src/main/scala/com/jsuereth/sbt/pgp/PgpSettings.scala#L57

sbt actually blocks while running that line.

Matthew de Detrich
@mdedetrich
Feb 02 2016 23:40
Awesome, you should make a pull request for it (or an issue), but for now, lets try and fix the issue you have with gpg
Tim Harper
@timcharper
Feb 02 2016 23:42
> check-pgp-signatures
[info] Resolving org.scala-lang#scalap;2.10.5 ...
[info] ----- PGP Signature Results -----
[info]   org.scala-lang : scala-compiler : 2.10.5 : jar   [UNTRUSTED(0x202d3646)]
[info]   org.scala-lang :  scala-library : 2.10.5 : jar   [UNTRUSTED(0x202d3646)]
[info]   org.scala-lang :  scala-reflect : 2.10.5 : jar   [UNTRUSTED(0x202d3646)]
[info]   org.scala-lang :         scalap : 2.10.5 : jar   [UNTRUSTED(0x202d3646)]
[trace] Stack trace suppressed: run last *:checkPgpSignatures for the full output.
[error] (*:checkPgpSignatures) Some artifacts have bad signatures or are signed by untrusted sources!
[error] Total time: 0 s, completed Feb 2, 2016 4:42:11 PM
one oddity worth mentioning is that I am specifying pgpPassphrase in my config, but it's still prompting me for it none-the-less
hmm.... dang okay I just downgraded again and it's still broken so maybe it's something else.
Tim Harper
@timcharper
Feb 02 2016 23:49
timcharper@tim-scimmia:~/.sbt/gpg $ ls -la ~/.gnupg/
total 32
drwx------   6 timcharper  staff   204 Oct  3 16:14 .
drwxr-xr-x+ 85 timcharper  staff  2890 Feb  2 15:42 ..
-rw-------   1 timcharper  staff  9188 Sep 16 17:57 gpg.conf
-rw-------   1 timcharper  staff     0 Sep 16 17:57 pubring.gpg
-rw-------   1 timcharper  staff     0 Sep 16 17:57 secring.gpg
-rw-------   1 timcharper  staff  1200 Sep 16 23:23 trustdb.gpg
weird my gpg files were zeroed out.... not sure how that happened but THAT'S KINDA WEIRD
Matthew de Detrich
@mdedetrich
Feb 02 2016 23:50
Yeah… so it does actually seem like you have invalid signatures
Thats kinda odd
Tim Harper
@timcharper
Feb 02 2016 23:52

but I have this set in my sbt config:

pgpSecretRing := file("/Users/timcharper/.sbt/gpg/secring.asc")

pgpPublicRing := file("/Users/timcharper/.sbt/gpg/pubring.asc")

And those two files are valid.

okay

so something happened, and geez I have no clue what caused this, but somehow my files in ~/.gnupg/{pubring,secring}.asc were zeroed out. That being the case, 1.0.0 failed even though my configuration told sbt-pgp to look somewhere else for those files.

0.8.3 doesn't have any problem with empty files being in ~/.gnupg/{pubring,secring}.asc.

Deleting ~/.gnupg/{pubring,secring}.asc fixed the issue and now sbt-pgp 1.0.0 works for me.

Tim Harper
@timcharper
Feb 02 2016 23:57
I'm not even sure how to file this issue, but I'll try the best I can. Good grief I don't even know how my computer got in this state.
Matthew de Detrich
@mdedetrich
Feb 02 2016 23:58
Glad you solved it, personally I always back up my gpg files so this stuff doesn’t happen
Tim Harper
@timcharper
Feb 02 2016 23:59
Well, I do too... and I don't store them there. I don't know how empty files were created in ~/.gnupg