Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.98k stars 560 forks source link

tests fail if PERL_JSON_BACKEND env var set #12081

Closed p5pRT closed 12 years ago

p5pRT commented 12 years ago

Migrated from rt.perl.org#112750 (status was 'resolved')

Searchable as RT112750$

p5pRT commented 12 years ago

From @rjbs

Created by @rjbs

On any(?) platform\, if PERL_JSON_BACKEND or PERL_YAML_BACKEND is set\, the core tests will fail when trying parse CPAN metafiles. This env var may be set for other reasons\, unbeknownst to the user\, and we should be clearing it during testing or at least alerting the user to unset it before building.

Perl Info ``` Flags: category=core severity=high Site configuration information for perl 5.15.9: Configured by rjbs at Tue Mar 20 15:40:48 EDT 2012. Summary of my perl5 (revision 5 version 15 subversion 9) configuration: Platform: osname=darwin, osvers=11.3.0, archname=darwin-2level uname='darwin walrus.local 11.3.0 darwin kernel version 11.3.0: thu jan 12 18:47:41 pst 2012; root:xnu-1699.24.23~1release_x86_64 x86_64 ' config_args='-de -Dprefix=/Users/rjbs/perl5/perlbrew/perls/15.9 -Dusedevel' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include', optimize='-O3', cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include' ccversion='', gccversion='4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib -L/opt/local/lib' libpth=/usr/local/lib /opt/local/lib /usr/lib libs=-lgdbm -ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=, so=dylib, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib -fstack-protector' Locally applied patches: @INC for perl 5.15.9: /Users/rjbs/.perlbrew/libs/15.9@std/lib/perl5/darwin-2level /Users/rjbs/.perlbrew/libs/15.9@std/lib/perl5/darwin-2level /Users/rjbs/.perlbrew/libs/15.9@std/lib/perl5 /Users/rjbs/perl5/perlbrew/perls/15.9/lib/site_perl/5.15.9/darwin-2level /Users/rjbs/perl5/perlbrew/perls/15.9/lib/site_perl/5.15.9 /Users/rjbs/perl5/perlbrew/perls/15.9/lib/5.15.9/darwin-2level /Users/rjbs/perl5/perlbrew/perls/15.9/lib/5.15.9 . Environment for perl 5.15.9: DYLD_LIBRARY_PATH (unset) HOME=/Users/rjbs LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/Users/rjbs/.perlbrew/libs/15.9@std/bin:/Users/rjbs/perl5/perlbrew/bin:/Users/rjbs/perl5/perlbrew/perls/15.9/bin:/Users/rjbs/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/Users/rjbs/code/hla PERL5LIB=/Users/rjbs/.perlbrew/libs/15.9@std/lib/perl5/darwin-2level:/Users/rjbs/.perlbrew/libs/15.9@std/lib/perl5 PERLBREW_BASHRC_VERSION=0.41 PERLBREW_HOME=/Users/rjbs/.perlbrew PERLBREW_LIB=std PERLBREW_MANPATH=/Users/rjbs/.perlbrew/libs/15.9@std/man:/Users/rjbs/perl5/perlbrew/perls/15.9/man PERLBREW_PATH=/Users/rjbs/.perlbrew/libs/15.9@std/bin:/Users/rjbs/perl5/perlbrew/bin:/Users/rjbs/perl5/perlbrew/perls/15.9/bin PERLBREW_PERL=15.9 PERLBREW_ROOT=/Users/rjbs/perl5/perlbrew PERLBREW_VERSION=0.41 PERLDOC=-n/opt/local/bin/groff PERL_AUTOINSTALL=--skipdeps PERL_BADLANG (unset) PERL_LOCAL_LIB_ROOT=/Users/rjbs/.perlbrew/libs/15.9@std PERL_MB_OPT=--install_base /Users/rjbs/.perlbrew/libs/15.9@std PERL_MM_OPT=INSTALL_BASE=/Users/rjbs/.perlbrew/libs/15.9@std SHELL=/opt/local/bin/zsh ```
p5pRT commented 12 years ago

From @xdg

On Thu\, May 3\, 2012 at 10​:28 PM\, Ricardo SIGNES \perlbug\-followup@​perl\.org wrote​:

On any(?) platform\, if PERL_JSON_BACKEND or PERL_YAML_BACKEND is set\, the core tests will fail when trying parse CPAN metafiles.  This env var may be set for other reasons\, unbeknownst to the user\, and we should be clearing it during testing or at least alerting the user to unset it before building.

Which tests for which modules? I've already been whacking away at localizing those during most testing where it matters\, but it may have been after the code freeze.

-- David

p5pRT commented 12 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 12 years ago

From @rjbs

  ../cpan/CPANPLUS/t/04_CPANPLUS-Module.t   ../cpan/CPANPLUS/t/20_CPANPLUS-Dist-MM.t   ../cpan/ExtUtils-Constant/t/Constant.t   ../cpan/ExtUtils-MakeMaker/t/FIRST_MAKEFILE.t   ../cpan/ExtUtils-MakeMaker/t/INST.t   ../cpan/ExtUtils-MakeMaker/t/INSTALL_BASE.t   ../cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t   ../cpan/ExtUtils-MakeMaker/t/PL_FILES.t   ../cpan/ExtUtils-MakeMaker/t/VERSION_FROM.t   ../cpan/ExtUtils-MakeMaker/t/WriteEmptyMakefile.t   ../cpan/ExtUtils-MakeMaker/t/basic.t   ../cpan/ExtUtils-MakeMaker/t/build_man.t   ../cpan/ExtUtils-MakeMaker/t/meta_convert.t   ../cpan/ExtUtils-MakeMaker/t/metafile_data.t   ../cpan/ExtUtils-MakeMaker/t/min_perl_version.t   ../cpan/ExtUtils-MakeMaker/t/miniperl.t   ../cpan/ExtUtils-MakeMaker/t/pm.t   ../cpan/ExtUtils-MakeMaker/t/pm_to_blib.t   ../cpan/ExtUtils-MakeMaker/t/postamble.t   ../cpan/ExtUtils-MakeMaker/t/prereq.t   ../cpan/ExtUtils-MakeMaker/t/recurs.t   ../cpan/ExtUtils-MakeMaker/t/several_authors.t   ../cpan/ExtUtils-MakeMaker/t/writemakefile_args.t   ../cpan/ExtUtils-MakeMaker/t/xs.t   ../cpan/Module-Build/t/compat.t   ../cpan/Module-Build/t/metadata2.t   ../cpan/Module-Build/t/mymeta.t   ../cpan/Module-Build/t/runthrough.t   ../cpan/Module-Build/t/script_dist.t   ../dist/ExtUtils-Install/t/InstallWithMM.t

p5pRT commented 12 years ago

From @xdg

On Fri\, May 4\, 2012 at 7​:15 AM\, David Golden \xdaveg@​gmail\.com wrote​:

On Thu\, May 3\, 2012 at 10​:28 PM\, Ricardo SIGNES \perlbug\-followup@​perl\.org wrote​:

On any(?) platform\, if PERL_JSON_BACKEND or PERL_YAML_BACKEND is set\, the core tests will fail when trying parse CPAN metafiles.  This env var may be set for other reasons\, unbeknownst to the user\, and we should be clearing it during testing or at least alerting the user to unset it before building.

Which tests for which modules?  I've already been whacking away at localizing those during most testing where it matters\, but it may have been after the code freeze.

c.f. https://metacpan.org/diff/release/DAGOLDEN/Parse-CPAN-Meta-1.4402/DAGOLDEN/Parse-CPAN-Meta-1.4404

A more aggressive option would be to modify Parse​::CPAN​::Meta itself (the .pm) to ignore PERL_(YAML|JSON)_BACKEND if PERL_CORE is set. That's a little gross\, since it leaves a perl compile-time env variable test in the final code\, but it would be a single point to bypass those issues entirely.

p5pRT commented 12 years ago

From @nwc10

On Fri\, May 04\, 2012 at 10​:05​:34AM -0400\, David Golden wrote​:

c.f. https://metacpan.org/diff/release/DAGOLDEN/Parse-CPAN-Meta-1.4402/DAGOLDEN/Parse-CPAN-Meta-1.4404

A more aggressive option would be to modify Parse​::CPAN​::Meta itself (the .pm) to ignore PERL_(YAML|JSON)_BACKEND if PERL_CORE is set. That's a little gross\, since it leaves a perl compile-time env variable test in the final code\, but it would be a single point to bypass those issues entirely.

Maybe better to add them to this bit of t/TEST (line 94 onwards) which zaps environment variables​:

# delete env vars that may influence the results # but allow override via *_TEST env var if wanted # (e.g. PERL5OPT_TEST=-d​:NYTProf) for my $envname (qw(PERL5LIB PERLLIB PERL5OPT)) {   my $override = $ENV{"${envname}_TEST"};   if (defined $override) {   warn "$0​: $envname=$override\n";   $ENV{$envname} = $override;   }   else {   delete $ENV{$envname};   } }

That code is also run by t/harness

Nicholas Clark

p5pRT commented 12 years ago

From @cpansprout

Fixed in commit b664668356.

p5pRT commented 12 years ago

@cpansprout - Status changed from 'open' to 'resolved'

p5pRT commented 12 years ago

@rjbs - Status changed from 'resolved' to 'open'

p5pRT commented 12 years ago

From @rjbs

On Fri May 04 09​:54​:42 2012\, sprout wrote​:

Fixed in commit b664668356.

...but we're not done thinking about what Nick suggested.

p5pRT commented 12 years ago

From @rjbs

On Fri May 04 10​:38​:49 2012\, rjbs wrote​:

On Fri May 04 09​:54​:42 2012\, sprout wrote​:

Fixed in commit b664668356.

...but we're not done thinking about what Nick suggested.

Apparently the bugfix that went in isn't the one we talked about\, it's the better one that Nick suggested. Fantastic!

p5pRT commented 12 years ago

@rjbs - Status changed from 'open' to 'resolved'