unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Seeking suggestions for fixing the R gpg package
@ 2022-05-05 13:37 Kyle Andrews
  2022-05-06  8:56 ` zimoun
  0 siblings, 1 reply; 3+ messages in thread
From: Kyle Andrews @ 2022-05-05 13:37 UTC (permalink / raw)
  To: help-guix


Hi,

I want to use the R package gpg which provides bindings to GPGME from
within Guix. Most of the time packaging R things is really easy thanks
to the handy `guix import cran' command. Unfortunately, something is
breaking with GPGME which is making this not work as I
expected. Unfortunately, I don't really have any experience with dealing
with this problem. Can anyone suggest how they would go about debugging
this? 

I opened a bug report on the R gpg, but I don't really know if that's
the appropriate place. There I included the Guix build error report. The
key problem seems to be that

> error: GPGME setting OpenPGP path/home error: Invalid crypto engine

  https://github.com/jeroen/gpg/issues/14

My non-working package code is below:

8<---------------------------------------------------------------------------------
(use-modules (guix packages)
	     (guix download)
	     (guix build-system r)
	     (guix git-download)
	     ((guix licenses) #:prefix license:)
	     (gnu packages pkg-config)
	     (gnu packages compression)
	     (gnu packages gnupg)
	     (gnu packages maths)
	     (gnu packages cran)
	     (gnu packages statistics)
	     (gnu packages gcc))

(define-public r-gpg
  (package
    (name "r-gpg")
    (version "1.2.6")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "gpg" version))
       (sha256
        (base32 "17rvi3qff2kanqr3g20dzhn48bfh5sv57g0wsamndzcif7rhjhby"))))
    (properties `((upstream-name . "gpg")))
    (build-system r-build-system)
    (propagated-inputs (list r-askpass r-curl))
    (native-inputs (list pkg-config r-knitr gpgme))
    (home-page "https://github.com/jeroen/gpg")
    (synopsis "GNU Privacy Guard for R")
    (description
     "Bindings to GnuPG for working with OpenGPG (RFC4880) cryptographic methods.
Includes utilities for public key encryption, creating and verifying digital
signatures, and managing your local keyring.  Some functionality depends on the
version of GnuPG that is installed on the system.  On Windows this package can
be used together with 'GPG4Win' which provides a GUI for managing keys and
entering passphrases.")
    (license license:expat)))
--------------------------------------------------------------------------------->8

The build of the R package seemed to go fine. It only fails when it
tries to test that the package can be loaded into an R session.

8<---------------------------------------------------------------------------------
Using PKG_CFLAGS=-I/gnu/store/33x095pip87pxcn23cz8k96jq6bka51s-gpgme-1.15.1/include -I/gnu/store/imh6q627pj1jpcxdzjpvdwmlwh8kl5kw-libassuan-2.5.5/include -I/gnu/store/pilv2s68v4xamxwk1ahfy7q32j6wnf7l-libgpg-error-1.42/include
Using PKG_LIBS=-L/gnu/store/33x095pip87pxcn23cz8k96jq6bka51s-gpgme-1.15.1/lib -lgpgme -L/gnu/store/imh6q627pj1jpcxdzjpvdwmlwh8kl5kw-libassuan-2.5.5/lib -lassuan -L/gnu/store/pilv2s68v4xamxwk1ahfy7q32j6wnf7l-libgpg-error-1.42/lib -lgpg-error
** libs
gcc -I"/gnu/store/fm6grlr7rvb176ls6kkamadim64w3jli-r-minimal-4.1.3/lib/R/include" -DNDEBUG -I/gnu/store/33x095pip87pxcn23cz8k96jq6bka51s-gpgme-1.15.1/include -I/gnu/store/imh6q627pj1jpcxdzjpvdwmlwh8kl5kw-libassuan-2.5.5/include -I/gnu/store/pilv2s68v4xamxwk1ahfy7q32j6wnf7l-libgpg-error-1.42/include  -I/usr/local/include   -fpic  -g -O2  -c encrypt.c -o encrypt.o
gcc -I"/gnu/store/fm6grlr7rvb176ls6kkamadim64w3jli-r-minimal-4.1.3/lib/R/include" -DNDEBUG -I/gnu/store/33x095pip87pxcn23cz8k96jq6bka51s-gpgme-1.15.1/include -I/gnu/store/imh6q627pj1jpcxdzjpvdwmlwh8kl5kw-libassuan-2.5.5/include -I/gnu/store/pilv2s68v4xamxwk1ahfy7q32j6wnf7l-libgpg-error-1.42/include  -I/usr/local/include   -fpic  -g -O2  -c engine.c -o engine.o
gcc -I"/gnu/store/fm6grlr7rvb176ls6kkamadim64w3jli-r-minimal-4.1.3/lib/R/include" -DNDEBUG -I/gnu/store/33x095pip87pxcn23cz8k96jq6bka51s-gpgme-1.15.1/include -I/gnu/store/imh6q627pj1jpcxdzjpvdwmlwh8kl5kw-libassuan-2.5.5/include -I/gnu/store/pilv2s68v4xamxwk1ahfy7q32j6wnf7l-libgpg-error-1.42/include  -I/usr/local/include   -fpic  -g -O2  -c keys.c -o keys.o
gcc -I"/gnu/store/fm6grlr7rvb176ls6kkamadim64w3jli-r-minimal-4.1.3/lib/R/include" -DNDEBUG -I/gnu/store/33x095pip87pxcn23cz8k96jq6bka51s-gpgme-1.15.1/include -I/gnu/store/imh6q627pj1jpcxdzjpvdwmlwh8kl5kw-libassuan-2.5.5/include -I/gnu/store/pilv2s68v4xamxwk1ahfy7q32j6wnf7l-libgpg-error-1.42/include  -I/usr/local/include   -fpic  -g -O2  -c keysig.c -o keysig.o
gcc -I"/gnu/store/fm6grlr7rvb176ls6kkamadim64w3jli-r-minimal-4.1.3/lib/R/include" -DNDEBUG -I/gnu/store/33x095pip87pxcn23cz8k96jq6bka51s-gpgme-1.15.1/include -I/gnu/store/imh6q627pj1jpcxdzjpvdwmlwh8kl5kw-libassuan-2.5.5/include -I/gnu/store/pilv2s68v4xamxwk1ahfy7q32j6wnf7l-libgpg-error-1.42/include  -I/usr/local/include   -fpic  -g -O2  -c options.c -o options.o
gcc -I"/gnu/store/fm6grlr7rvb176ls6kkamadim64w3jli-r-minimal-4.1.3/lib/R/include" -DNDEBUG -I/gnu/store/33x095pip87pxcn23cz8k96jq6bka51s-gpgme-1.15.1/include -I/gnu/store/imh6q627pj1jpcxdzjpvdwmlwh8kl5kw-libassuan-2.5.5/include -I/gnu/store/pilv2s68v4xamxwk1ahfy7q32j6wnf7l-libgpg-error-1.42/include  -I/usr/local/include   -fpic  -g -O2  -c register.c -o register.o
gcc -I"/gnu/store/fm6grlr7rvb176ls6kkamadim64w3jli-r-minimal-4.1.3/lib/R/include" -DNDEBUG -I/gnu/store/33x095pip87pxcn23cz8k96jq6bka51s-gpgme-1.15.1/include -I/gnu/store/imh6q627pj1jpcxdzjpvdwmlwh8kl5kw-libassuan-2.5.5/include -I/gnu/store/pilv2s68v4xamxwk1ahfy7q32j6wnf7l-libgpg-error-1.42/include  -I/usr/local/include   -fpic  -g -O2  -c sign.c -o sign.o
gcc -shared -L/gnu/store/fm6grlr7rvb176ls6kkamadim64w3jli-r-minimal-4.1.3/lib/R/lib -L/usr/local/lib -o gpg.so encrypt.o engine.o keys.o keysig.o options.o register.o sign.o -L/gnu/store/33x095pip87pxcn23cz8k96jq6bka51s-gpgme-1.15.1/lib -lgpgme -L/gnu/store/imh6q627pj1jpcxdzjpvdwmlwh8kl5kw-libassuan-2.5.5/lib -lassuan -L/gnu/store/pilv2s68v4xamxwk1ahfy7q32j6wnf7l-libgpg-error-1.42/lib -lgpg-error -L/gnu/store/fm6grlr7rvb176ls6kkamadim64w3jli-r-minimal-4.1.3/lib/R/lib -lR
--------------------------------------------------------------------------------->8

After that comes the error:

8<---------------------------------------------------------------------------------
Error: package or namespace load failed for ‘gpg’:
 .onLoad failed in loadNamespace() for 'gpg', details:
  call: NULL
  error: GPGME setting OpenPGP path/home error: Invalid crypto engine
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/gnu/store/zrsgwmxcqd7dxinsj477lm2rw9mnyhi1-r-gpg-1.2.6/site-library/gpg’
error: in phase 'install': uncaught exception:
%exception #<&invoke-error program: "R" arguments: ("CMD" "INSTALL" "--install-tests" "--library=/gnu/store/zrsgwmxcqd7dxinsj477lm2rw9mnyhi1-r-gpg-1.2.6/site-library/" "--built-timestamp=1970-01-01" ".") exit-status: 1 term-signal: #f stop-signal: #f> 
phase `install' failed after 2.2 seconds
command "R" "CMD" "INSTALL" "--install-tests"
 "--library=/gnu/store/zrsgwmxcqd7dxinsj477lm2rw9mnyhi1-r-gpg-1.2.6/site-library/"
 "--built-timestamp=1970-01-01" "." failed with status 1
--------------------------------------------------------------------------------->8

I would to see this package in guix and mainly want to use it myself in
leu of the menu interface in the command line app.

Thanks in advance for any suggestions.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Seeking suggestions for fixing the R gpg package
  2022-05-05 13:37 Seeking suggestions for fixing the R gpg package Kyle Andrews
@ 2022-05-06  8:56 ` zimoun
  2022-05-09 11:47   ` Kyle
  0 siblings, 1 reply; 3+ messages in thread
From: zimoun @ 2022-05-06  8:56 UTC (permalink / raw)
  To: Kyle Andrews, help-guix

Hi,

On Thu, 05 May 2022 at 13:37, Kyle Andrews <kyle@posteo.net> wrote:

>     (propagated-inputs (list r-askpass r-curl))
>     (native-inputs (list pkg-config r-knitr gpgme))

[...]

> 8<---------------------------------------------------------------------------------
> Error: package or namespace load failed for ‘gpg’:

I have looked at all the details, but ’gpg’ seems required, no?

Maybe try to add it as native-inputs.


Cheers,
simon


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Seeking suggestions for fixing the R gpg package
  2022-05-06  8:56 ` zimoun
@ 2022-05-09 11:47   ` Kyle
  0 siblings, 0 replies; 3+ messages in thread
From: Kyle @ 2022-05-09 11:47 UTC (permalink / raw)
  To: zimoun, help-guix

Thanks so much, that worked! It was not at all clear to me that such a dependency existed or that if it did it would not already be encapsulated by GPGME itself. 



On May 6, 2022 4:56:00 AM EDT, zimoun <zimon.toutoune@gmail.com> wrote:
>Hi,
>
>On Thu, 05 May 2022 at 13:37, Kyle Andrews <kyle@posteo.net> wrote:
>
>>     (propagated-inputs (list r-askpass r-curl))
>>     (native-inputs (list pkg-config r-knitr gpgme))
>
>[...]
>
>> 8<---------------------------------------------------------------------------------
>> Error: package or namespace load failed for ‘gpg’:
>
>I have looked at all the details, but ’gpg’ seems required, no?
>
>Maybe try to add it as native-inputs.
>
>
>Cheers,
>simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-09 12:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-05 13:37 Seeking suggestions for fixing the R gpg package Kyle Andrews
2022-05-06  8:56 ` zimoun
2022-05-09 11:47   ` Kyle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).