phar-io/phar.io

Trying to install `phpmd`

mikebronner opened this issue · 6 comments

Hi, I'm trying to install phpmd using PHIVE, but am running into the following error:

./Bin/phive install phpmd --target Bin --copy --force-accept-unsigned
Phive 0.14.5 - Copyright (C) 2015-2021 by Arne Blankerts, Sebastian Heuer and Contributors
Downloading https://api.github.com/rate_limit
Downloading https://github.com/phpmd/phpmd/releases/download/2.9.1/phpmd.phar
Downloading https://github.com/phpmd/phpmd/releases/download/2.9.1/phpmd.phar.asc
sh: line 1:  5779 Abort trap: 6           '/Users/xxxxx/Developer/yyyyy/Bin/gpg' --homedir '/Users/xxxxx/.phive/gpg' --quiet --status-fd 1 --lock-multiple --no-permission-warning --no-greeting --exit-on-status-write-error --batch --no-tty --with-colons --verify '/var/folders/j0/3wvd954n18ldwg2xbhmggswm0000gn/T/phive_gpg_6063e812136511.26513987' '/var/folders/j0/3wvd954n18ldwg2xbhmggswm0000gn/T/phive_gpg_6063e81212a589.86813106' 2> /dev/null
[ERROR]    GnuPG verify call returned false

I'm not quite sure how to address this error, as other packages seem to install fine. Thanks for your help!

The Abort trap: 6 looks strange and - afaik - signals a crash of an underlying process. From the error alone though, I cannot tell whether that's because phive is doing something wrong or something else is amiss.

You could try to run the sub-process call manually. Copying it from the error, only omitting the redirect to /dev/null at the end:

'/Users/xxxxx/Developer/yyyyy/Bin/gpg' --homedir '/Users/xxxxx/.phive/gpg' --quiet --status-fd 1 --lock-multiple --no-permission-warning --no-greeting --exit-on-status-write-error --batch --no-tty --with-colons --verify '/var/folders/j0/3wvd954n18ldwg2xbhmggswm0000gn/T/phive_gpg_6063e812136511.26513987' '/var/folders/j0/3wvd954n18ldwg2xbhmggswm0000gn/T/phive_gpg_6063e81212a589.86813106'

And, if possible, paste the output here. Maybe that helps us understand whats happening.

Hi @theseer, thank you for the advice on debugging this. According to the output, it appears my GnuPG is not installed correctly:

dyld: Library not loaded: @rpath/libintl.9.dylib
  Referenced from: /Users/mike/Developer/phpcs.novaextension/Bin/gpg
  Reason: image not found
[1]    9578 abort      '/Users/mike/Developer/phpcs.novaextension/Bin/gpg' --homedir  --quiet  1   

It indeed appears that way. I'm afraid, that's outside of the scope for phive and thus not an issue I can help with.

Not sure if you have homebrew installed on your system - if not, even though I'm not a mac user myself, I'd recommend doing so, and then use the homebrew to install gnupg. I believe, you can even install phive via homebrew: https://formulae.brew.sh/formula/phive :)

I'll be closing this issue. If you find out it's a problem with phive after all, please leave a comment and I'll reopen it.

@theseer Absolutely not your problem, for sure. :) I was trying to package phive up in an IDE extension and not have outside requirements, so I just copied the gig binary over. Clearly it won't be that easy.

For that to work you certainly need a statically linked binary. So you probably have to compile it yourself / tell homebrew to generate a statically linked binary - not sure if/how that would work.

If that extension is for PHPStorm / a jetbrains' ide, let me know. I might be interested in testing and, if we can make it work on linux and probably windows (sigh), we might even promote it.

@theseer Thanks for the suggestion, I will look into if a static library can be compiled for GPG.

Regarding the IDE: I'm playing around with Panic's Nova editor, it has lots of promise, and I'm trying to get all the relevant linters for my workflow added. Sorry, I think that editor is Mac-only.