Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing gpgCommand has no effect #133

Open
Katrix opened this issue Jun 14, 2018 · 8 comments
Open

Changing gpgCommand has no effect #133

Katrix opened this issue Jun 14, 2018 · 8 comments

Comments

@Katrix
Copy link

Katrix commented Jun 14, 2018

Trying to make sbt-pgp use gpg2 by changing the gpgCommand key, but it doesn't seem to have any effect.

Using useGpg := true

sbt:scammanderRoot> set com.typesafe.sbt.pgp.PgpKeys.gpgCommand := "gpg2"
[info] Defining gpgCommand
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to scammanderRoot (in build file:/mnt/d/DevProjects/Scammander/)
sbt:scammanderRoot> show pgpSigner
[info] spongeSponge7-0-0 / pgpSigner
[info]  GPG-Command(gpg)
[info] bukkit / pgpSigner
[info]  GPG-Command(gpg)
[info] spongeSponge5-1-0 / pgpSigner
[info]  GPG-Command(gpg)
[info] common / pgpSigner
[info]  GPG-Command(gpg)
[info] spongeSponge6-0-0 / pgpSigner
[info]  GPG-Command(gpg)
[info] pgpSigner
[info]  GPG-Command(gpg)
[success] Total time: 0 s, completed Jun 14, 2018 1:22:24 PM
@ajozwik
Copy link

ajozwik commented Jul 25, 2019

The same for me....
gpg in version 1.4.x is used by my update tool (slackpkg on slackware) and I can not override it. Instead of I have gpg2 installed. I need to point to gpg2 only for publishSigned

Work-around:

  • create symbolic link
ln -s /usr/bin/gpg2 $HOME/bin/gpg
  • run sbt as:
PATH=$HOME/bin:$PATH sbt

@eed3si9n
Copy link
Member

Probably needs to be scoped globally.

set Global / gpgCommand := "gpg2"

@softinio
Copy link

softinio commented Feb 3, 2020

I am still getting this issue. Opened a stackoverflow question in case its me doing something wrong:

https://stackoverflow.com/questions/60029812/how-do-you-use-sbt-pgp-with-a-different-command-to-call-gpg-i-have-tried-gpgcom

@eed3si9n any thoughts?

@eed3si9n
Copy link
Member

eed3si9n commented Feb 3, 2020

Let me reopen this issue.

@eed3si9n eed3si9n reopened this Feb 3, 2020
@softinio
Copy link

softinio commented Feb 4, 2020

@eed3si9n thx ... is the fix for this simply adding to here:

https://github.com/sbt/sbt-pgp/blob/master/sbt-pgp/src/main/scala/com/jsuereth/sbtpgp/SbtPgp.scala#L30

def gpgCommand = PgpKeys.gpgCommand in Global

@SethTisue
Copy link
Member

SethTisue commented Feb 4, 2020

I poked at this a bit in the scala-xml repo (as an arbitrary example of a repo that uses this plugin)

sbt:scala-xml> set com.typesafe.sbt.pgp.PgpKeys.gpgCommand := "gpg2"
[info] Defining gpgCommand
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to scala-xml (in build file:/Users/tisue/modules/scala-xml/)
sbt:scala-xml> show gpgCommand
[info] xmlJS / gpgCommand
[info] 	gpg
[info] xml / gpgCommand
[info] 	gpg
[info] gpgCommand
[info] 	gpg2

note that the global setting changed but the value in each subproject didn't

but then:

sbt:scala-xml> set ThisBuild / com.typesafe.sbt.pgp.PgpKeys.gpgCommand := "gpg2"
[info] Defining ThisBuild / gpgCommand
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to scala-xml (in build file:/Users/tisue/modules/scala-xml/)
sbt:scala-xml> show gpgCommand
[info] xmlJS / gpgCommand
[info] 	gpg2
[info] xml / gpgCommand
[info] 	gpg2
[info] gpgCommand
[info] 	gpg2

this time they all changed.

so maybe you want ThisBuild rather than Global?

@softinio
Copy link

softinio commented Feb 6, 2020

@SethTisue thanks for taking the time to help with this. Will give your suggestion a try.

@ihostage
Copy link

ihostage commented Mar 14, 2020

For changing command on Travis CI (Ubuntu) we use the next settings:

val gpgSettings = Seq(
  useGpgAgent := true,
  useGpgPinentry := true,
  usePgpKeyHex("XXXXXXX")
) ++ sys.env.get("TRAVIS").map( _ => gpgCommand in Global := "gpg2" )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants