rjbs / Dist-Zilla

scary tools for building CPAN distributions
http://dzil.org/
186 stars 152 forks source link

t/plugins/filefinders.t fails under brewed 5.26.1 on Ubuntu 17.10 64bit #609

Closed abraxxa closed 6 years ago

abraxxa commented 6 years ago

From the cpanplus i Dist::Zilla output:

t/plugins/encoding.t ............ ok
t/plugins/extratests.t .......... ok
t/plugins/fakerelease.t ......... ok
t/plugins/ffbyname.t ............ ok

#   Failed test 'GatherDir gathers all files in the source dir'
#   at t/plugins/filefinders.t line 52.
# Comparing $data as a Bag
# Missing: 'bin/another_perl_script', 'bin/test.bash', 'bin/test.pl', 'inc/Foo.pm', 'inc/Foo/Bar.pm', 'share/my_data.dat'

#   Failed test 'IncModules finds all modules'
#   at t/plugins/filefinders.t line 86.
# Comparing $data as a Bag
# Missing: 'inc/Foo.pm', 'inc/Foo/Bar.pm'

#   Failed test 'ExecFiles finds all files'
#   at t/plugins/filefinders.t line 113.
# Comparing $data as a Bag
# Missing: 'bin/another_perl_script', 'bin/test.bash', 'bin/test.pl'

#   Failed test 'PerlExecFiles finds exec files that are perl'
#   at t/plugins/filefinders.t line 124.
# Comparing $data as a Bag
# Missing: 'bin/another_perl_script', 'bin/test.pl'

#   Failed test 'ShareFiles finds all files'
#   at t/plugins/filefinders.t line 134.
# Comparing $data as a Bag
# Missing: 'share/my_data.dat'
# Looks like you failed 5 tests of 12.
t/plugins/filefinders.t ......... 
Dubious, test returned 5 (wstat 1280, 0x500)
Failed 5/12 subtests 
t/plugins/filter-b.t ............ ok
t/plugins/gatherdir.t ........... ok
t/plugins/gatherfile.t .......... ok

Output of perl -V:

[alex@alex-pc:~/perl5/git/Test-Portability-Files$ (master)]$ perl -V
Summary of my perl5 (revision 5 version 26 subversion 1) configuration:

  Platform:
    osname=linux
    osvers=4.13.0-21-generic
    archname=x86_64-linux
    uname='linux alex-pc 4.13.0-21-generic #24-ubuntu smp mon dec 18 17:29:16 utc 2017 x86_64 x86_64 x86_64 gnulinux '
    config_args='-de -Dprefix=/home/alex/perl5/perlbrew/perls/perl-5.26.1 -Aeval:scriptdir=/home/alex/perl5/perlbrew/perls/perl-5.26.1/bin'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    optimize='-O2'
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='7.2.0'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags =' -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib
    libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.26.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.26'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'

Characteristics of this binary (from libperl): 
  Compile-time options:
    HAS_TIMES
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
  Locally applied patches:
    Devel::PatchPerl 1.38
  Built under linux
  Compiled at Dec 30 2017 13:35:05
  %ENV:
    PERLBREW_HOME="/home/alex/.perlbrew"
    PERLBREW_MANPATH="/home/alex/perl5/perlbrew/perls/perl-5.26.1/man"
    PERLBREW_PATH="/home/alex/perl5/perlbrew/bin:/home/alex/perl5/perlbrew/perls/perl-5.26.1/bin"
    PERLBREW_PERL="perl-5.26.1"
    PERLBREW_ROOT="/home/alex/perl5/perlbrew"
    PERLBREW_SHELLRC_VERSION="0.82"
    PERLBREW_VERSION="0.82"
    PERL_CPANM_OPT="--mirror https://cpan.metacpan.org"
    PERL_MM_USE_DEFAULT="1"
  @INC:
    /home/alex/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/x86_64-linux
    /home/alex/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1
    /home/alex/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1/x86_64-linux
    /home/alex/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1
karenetheridge commented 6 years ago

Can you try running tests again with PERL_USE_UNSAFE_INC=1?

abraxxa commented 6 years ago

Still fails:

[alex@alex-pc:~/.cpanm/work/1514716561.11624/Dist-Zilla-6.010$ ]$ env | grep PERL_USE_UNSAFE_INC
PERL_USE_UNSAFE_INC=1
[alex@alex-pc:~/.cpanm/work/1514716561.11624/Dist-Zilla-6.010$ ]$ prove -vl t/plugins/filefinders.t 
t/plugins/filefinders.t .. 
not ok 1 - GatherDir gathers all files in the source dir
ok 2 - all files found were in manifest
ok 3 - all files in manifest were on disk
ok 4 - InstallModules finds all modules
not ok 5 - IncModules finds all modules
#   Failed test 'GatherDir gathers all files in the source dir'
#   at t/plugins/filefinders.t line 52.
# Comparing $data as a Bag
# Missing: 'bin/another_perl_script', 'bin/test.bash', 'bin/test.pl', 'inc/Foo.pm', 'inc/Foo/Bar.pm', 'share/my_data.dat'
#   Failed test 'IncModules finds all modules'
#   at t/plugins/filefinders.t line 86.
# Comparing $data as a Bag
# Missing: 'inc/Foo.pm', 'inc/Foo/Bar.pm'
ok 6 - TestFiles finds all files
ok 7 - ExtraTestFiles finds all files in xt
not ok 8 - ExecFiles finds all files
#   Failed test 'ExecFiles finds all files'
#   at t/plugins/filefinders.t line 113.
# Comparing $data as a Bag
# Missing: 'bin/another_perl_script', 'bin/test.bash', 'bin/test.pl'
not ok 9 - PerlExecFiles finds exec files that are perl
#   Failed test 'PerlExecFiles finds exec files that are perl'
#   at t/plugins/filefinders.t line 124.
# Comparing $data as a Bag
# Missing: 'bin/another_perl_script', 'bin/test.pl'
not ok 10 - ShareFiles finds all files
#   Failed test 'ShareFiles finds all files'
#   at t/plugins/filefinders.t line 134.
# Comparing $data as a Bag
# Missing: 'share/my_data.dat'
ok 11 - :AllFiles finds all files
ok 12 - :NoFiles finds no files
1..12
# Looks like you failed 5 tests of 12.
Dubious, test returned 5 (wstat 1280, 0x500)
Failed 5/12 subtests 

Test Summary Report
-------------------
t/plugins/filefinders.t (Wstat: 1280 Tests: 12 Failed: 5)
  Failed tests:  1, 5, 8-10
  Non-zero exit status: 5
Files=1, Tests=12,  0 wallclock secs ( 0.01 usr  0.00 sys +  0.47 cusr  0.03 csys =  0.51 CPU)
Result: FAIL
karenetheridge commented 6 years ago

I'm afraid you'll probably have to diagnose the cause yourself -- it would be difficult to do this without being able to reproduce it locally. It might be due to a recent change in another cpan module that is used as a dependency?

jmaslak commented 6 years ago

I didn't have time to figure out what is happening, and would love a hint. :)

(I had the same issue on OpenBSD using a perlbrew created Perl 5.26.1)

I was able to get it to build by changing several lines of filefinders.t. Namely:

24 root => '../corpus/dist/DZT_Inc',

to:

24 root => '../../../corpus/dist/DZT_Inc',

And similar relative path changes on lines 28 (DZT_Bin) and 32 (DZT_Share).

It also worked if I used absolute paths there.

It seems like it is building this path relative to the temp directory set up during the test run.

jmaslak commented 6 years ago

Found it. File::Copy::Recursive 0.38 worked fine. 0.39 (released last month) doesn't.

Temporary workaround if anyone gets bit by this (and anyone installing Dist::Zilla without F::C::R already installed will get bit by it) is to install File::Copy::Recursive 0.38 until this gets fixed there.

I put an issue in F::C::R's bug tracker: https://github.com/drmuey/p5-File-Copy-Recursive/issues/5

abraxxa commented 6 years ago

Thank you very much for your efforts to debug this!

jmaslak commented 6 years ago

I've also now submitted a PR to fix the issue in the upstream module: https://github.com/drmuey/p5-File-Copy-Recursive/pull/6

jmaslak commented 6 years ago

File::Copy::Recursive merged the PR mentioned above. I believe, if F::C::R is updated, this issue is solved for anyone experiencing it.

abraxxa commented 6 years ago

I can confirm that the Dist::Zilla 6.010 tests pass with File::Copy::Recursive 0.40.