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

stack upload --no-signature still shows "Unable to find gpg2 or gpg executable" #3739

Closed
koterpillar opened this issue Jan 2, 2018 · 5 comments

Comments

@koterpillar
Copy link
Contributor

General summary/comments (optional)

stack upload --no-signature shows error messages related to GPG.

Steps to reproduce

Expected

Package uploaded, no error messages.

Actual

$ stack upload --no-signature .
Getting file list for SNIP/simpleconfig/
Building sdist tarball for SNIP/simpleconfig/
Checking package 'simpleconfig' for common mistakes
Hackage username: SNIP
Hackage password:
Save hackage credentials to file at SNIP/.stack/upload/credentials.json [y/n]? n
NOTE: Avoid this prompt in the future by using: save-hackage-creds: false
Uploading simpleconfig-0.0.1.tar.gz... done!
Environment variable GPG_TTY is not set (see `man gpg-agent`)
Unable to find gpg2 or gpg executable

Output in verbose mode:

$ stack upload --no-signature --verbose .
Version 1.6.3 x86_64 hpack-0.20.0
2018-01-03 09:25:54.163659: [debug] Checking for project config at: SNIP/simpleconfig/stack.yaml
@(Stack/Config.hs:842:9)
2018-01-03 09:25:54.164598: [debug] Loading project config file stack.yaml
@(Stack/Config.hs:868:13)
2018-01-03 09:25:54.166236: [debug] Decoding build plan from: SNIP/.stack/build-plan/lts-9.14.yaml
@(Stack/Snapshot.hs:150:5)
2018-01-03 09:25:54.166325: [debug] Trying to decode SNIP/.stack/build-plan-cache/lts-9.14.cache
@(Data/Store/VersionTagged.hs:66:5)
2018-01-03 09:25:54.171898: [debug] Success decoding SNIP/.stack/build-plan-cache/lts-9.14.cache
@(Data/Store/VersionTagged.hs:70:13)
2018-01-03 09:25:54.172879: [debug] Using standard GHC build
@(Stack/Setup.hs:617:9)
2018-01-03 09:25:54.177864: [debug] Getting global package database location
@(Stack/GhcPkg.hs:46:5)
2018-01-03 09:25:54.178326: [debug] Asking GHC for its version
@(Stack/Setup/Installed.hs:98:13)
2018-01-03 09:25:54.178529: [debug] Getting Cabal package version
@(Stack/GhcPkg.hs:185:5)
2018-01-03 09:25:54.178599: [debug] Run process: SNIP/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Log.hs:37:3)
2018-01-03 09:25:54.178667: [debug] Run process: SNIP/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc --numeric-version
@(System/Process/Log.hs:37:3)
2018-01-03 09:25:54.180331: [debug] Run process: SNIP/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
@(System/Process/Log.hs:37:3)
2018-01-03 09:25:54.279856: [debug] Process finished in 101ms: SNIP/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Log.hs:44:3)
2018-01-03 09:25:54.289943: [debug] Process finished in 97ms: SNIP/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
@(System/Process/Log.hs:44:3)
2018-01-03 09:25:54.327869: [debug] Process finished in 149ms: SNIP/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc --numeric-version
@(System/Process/Log.hs:44:3)
2018-01-03 09:25:54.327999: [debug] GHC version is: ghc-8.0.2
@(Stack/Setup/Installed.hs:102:13)
2018-01-03 09:25:54.328110: [debug] Resolving package entries
@(Stack/Setup.hs:250:5)
2018-01-03 09:25:54.328251: [debug] Trying to decode SNIP/.stack/loaded-snapshot-cache/x86_64-osx/ghc-8.0.2/lts-9.14.cache
@(Data/Store/VersionTagged.hs:66:5)
2018-01-03 09:25:54.369826: [debug] Success decoding SNIP/.stack/loaded-snapshot-cache/x86_64-osx/ghc-8.0.2/lts-9.14.cache
@(Data/Store/VersionTagged.hs:70:13)
2018-01-03 09:25:54.370579: [debug] Starting to execute command inside EnvConfig
@(Stack/Runners.hs:170:18)
2018-01-03 09:25:54.370778: [debug] Running hpack on SNIP/simpleconfig/package.yaml
@(Stack/PrettyPrint.hs:63:22)
2018-01-03 09:25:54.374861: [debug] hpack output unchanged in SNIP/simpleconfig/simpleconfig.cabal
@(Stack/PrettyPrint.hs:63:22)
2018-01-03 09:25:54.376230: [info] Getting file list for SNIP/simpleconfig/
@(Stack/SDist.hs:118:5)
2018-01-03 09:25:54.376697: [debug] Parsing the targets
@(Stack/Build/Target.hs:460:3)
2018-01-03 09:25:54.413650: [debug] Start: getPackageFiles SNIP/simpleconfig/simpleconfig.cabal
@(Stack/PrettyPrint.hs:134:16)
2018-01-03 09:25:54.417361: [debug] Finished in 3ms: getPackageFiles SNIP/simpleconfig/simpleconfig.cabal
@(Stack/PrettyPrint.hs:134:16)
2018-01-03 09:25:54.420269: [debug] Getting global package database location
@(Stack/GhcPkg.hs:46:5)
2018-01-03 09:25:54.420573: [debug] Run process: SNIP/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Log.hs:37:3)
2018-01-03 09:25:54.483313: [debug] Process finished in 62ms: SNIP/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Log.hs:44:3)
2018-01-03 09:25:54.484308: [debug] Run process: SNIP/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 sdist --list-sources /private/var/folders/dh/05d9pgq9703g3hf5c347v8qjp00nn6/T/stack-sdist16387/source-files-list
@(System/Process/Log.hs:37:3)
2018-01-03 09:25:54.527753: [debug] Process finished in 43ms: SNIP/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 sdist --list-sources /private/var/folders/dh/05d9pgq9703g3hf5c347v8qjp00nn6/T/stack-sdist16387/source-files-list
@(System/Process/Log.hs:44:3)
2018-01-03 09:25:54.530825: [info] Building sdist tarball for SNIP/simpleconfig/
@(Stack/SDist.hs:120:5)
2018-01-03 09:25:54.538145: [info] Checking package 'simpleconfig' for common mistakes
@(Stack/SDist.hs:407:5)
Hackage username: SNIP
Hackage password:
Save hackage credentials to file at SNIP/.stack/upload/credentials.json [y/n]? n
NOTE: Avoid this prompt in the future by using: save-hackage-creds: false
Uploading simpleconfig-0.0.1.tar.gz... forbidden upload
Usually means: you've already uploaded this package/version combination
Ignoring error and continuing, full message from Hackage below:

Error: Upload failed

This version of the package has already been uploaded.

As a matter of policy we do not allow package tarballs to be changed after a release (so we can guarantee stable md5sums etc). The usual recommendation is to upload a new version, and if necessary blacklist the existing one. In extraordinary circumstances, contact the administrators.
2018-01-03 09:26:06.810439: [warn] Environment variable GPG_TTY is not set (see `man gpg-agent`)
@(Stack/Sig/GPG.hs:107:18)
Unable to find gpg2 or gpg executable

(the package was already uploaded, so that error message is warranted - but the GPG error is still there)

Stack version

$ stack --version
Version 1.6.3 x86_64 hpack-0.20.0

Method of installation

brew install stack

@dbaynard
Copy link
Contributor

@koterpillar Is this still an issue for you? If so, would you try updating to the latest stack with stack upgrade --git (or just stack upgrade after stack 1.8 is released).

@koterpillar
Copy link
Contributor Author

stack --version              
Version 1.8.0, Git revision 194a674ff9c5c07baf3a748051c9e645fa1f0695 x86_64 hpack-0.29.0

Still happens.

@dbaynard
Copy link
Contributor

So to be clear: the upload works; the error message is irrelevant?

@koterpillar
Copy link
Contributor Author

Yes, the upload works, but the exit code is 1, which is problematic on CI. I don't have a working signing environment, so I can't test whether the signature is uploaded or not, even when I said not to.

@koterpillar
Copy link
Contributor Author

I found that --no-signing works in reverse: default is not to sign packages, --no-signing turns signing on. Made #4167 to fix.

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

2 participants