unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23561: epg tests are (almost) always skipped
@ 2016-05-17  6:29 Glenn Morris
  2016-05-17  8:48 ` Daiki Ueno
  0 siblings, 1 reply; 15+ messages in thread
From: Glenn Morris @ 2016-05-17  6:29 UTC (permalink / raw)
  To: 23561

Package: emacs
Version: 25.0.93

Since f93d669a, epg-gpg-program defaults to gpg2 if present (which it is
on most systems, I guess). epg-tests-gpg-usable, however, requires gpg
version 1 (in the 'require-passphrase case, which is what every test in
epg-tests uses). As a result, every test in epg-tests is skipped on a
system with "gpg2" present (even if "gpg" is also present).





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

* bug#23561: epg tests are (almost) always skipped
  2016-05-17  6:29 bug#23561: epg tests are (almost) always skipped Glenn Morris
@ 2016-05-17  8:48 ` Daiki Ueno
  2016-05-18 15:44   ` Glenn Morris
  0 siblings, 1 reply; 15+ messages in thread
From: Daiki Ueno @ 2016-05-17  8:48 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 23561

[-- Attachment #1: Type: text/plain, Size: 624 bytes --]

Glenn Morris <rgm@gnu.org> writes:

> Since f93d669a, epg-gpg-program defaults to gpg2 if present (which it is
> on most systems, I guess). epg-tests-gpg-usable, however, requires gpg
> version 1 (in the 'require-passphrase case, which is what every test in
> epg-tests uses). As a result, every test in epg-tests is skipped on a
> system with "gpg2" present (even if "gpg" is also present).

I am actually not sure how to cleanly solve this issue, but as long as
"gpg2" is GnuPG 2.0, the attached patch should work around the issue (if
"gpg2" is upgraded to 2.1, another issue will arise, though).

Regards,
-- 
Daiki Ueno

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Adjust-to-epg-configuration-deprecation.patch --]
[-- Type: text/x-patch, Size: 1723 bytes --]

From d43d3e66b5582c1e5b8e61eaf7f3ac8866c997a4 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@gnu.org>
Date: Tue, 17 May 2016 17:46:31 +0900
Subject: [PATCH] Adjust to epg-configuration deprecation.

* test/lisp/epg-tests.el (epg-tests-gpg-usable): Use
`epg-find-configuration' instead of deprecated
`epg-configuration'.
---
 test/lisp/epg-tests.el | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/test/lisp/epg-tests.el b/test/lisp/epg-tests.el
index 4a31797..06e6f25 100644
--- a/test/lisp/epg-tests.el
+++ b/test/lisp/epg-tests.el
@@ -30,16 +30,20 @@ epg-tests-data-directory
   (expand-file-name "data/epg" (getenv "EMACS_TEST_DIRECTORY"))
   "Directory containing epg test data.")
 
+;; If a passphrase is required, we can only use GnuPG 1.x, as GnuPG
+;; 2.0 or later involves gpg-agent, which prevents injecting
+;; passphrase reliably.
 (defun epg-tests-gpg-usable (&optional require-passphrase)
-  (and (executable-find epg-gpg-program)
-       (condition-case nil
-	   (progn
-	     (epg-check-configuration (epg-configuration))
-	     (if require-passphrase
-		 (string-match "\\`1\\."
-			       (cdr (assq 'version (epg-configuration))))
-	       t))
-	 (error nil))))
+  (let ((config (epg-find-configuration 'OpenPGP)))
+    (and config
+         (condition-case nil
+             (progn
+               (epg-check-configuration config)
+               (if require-passphrase
+                   (string-match "\\`1\\."
+                                 (cdr (assq 'version config)))
+                 t))
+           (error nil)))))
 
 (defun epg-tests-passphrase-callback (_c _k _d)
   ;; Need to create a copy here, since the string will be wiped out
-- 
2.5.5


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

* bug#23561: epg tests are (almost) always skipped
  2016-05-17  8:48 ` Daiki Ueno
@ 2016-05-18 15:44   ` Glenn Morris
  2016-05-19  1:40     ` Daiki Ueno
  0 siblings, 1 reply; 15+ messages in thread
From: Glenn Morris @ 2016-05-18 15:44 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: 23561


> as long as "gpg2" is GnuPG 2.0

epg-config--program-alist requires gpg2 to be in the 2.1 series, so that
seems a bit contradictory?

If these are tests for gpg v1, could you not bind epg-gpg-program to
"gpg" in epg-tests-gpg-usable and with-epg-tests (when
require-passphrase is set)?





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

* bug#23561: epg tests are (almost) always skipped
  2016-05-18 15:44   ` Glenn Morris
@ 2016-05-19  1:40     ` Daiki Ueno
  2016-05-19  9:12       ` Daiki Ueno
  0 siblings, 1 reply; 15+ messages in thread
From: Daiki Ueno @ 2016-05-19  1:40 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 23561

Glenn Morris <rgm@gnu.org> writes:

>> as long as "gpg2" is GnuPG 2.0
>
> epg-config--program-alist requires gpg2 to be in the 2.1 series, so that
> seems a bit contradictory?
>
> If these are tests for gpg v1, could you not bind epg-gpg-program to
> "gpg" in epg-tests-gpg-usable and with-epg-tests (when
> require-passphrase is set)?

The problem is that some distributions rename "gpg2" to "gpg" and it's
not that simple to detect it's v1.  Maybe a better solution would be to
define `epg-config--program-alist' as a normal defvar rather than
defconst, bind it in `with-epg-tests', and find the correct gpg v1
executable.  I'll try to write a patch later today.

Regards,
-- 
Daiki Ueno





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

* bug#23561: epg tests are (almost) always skipped
  2016-05-19  1:40     ` Daiki Ueno
@ 2016-05-19  9:12       ` Daiki Ueno
  2016-05-25 17:07         ` Glenn Morris
  0 siblings, 1 reply; 15+ messages in thread
From: Daiki Ueno @ 2016-05-19  9:12 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 23561

Daiki Ueno <ueno@gnu.org> writes:

> The problem is that some distributions rename "gpg2" to "gpg" and it's
> not that simple to detect it's v1.  Maybe a better solution would be to
> define `epg-config--program-alist' as a normal defvar rather than
> defconst, bind it in `with-epg-tests', and find the correct gpg v1
> executable.  I'll try to write a patch later today.

I have pushed this:
http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-25&id=d4ae6d7033b34e8b75c59aaf1584131e439ef2d5

Regards,
-- 
Daiki Ueno





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

* bug#23561: epg tests are (almost) always skipped
  2016-05-19  9:12       ` Daiki Ueno
@ 2016-05-25 17:07         ` Glenn Morris
  2017-06-30  3:38           ` npostavs
  2018-07-13 12:25           ` Noam Postavsky
  0 siblings, 2 replies; 15+ messages in thread
From: Glenn Morris @ 2016-05-25 17:07 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: 23561


Thanks. Works for me on RHEL 7.2, but on hydra the tests are still skipped.

From previous investigation, they have a "gpg2" binary that is 2.0.27
and a "gpg" one that is 1.4 (?). We can see that package-test-signed is
not skipped. See eg

http://hydra.nixos.org/build/36146533/log/raw
http://hydra.nixos.org/build/36146533





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

* bug#23561: epg tests are (almost) always skipped
  2016-05-25 17:07         ` Glenn Morris
@ 2017-06-30  3:38           ` npostavs
  2017-07-07  2:10             ` npostavs
  2018-07-13 12:25           ` Noam Postavsky
  1 sibling, 1 reply; 15+ messages in thread
From: npostavs @ 2017-06-30  3:38 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Daiki Ueno, 23561

[-- Attachment #1: Type: text/plain, Size: 412 bytes --]

tags 23561 + patch
quit

Glenn Morris <rgm@gnu.org> writes:

> Thanks. Works for me on RHEL 7.2, but on hydra the tests are still skipped.
>
> From previous investigation, they have a "gpg2" binary that is 2.0.27
> and a "gpg" one that is 1.4 (?).

Since Bug#23619 is fixed, I think it's just a matter of removing the
check for gpg 1.4.3, I'll push the following in a couple of days if
there are no objections.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1495 bytes --]

From 67b8a8abc33e694ca275dff3586b605a89f07c62 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Thu, 29 Jun 2017 23:28:15 -0400
Subject: [PATCH] Don't skip epg tests (Bug#23561)

* test/lisp/epg-tests.el (with-epg-tests): Ignore REQUIRE-PASSPHRASE
parameter, since we supply the passphrase via pinentry-program for all
GPG versions (as of 2017-02-28 "Fix epg-tests with dummy-pinentry
program (Bug#23619)").
(epg-tests-program-alist-for-passphrase-callback): Remove.
---
 test/lisp/epg-tests.el | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/test/lisp/epg-tests.el b/test/lisp/epg-tests.el
index 9dd093e792..36db478801 100644
--- a/test/lisp/epg-tests.el
+++ b/test/lisp/epg-tests.el
@@ -30,17 +30,8 @@ (defvar epg-tests-data-directory
   (expand-file-name "data/epg" (getenv "EMACS_TEST_DIRECTORY"))
   "Directory containing epg test data.")
 
-(defconst epg-tests-program-alist-for-passphrase-callback
-  '((OpenPGP
-     nil
-     ("gpg" . "1.4.3"))))
-
-(defun epg-tests-find-usable-gpg-configuration (&optional require-passphrase)
-  (epg-find-configuration
-   'OpenPGP
-   'no-cache
-   (if require-passphrase
-       epg-tests-program-alist-for-passphrase-callback)))
+(defun epg-tests-find-usable-gpg-configuration (&optional _require-passphrase)
+  (epg-find-configuration 'OpenPGP 'no-cache))
 
 (defun epg-tests-passphrase-callback (_c _k _d)
   ;; Need to create a copy here, since the string will be wiped out
-- 
2.11.1


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

* bug#23561: epg tests are (almost) always skipped
  2017-06-30  3:38           ` npostavs
@ 2017-07-07  2:10             ` npostavs
  2017-07-09 23:34               ` Glenn Morris
  0 siblings, 1 reply; 15+ messages in thread
From: npostavs @ 2017-07-07  2:10 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Daiki Ueno, 23561

tags 23561 + pending
quit

npostavs@users.sourceforge.net writes:

> Since Bug#23619 is fixed, I think it's just a matter of removing the
> check for gpg 1.4.3, I'll push the following in a couple of days if
> there are no objections.

Pushed to master [1: 1eefada3f2], I'll wait to close this bug until we
actually see a successful log.

[1: 1eefada3f2]: 2017-07-06 19:54:07 -0400
  Don't skip epg tests (Bug#23561)
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1eefada3f277e533cf74bc77ecd36f42c07a96cb





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

* bug#23561: epg tests are (almost) always skipped
  2017-07-07  2:10             ` npostavs
@ 2017-07-09 23:34               ` Glenn Morris
  2017-07-11  2:04                 ` npostavs
  0 siblings, 1 reply; 15+ messages in thread
From: Glenn Morris @ 2017-07-09 23:34 UTC (permalink / raw)
  To: npostavs; +Cc: Daiki Ueno, 23561


Thanks, but the tests are still skipped. Eg

http://hydra.nixos.org/build/56062865/nixlog/1





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

* bug#23561: epg tests are (almost) always skipped
  2017-07-09 23:34               ` Glenn Morris
@ 2017-07-11  2:04                 ` npostavs
  2017-07-23  5:02                   ` npostavs
  0 siblings, 1 reply; 15+ messages in thread
From: npostavs @ 2017-07-11  2:04 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Daiki Ueno, 23561

tags 23561 = confirmed
quit

Glenn Morris <rgm@gnu.org> writes:

> Thanks, but the tests are still skipped.

Yes, the only difference left between this and the package-tests is the
'no-cache' argument, though I haven't quite worked out how the cache
gets filled for package-tests in the first place.

> Eg
>
> http://hydra.nixos.org/build/56062865/nixlog/1

That shows "(Unavailable)",
https://nix-cache.s3.amazonaws.com/log/33r5bbd5i8gdxf4p70kag5bssabl9rg0-emacs-coverage-unknown.drv
seems okay.





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

* bug#23561: epg tests are (almost) always skipped
  2017-07-11  2:04                 ` npostavs
@ 2017-07-23  5:02                   ` npostavs
  0 siblings, 0 replies; 15+ messages in thread
From: npostavs @ 2017-07-23  5:02 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Daiki Ueno, 23561

npostavs@users.sourceforge.net writes:

> Yes, the only difference left between this and the package-tests is the
> 'no-cache' argument, though I haven't quite worked out how the cache
> gets filled for package-tests in the first place.

package-test-signed calls (epg-check-configuration (epg-configuration)),
the obsolete `epg-configuration' functions fills the cache without
checking the version, and epg-check-configuration only checks against
epg-gpg-minimum-version which is "1.4.3", hence 2.0.x can satisfy it.

Then when (epg-find-configuration 'OpenPGP) is called, the cache already
has the 2.0 config in it, and so just uses that instead of rejecting
"gpg2" for being less than 2.1.6.

[1: e80c2a7b47] says that "Emacs doesn't work well with 2.0 series".
But if I understand correctly, Glenn is now seeing all the tests pass
using 2.0.22 (cf [2: 24d06313c4]), so...

[1: e80c2a7b47]: 2016-02-17 16:47:24 +0900
  Make GnuPG version check robuster
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e80c2a7b47d161f00aac096b9d58a18879a122e8

[2: 24d06313c4]: 2017-05-15 21:01:30 -0400
  Stop some epg tests failing on rhel7 with gpg 2.0.22 (bug#23619)
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=24d06313c4f205061fb74c9665d5819a05362636





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

* bug#23561: epg tests are (almost) always skipped
  2016-05-25 17:07         ` Glenn Morris
  2017-06-30  3:38           ` npostavs
@ 2018-07-13 12:25           ` Noam Postavsky
  2018-07-13 16:54             ` Glenn Morris
  1 sibling, 1 reply; 15+ messages in thread
From: Noam Postavsky @ 2018-07-13 12:25 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Daiki Ueno, 23561

Glenn Morris <rgm@gnu.org> writes:

> Thanks. Works for me on RHEL 7.2, but on hydra the tests are still skipped.
>
>>From previous investigation, they have a "gpg2" binary that is 2.0.27
> and a "gpg" one that is 1.4 (?). We can see that package-test-signed is
> not skipped. See eg
>
> http://hydra.nixos.org/build/36146533/log/raw
> http://hydra.nixos.org/build/36146533

I recently tried to fix this again [1: 1222ff5275], but it didn't work.
However, I see that package-test-signed is also skipped[2].  Does that
mean gpg isn't installed at all anymore?

[1: 1222ff5275]: 2018-07-12 21:45:30 -0400
  Don't skip epg-tests even with gpg 2.0 (Bug#23561)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1222ff5275e61e797d388489b8a88f499247321d

[2]: https://nix-cache.s3.amazonaws.com/log/pxd5kq55rryri9qncacw66qlbj6nj0q1-emacs-coverage-unknown.drv





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

* bug#23561: epg tests are (almost) always skipped
  2018-07-13 12:25           ` Noam Postavsky
@ 2018-07-13 16:54             ` Glenn Morris
  2018-07-16 11:29               ` Noam Postavsky
  0 siblings, 1 reply; 15+ messages in thread
From: Glenn Morris @ 2018-07-13 16:54 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Daiki Ueno, 23561

Noam Postavsky wrote:

> However, I see that package-test-signed is also skipped[2].  Does that
> mean gpg isn't installed at all anymore?

I don't know what the cause of [2] is, but gnupg is still installed.
See the build dependencies tab on the hydra jobset webpage, and also the
coverage buildinputs line in

https://git.savannah.gnu.org/cgit/hydra-recipes.git/tree/emacs/release.nix





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

* bug#23561: epg tests are (almost) always skipped
  2018-07-13 16:54             ` Glenn Morris
@ 2018-07-16 11:29               ` Noam Postavsky
  2018-07-24 17:47                 ` Glenn Morris
  0 siblings, 1 reply; 15+ messages in thread
From: Noam Postavsky @ 2018-07-16 11:29 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Daiki Ueno, 23561

close 23561 
quit

Glenn Morris <rgm@gnu.org> writes:

> Noam Postavsky wrote:
>
>> However, I see that package-test-signed is also skipped[2].  Does that
>> mean gpg isn't installed at all anymore?
>
> I don't know what the cause of [2] is, but gnupg is still installed.

The config check was failing due to HOME not existing (I didn't see that
locally, because I had a wrapper script to pretend to have a different
gpg version).  Fixed in [3: 10a7e91956].

Then it turns out the passphrase doesn't work for symmetric tests[4], I
assume it's some quirk of that version, so I've set those to skip [7:
7acb87ab97], [10: 4318d70677].


[3: 10a7e91956]: 2018-07-14 23:45:27 -0400
  Fix gpg detection for tests (Bug#23561)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=10a7e91956ebc5d808c88aecffb9d71a568d0233

[4]: https://nix-cache.s3.amazonaws.com/log/gjkmrr81ah59lyyi7q6ykpaiba9ps5ir-emacs-coverage-unknown.drv

[7: 7acb87ab97]: 2018-07-15 16:26:22 -0400
  Don't test symmetric operations on gpg 2.0 (Bug#23561)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=7acb87ab97082026e692e1d1d679df2313148343

[10: 4318d70677]: 2018-07-15 21:51:54 -0400
  Reject gpg 2.0 for epg configs by default (Bug#23561)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=4318d70677dedea12a3dcfb689bce71e409212f0





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

* bug#23561: epg tests are (almost) always skipped
  2018-07-16 11:29               ` Noam Postavsky
@ 2018-07-24 17:47                 ` Glenn Morris
  0 siblings, 0 replies; 15+ messages in thread
From: Glenn Morris @ 2018-07-24 17:47 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Daiki Ueno, 23561


Thanks for looking into this so thoroughly.





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

end of thread, other threads:[~2018-07-24 17:47 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-17  6:29 bug#23561: epg tests are (almost) always skipped Glenn Morris
2016-05-17  8:48 ` Daiki Ueno
2016-05-18 15:44   ` Glenn Morris
2016-05-19  1:40     ` Daiki Ueno
2016-05-19  9:12       ` Daiki Ueno
2016-05-25 17:07         ` Glenn Morris
2017-06-30  3:38           ` npostavs
2017-07-07  2:10             ` npostavs
2017-07-09 23:34               ` Glenn Morris
2017-07-11  2:04                 ` npostavs
2017-07-23  5:02                   ` npostavs
2018-07-13 12:25           ` Noam Postavsky
2018-07-13 16:54             ` Glenn Morris
2018-07-16 11:29               ` Noam Postavsky
2018-07-24 17:47                 ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).