Skip Menu |

This queue is for tickets about the GnuPG-Interface CPAN distribution.

Report information
The Basics
Id: 50348
Status: resolved
Priority: 0/
Queue: GnuPG-Interface

People
Owner: Nobody in particular
Requestors: salvatore.bonaccorso [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.42
Fixed in: (no value)



Subject: FTBFS when compiling "non-interactively"
Hi I'm forwarding a bug reported in the Debian distribution: http://bugs.debian.org/549743 GnuPG-Interface can FTBFS, when building noninteractively. How to I was able to reproduce the above bugreport from Lucas Nussbaum: Run an 'at' job for the build. ---(snip)--- PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t t/clearsign.t .............. ok t/decrypt.t ................ ok t/detach_sign.t ............ ok gpg: WARNING: unsafe permissions on homedir `test' gpg: cannot open `/dev/tty': No such device or address t/encrypt.t ................ Failed 1/3 subtests t/encrypt_symmetrically.t .. ok t/export_keys.t ............ ok t/Fingerprint.t ............ ok gpg: WARNING: unsafe permissions on homedir `test' gpg: cannot open `/dev/tty': No such device or address Can't call method "subkeys" on an undefined value at t/get_public_keys.t line 85. t/get_public_keys.t ........ Dubious, test returned 2 (wstat 512, 0x200) Failed 3/3 subtests gpg: WARNING: unsafe permissions on homedir `test' gpg: cannot open `/dev/tty': No such device or address Can't call method "compare" on an undefined value at t/get_secret_keys.t line 65. t/get_secret_keys.t ........ Dubious, test returned 2 (wstat 512, 0x200) Failed 2/2 subtests t/import_keys.t ............ ok t/Interface.t .............. ok t/list_public_keys.t ....... ok t/list_secret_keys.t ....... ok t/list_sigs.t .............. ok gpg: WARNING: unsafe permissions on homedir `test' t/passphrase_handling.t .... ok t/sign.t ................... ok t/sign_and_encrypt.t ....... ok t/UserId.t ................. ok t/verify.t ................. ok t/wrap_call.t .............. ok Test Summary Report ------------------- t/encrypt.t (Wstat: 0 Tests: 3 Failed: 1) Failed test: 2 t/get_public_keys.t (Wstat: 512 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 2 Parse errors: Bad plan. You planned 3 tests but ran 1. t/get_secret_keys.t (Wstat: 512 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 2 Parse errors: Bad plan. You planned 2 tests but ran 1. Files=20, Tests=48, 1 wallclock secs ( 0.05 usr 0.01 sys + 1.62 cusr 0.25 csys = 1.93 CPU) Result: FAIL Failed 3/20 test programs. 3/48 subtests failed. ---(snap)--- Bests Salvatore
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #50348] FTBFS when compiling "non-interactively"
Date: Fri, 9 Oct 2009 11:44:07 -0400
To: "https://launchpad.net/~carnil via RT" <bug-GnuPG-Interface [...] rt.cpan.org>
From: jesse <jesse [...] fsck.com>
Show quoted text
> GnuPG-Interface can FTBFS, when building noninteractively.
What does "FTBFS" mean? Show quoted text
> > How to I was able to reproduce the above bugreport from Lucas Nussbaum: > > Run an 'at' job for the build.
Can you please tell me a bit more about what versions of Perl, GPG and the module you're trying to use? Show quoted text
> > ---(snip)--- > PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" > "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t > t/clearsign.t .............. ok > t/decrypt.t ................ ok > t/detach_sign.t ............ ok > gpg: WARNING: unsafe permissions on homedir `test' > gpg: cannot open `/dev/tty': No such device or address > t/encrypt.t ................ > Failed 1/3 subtests > t/encrypt_symmetrically.t .. ok > t/export_keys.t ............ ok > t/Fingerprint.t ............ ok > gpg: WARNING: unsafe permissions on homedir `test' > gpg: cannot open `/dev/tty': No such device or address > Can't call method "subkeys" on an undefined value at t/get_public_keys.t > line 85. > t/get_public_keys.t ........ > Dubious, test returned 2 (wstat 512, 0x200) > Failed 3/3 subtests > gpg: WARNING: unsafe permissions on homedir `test' > gpg: cannot open `/dev/tty': No such device or address > Can't call method "compare" on an undefined value at t/get_secret_keys.t > line 65. > t/get_secret_keys.t ........ > Dubious, test returned 2 (wstat 512, 0x200) > Failed 2/2 subtests > t/import_keys.t ............ ok > t/Interface.t .............. ok > t/list_public_keys.t ....... ok > t/list_secret_keys.t ....... ok > t/list_sigs.t .............. ok > gpg: WARNING: unsafe permissions on homedir `test' > t/passphrase_handling.t .... ok > t/sign.t ................... ok > t/sign_and_encrypt.t ....... ok > t/UserId.t ................. ok > t/verify.t ................. ok > t/wrap_call.t .............. ok > > Test Summary Report > ------------------- > t/encrypt.t (Wstat: 0 Tests: 3 Failed: 1) > Failed test: 2 > t/get_public_keys.t (Wstat: 512 Tests: 1 Failed: 1) > Failed test: 1 > Non-zero exit status: 2 > Parse errors: Bad plan. You planned 3 tests but ran 1. > t/get_secret_keys.t (Wstat: 512 Tests: 1 Failed: 1) > Failed test: 1 > Non-zero exit status: 2 > Parse errors: Bad plan. You planned 2 tests but ran 1. > Files=20, Tests=48, 1 wallclock secs ( 0.05 usr 0.01 sys + 1.62 cusr > 0.25 csys = 1.93 CPU) > Result: FAIL > Failed 3/20 test programs. 3/48 subtests failed. > ---(snap)--- > > Bests > Salvatore >
--
Subject: Re: [rt.cpan.org #50348] FTBFS when compiling "non-interactively"
Date: Fri, 9 Oct 2009 18:16:55 +0200
To: Jesse via RT <bug-GnuPG-Interface [...] rt.cpan.org>
From: Salvatore Bonaccorso <salvatore.bonaccorso [...] gmail.com>
Hi Jesse! I'm sorry that I was that unspecific! Here I provide more information, thanks for looking into it. On Fri, Oct 09, 2009 at 11:44:18AM -0400, Jesse via RT wrote: Show quoted text
> > GnuPG-Interface can FTBFS, when building noninteractively.
> > What does "FTBFS" mean?
Fails to build from source, sorry it was in my mind ... Show quoted text
> > How to I was able to reproduce the above bugreport from Lucas Nussbaum: > > > > Run an 'at' job for the build.
> > Can you please tell me a bit more about what versions of Perl, GPG and > the module you're trying to use?
Yes here I try. Perl: 5.10.1 GnuPG: 1.4.10 GnuPG-Interface: 0.42 (all from Debian unstable). If I should provide some more information, please let me know. I just noticed that the previous released version 0.38 workes fine to build. Please note that GnuPG-Interface fails also only if I start the build "noninteractiverly" via a 'at' job, and thus the tests complain about that gpg cannot open /dev/tty. But this is a common environment from Debian build-Daemons. If I can provide more information, please let me know. Many thanks for the fast reaction and looking into it! Bests Salvatore
Download signature.asc
application/pgp-signature 836b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #50348] FTBFS when compiling "non-interactively"
Date: Mon, 12 Oct 2009 14:40:37 -0400
To: Salvatore Bonaccorso via RT <bug-GnuPG-Interface [...] rt.cpan.org>
From: jesse <jesse [...] fsck.com>
Salvatore, So, I'm not the original author of GnuPG::Interface, just its caretaker. It looks like the original code is specifically testing gnupg's ability to read from /dev/tty as part of the test suite. I'd happily take a patch, but at fist glance, I'm not sure what the "right" fix is. Best, Jesse On Fri, Oct 09, 2009 at 12:17:19PM -0400, Salvatore Bonaccorso via RT wrote: Show quoted text
> Queue: GnuPG-Interface > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=50348 > > > Hi Jesse! > > I'm sorry that I was that unspecific! Here I provide more information, > thanks for looking into it. > > On Fri, Oct 09, 2009 at 11:44:18AM -0400, Jesse via RT wrote:
> > > GnuPG-Interface can FTBFS, when building noninteractively.
> > > > What does "FTBFS" mean?
> > Fails to build from source, sorry it was in my mind ... >
> > > How to I was able to reproduce the above bugreport from Lucas Nussbaum: > > > > > > Run an 'at' job for the build.
> > > > Can you please tell me a bit more about what versions of Perl, GPG and > > the module you're trying to use?
> > Yes here I try. > > Perl: 5.10.1 > GnuPG: 1.4.10 > GnuPG-Interface: 0.42 > (all from Debian unstable). > > If I should provide some more information, please let me know. > > I just noticed that the previous released version 0.38 workes fine to > build. Please note that GnuPG-Interface fails also only if I start the > build "noninteractiverly" via a 'at' job, and thus the tests complain > about that gpg cannot open /dev/tty. But this is a common environment > from Debian build-Daemons. > > If I can provide more information, please let me know. Many thanks for > the fast reaction and looking into it! > > Bests > Salvatore >
--
CC: 549743-maintonly [...] bugs.debian.org
Subject: Re: [rt.cpan.org #50348] FTBFS when compiling "non-interactively"
Date: Sun, 1 Nov 2009 22:15:36 +0100
To: Jesse via RT <bug-GnuPG-Interface [...] rt.cpan.org>
From: Salvatore Bonaccorso <salvatore.bonaccorso [...] gmail.com>
Hi Jesse I'm cc'ing the Debian bugreport (http://bugs.debian.org/549743). On Mon, Oct 12, 2009 at 02:40:50PM -0400, Jesse via RT wrote: Show quoted text
> So, I'm not the original author of GnuPG::Interface, just its > caretaker. It looks like the original code is specifically testing > gnupg's ability to read from /dev/tty as part of the test suite. > > I'd happily take a patch, but at fist glance, I'm not sure what the > "right" fix is.
Yes you are right! It is on line 89 of lib/GnuPG/Options. If one sets ---(diff)--------------------------------------------------------------- --- lib/GnuPG/Options.pm (revision 46640) +++ lib/GnuPG/Options.pm (working copy) @@ -86,7 +86,7 @@ sub BUILD { my ( $self, $args ) = @_; - $self->hash_init( meta_interactive => 1 ); + $self->hash_init( meta_interactive => 0 ); $self->hash_init(%$args); } ------------------------------------------------------------------------ then the build works. Thus: What would be about the following? ---(patch)-------------------------------------------------------------- --- t/MyTestSpecific.pm (revision 46640) +++ t/MyTestSpecific.pm (working copy) @@ -26,6 +26,8 @@ use GnuPG::Interface; use GnuPG::Handles; +use Any::Moose; + use vars qw( @ISA @EXPORT $stdin $stdout $stderr $gpg_program $handles $gnupg @@ -38,6 +40,11 @@ texts file_match ); +sub BUILD { + my ( $self, $args ) = @_; + $self->hash_init( meta_interactive => 0 ); + $self->hash_init(%$args); +} for my $gpg qw(gpg gpg2) { my $gpg_find = "which $gpg"; ------------------------------------------------------------------------ Thanks to Gregor Hermann helping investigating! Bests Salvatore
Download signature.asc
application/pgp-signature 836b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #50348] FTBFS when compiling "non-interactively"
Date: Sun, 1 Nov 2009 22:20:20 +0100
To: Jesse via RT <bug-GnuPG-Interface [...] rt.cpan.org>
From: Salvatore Bonaccorso <salvatore.bonaccorso [...] gmail.com>
Show quoted text
> +use Any::Moose; > +
^^^^ and noticing that this is clearly not needed since already in GnuPG::Interface clearly, sorry.
Download signature.asc
application/pgp-signature 836b

Message body not shown because it is not plain text.

From: salvatore.bonaccorso [...] gmail.com
Hi Jesse On Sun Nov 01 16:16:00 2009, salvatore.bonaccorso@gmail.com wrote: ---(patch)-------------------------------------------------------------- Show quoted text
> --- t/MyTestSpecific.pm (revision 46640) > +++ t/MyTestSpecific.pm (working copy) > @@ -26,6 +26,8 @@ > use GnuPG::Interface; > use GnuPG::Handles; > > +use Any::Moose; > + > use vars qw( @ISA @EXPORT > $stdin $stdout $stderr > $gpg_program $handles $gnupg > @@ -38,6 +40,11 @@ > texts file_match > ); > > +sub BUILD { > + my ( $self, $args ) = @_; > + $self->hash_init( meta_interactive => 0 ); > + $self->hash_init(%$args); > +} > > for my $gpg qw(gpg gpg2) { > my $gpg_find = "which $gpg"; > ------------------------------------------------------------------------
Hmm no, indeed the proposed will unfortunately not work. Any ideas? Bests Salvatore
The problem is in the copy() method of GnuPG::Options. It doesn't check for 'defined', so won't copy across false values. This is normally fine, except in the case of meta_immutable, where the default is true, not false. The attached patch is what we've applied in Debian, and fixes the build error. Regards, Tim
Description: Fix copy method of GnuPG::Options. The result of not checking for definedness here is to never copy the meta_immutable value successfully (as that is true by default). This led to a FTBFS when running non-interactively. Author: Tim Retout <tim@retout.co.uk> Bug-Debian: http://bugs.debian.org/549743 --- a/lib/GnuPG/Options.pm +++ b/lib/GnuPG/Options.pm @@ -97,7 +97,7 @@ foreach my $field ( BOOLEANS, SCALARS, LISTS ) { my $value = $self->$field(); - next unless $value; + next unless defined $value; $new->$field($value); }
On Thu Nov 05 19:33:23 2009, DIOCLES wrote: Show quoted text
> This is normally fine, except in the case of meta_immutable, where the
Er, meta_interactive. Dammit! I keep getting that wrong. :)
On 2009-11-05T19:33:23-05:00, DIOCLES wrote: Show quoted text
> The attached patch is what we've applied in Debian, and fixes the > build error.
This was included in 0.43 and up. - Alex