Special_K has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to install Devel::NYTProf under Cygwin using CPANM and am seeing the following failure in the build log:

t/44-model.t ............. ok # Failed test '$! should not be altered by NYTProf i/o' # at t/50-errno.t line 58. # got: '0' # expected: '3' # Looks like you failed 1 test of 8. t/50-errno.t ............. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/8 subtests

How do I fix this? Here is the complete (collapsed) build log:

cpanm (App::cpanminus) 1.7044 on perl 5.032001 built for x86_64-cygwin +-threads-multi Work directory is /home/user/.cpanm/work/1629329450.307 You have make /usr/bin/make You have LWP 6.55 You have /usr/bin/tar: tar (GNU tar) 1.34 Packaged by Cygwin (1.34-1) Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/g +pl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. Searching Devel::NYTProf () on cpanmetadb ... --> Working on Devel::NYTProf Fetching http://www.cpan.org/authors/id/J/JK/JKEENAN/Devel-NYTProf-6.1 +0.tar.gz -> OK Unpacking Devel-NYTProf-6.10.tar.gz Entering Devel-NYTProf-6.10 Checking configure dependencies from META.json Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.62) Configuring Devel-NYTProf-6.10 Running Makefile.PL Looking for header files and functions... Found clock_gettime in time.h Found deflateInit2 in zlib.h Your perl was compiled with gcc (version 10.2.0), okay. Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for Devel::NYTProf Writing MYMETA.yml and MYMETA.json -> OK Checking dependencies from MYMETA.json ... Checking if you have XSLoader 0 ... Yes (0.30) Checking if you have File::Which 1.09 ... Yes (1.27) Checking if you have JSON::MaybeXS 0 ... Yes (1.004003) Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.62) Checking if you have List::Util 0 ... Yes (1.56) Checking if you have Capture::Tiny 0 ... Yes (0.48) Checking if you have Getopt::Long 0 ... Yes (2.51) Checking if you have Test::More 0.84 ... Yes (1.302185) Checking if you have Test::Differences 0.60 ... Yes (0.68) Building and testing Devel-NYTProf-6.10 cp lib/Devel/NYTProf/Test.pm blib/lib/Devel/NYTProf/Test.pm cp lib/Devel/NYTProf/Constants.pm blib/lib/Devel/NYTProf/Constants.pm cp lib/Devel/NYTProf/Apache.pm blib/lib/Devel/NYTProf/Apache.pm cp lib/Devel/NYTProf/FileHandle.pm blib/lib/Devel/NYTProf/FileHandle.p +m cp lib/Devel/NYTProf/js/jit/gradient-cushion1.png blib/lib/Devel/NYTPr +of/js/jit/gradient-cushion1.png cp lib/Devel/NYTProf/js/asc.png blib/lib/Devel/NYTProf/js/asc.png cp lib/Devel/NYTProf/Run.pm blib/lib/Devel/NYTProf/Run.pm cp lib/Devel/NYTProf/js/jit/gradient40.png blib/lib/Devel/NYTProf/js/j +it/gradient40.png cp lib/Devel/NYTProf/js/jit/gradient20.png blib/lib/Devel/NYTProf/js/j +it/gradient20.png cp lib/Devel/NYTProf/SubCallInfo.pm blib/lib/Devel/NYTProf/SubCallInfo +.pm cp lib/Devel/NYTProf/js/jquery.floatThead.min.js blib/lib/Devel/NYTPro +f/js/jquery.floatThead.min.js cp lib/Devel/NYTProf/js/jit/gradient.png blib/lib/Devel/NYTProf/js/jit +/gradient.png cp lib/Devel/NYTProf/js/jquery.tablesorter.min.js blib/lib/Devel/NYTPr +of/js/jquery.tablesorter.min.js cp lib/Devel/NYTProf/Util.pm blib/lib/Devel/NYTProf/Util.pm cp lib/Devel/NYTProf/ReadStream.pm blib/lib/Devel/NYTProf/ReadStream.p +m cp lib/Devel/NYTProf/js/jit/gradient30.png blib/lib/Devel/NYTProf/js/j +it/gradient30.png cp lib/Devel/NYTProf/Core.pm blib/lib/Devel/NYTProf/Core.pm cp lib/Devel/NYTProf/Reader.pm blib/lib/Devel/NYTProf/Reader.pm cp lib/Devel/NYTProf.pm blib/lib/Devel/NYTProf.pm cp lib/Devel/NYTProf/js/jit/jit-yc.js blib/lib/Devel/NYTProf/js/jit/ji +t-yc.js cp lib/Devel/NYTProf/js/jit/jit.js blib/lib/Devel/NYTProf/js/jit/jit.j +s cp lib/Devel/NYTProf/js/desc.png blib/lib/Devel/NYTProf/js/desc.png cp lib/Devel/NYTProf/js/jit/Treemap.css blib/lib/Devel/NYTProf/js/jit/ +Treemap.css cp lib/Devel/NYTProf/FileInfo.pm blib/lib/Devel/NYTProf/FileInfo.pm cp lib/Devel/NYTProf/SubInfo.pm blib/lib/Devel/NYTProf/SubInfo.pm cp lib/Devel/NYTProf/Data.pm blib/lib/Devel/NYTProf/Data.pm cp lib/Devel/NYTProf/js/jit/gradient50.png blib/lib/Devel/NYTProf/js/j +it/gradient50.png cp lib/Devel/NYTProf/js/bg.png blib/lib/Devel/NYTProf/js/bg.png cp lib/Devel/NYTProf/js/style-tablesorter.css blib/lib/Devel/NYTProf/j +s/style-tablesorter.css cp lib/Devel/NYTProf/js/jquery-min.js blib/lib/Devel/NYTProf/js/jquery +-min.js cp MemoryProfiling.pod blib/lib/Devel/MemoryProfiling.pod Running Mkbootstrap for NYTProf () chmod 644 "NYTProf.bs" "/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- NYTPro +f.bs blib/arch/auto/Devel/NYTProf/NYTProf.bs 644 "/usr/bin/perl.exe" "/usr/share/perl5/5.32/ExtUtils/xsubpp" -typemap +'/usr/share/perl5/5.32/ExtUtils/typemap' -typemap '/home/user/.cpanm/ +work/1629329450.307/Devel-NYTProf-6.10/typemap' FileHandle.xs > File +Handle.xsc mv FileHandle.xsc FileHandle.c gcc -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -ggdb +-O2 -pipe -Wall -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-p +rotector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/mnt/sha +re/cygpkgs/perl/perl.x86_64/build=/usr/src/debug/perl-5.32.1-1 -fdebu +g-prefix-map=/mnt/share/cygpkgs/perl/perl.x86_64/src/perl-5.32.1=/usr +/src/debug/perl-5.32.1-1 -fwrapv -fno-strict-aliasing -DUSEIMPORTLIB +-O3 -DVERSION=\"6.10\" -DXS_VERSION=\"6.10\" "-I/usr/lib/perl5/5.3 +2/x86_64-cygwin-threads/CORE" -DHAS_CLOCK_GETTIME -DHAS_ZLIB -W -Wal +l -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare +-Wno-cast-qual FileHandle.c "/usr/bin/perl.exe" "/usr/share/perl5/5.32/ExtUtils/xsubpp" -typemap +'/usr/share/perl5/5.32/ExtUtils/typemap' -typemap '/home/user/.cpanm/ +work/1629329450.307/Devel-NYTProf-6.10/typemap' NYTProf.xs > NYTProf +.xsc mv NYTProf.xsc NYTProf.c gcc -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -ggdb +-O2 -pipe -Wall -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-p +rotector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/mnt/sha +re/cygpkgs/perl/perl.x86_64/build=/usr/src/debug/perl-5.32.1-1 -fdebu +g-prefix-map=/mnt/share/cygpkgs/perl/perl.x86_64/src/perl-5.32.1=/usr +/src/debug/perl-5.32.1-1 -fwrapv -fno-strict-aliasing -DUSEIMPORTLIB +-O3 -DVERSION=\"6.10\" -DXS_VERSION=\"6.10\" "-I/usr/lib/perl5/5.3 +2/x86_64-cygwin-threads/CORE" -DHAS_CLOCK_GETTIME -DHAS_ZLIB -W -Wal +l -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare +-Wno-cast-qual NYTProf.c rm -f blib/arch/auto/Devel/NYTProf/NYTProf.dll g++ --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,- +-enable-auto-image-base -fstack-protector-strong FileHandle.o NYTPro +f.o -o blib/arch/auto/Devel/NYTProf/NYTProf.dll \ /usr/lib/perl5/5.32/x86_64-cygwin-threads/CORE/cygperl5_32.dll -lrt +-lz \ chmod 755 blib/arch/auto/Devel/NYTProf/NYTProf.dll cp blib/arch/auto/Devel/NYTProf/NYTProf.dll blib/lib/Devel/auto/Devel/ +NYTProf/NYTProf.dll cp bin/flamegraph.pl blib/script/flamegraph.pl "/usr/bin/perl.exe" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/scrip +t/flamegraph.pl cp bin/nytprofcalls blib/script/nytprofcalls "/usr/bin/perl.exe" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/scrip +t/nytprofcalls cp bin/nytprofcg blib/script/nytprofcg "/usr/bin/perl.exe" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/scrip +t/nytprofcg cp bin/nytprofcsv blib/script/nytprofcsv "/usr/bin/perl.exe" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/scrip +t/nytprofcsv cp bin/nytprofhtml blib/script/nytprofhtml "/usr/bin/perl.exe" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/scrip +t/nytprofhtml cp bin/nytprofmerge blib/script/nytprofmerge "/usr/bin/perl.exe" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/scrip +t/nytprofmerge cp bin/nytprofpf blib/script/nytprofpf "/usr/bin/perl.exe" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/scrip +t/nytprofpf Manifying 6 pod documents Manifying 9 pod documents "/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- NYTPro +f.bs blib/arch/auto/Devel/NYTProf/NYTProf.bs 644 cp blib/arch/auto/Devel/NYTProf/NYTProf.dll blib/lib/Devel/auto/Devel/ +NYTProf/NYTProf.dll PERL_DL_NONLAZY=1 "/usr/bin/perl.exe" "-MExtUtils::Command::MM" "-MTes +t::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'bl +ib/lib', 'blib/arch')" t/*.t # Testing Devel::NYTProf 6.10 started at Wed Aug 18 18:31:10 2021 # Compression: default level is 6, zlib version 1.2.11 # --- Perl 5.032001 Config on x86_64-cygwin-threads-multi: # d_gettimeod: define # d_sysconf: define t/00-load.t .............. ok t/10-run.t ............... ok t/11-reader.t ............ ok t/12-data.t .............. ok t/13-fileinfo.t .......... ok t/14-subinfo.t ........... ok t/22-readstream.t ........ ok t/30-util.t .............. ok t/31-env.t ............... ok t/40-savesrc.t ........... ok t/42-global.t ............ ok t/44-model.t ............. ok # Failed test '$! should not be altered by NYTProf i/o' # at t/50-errno.t line 58. # got: '0' # expected: '3' # Looks like you failed 1 test of 8. t/50-errno.t ............. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/8 subtests t/60-forkdepth.t ......... ok t/70-subname.t ........... ok t/80-version.t ........... ok t/90-pod.t ............... skipped: NYTPROF_AUTHOR_TESTING only t/test01.t ............... ok t/test02.t ............... ok t/test03.t ............... ok t/test05.t ............... ok t/test06.t ............... ok t/test07.t ............... ok t/test08.t ............... ok t/test09.t ............... ok t/test10.t ............... ok t/test11.t ............... ok t/test12.t ............... ok t/test13.t ............... ok t/test14.t ............... ok t/test16.t ............... ok t/test17-goto.t .......... ok t/test18-goto2.t ......... ok t/test20-streval.t ....... ok t/test21-streval3.t ...... ok t/test22-strevala.t ...... ok t/test23-strevall.t ...... ok t/test24-strevalc.t ...... ok t/test25-strevalb.t ...... ok t/test30-fork-0.t ........ ok t/test40pmc.t ............ ok t/test50-disable.t ....... ok t/test51-enable.t ........ ok t/test60-subname.t ....... ok t/test61-submerge.t ...... ok t/test62-subcaller1-a.t .. ok t/test62-subcaller1-b.t .. skipped: needs perl >= 5.33.3 (see t/test62 +-subcaller1-a) t/test62-tie-a.t ......... skipped: needs perl < 5.21.1 (see t/test62- +tie-b.t) t/test62-tie-b.t ......... ok t/test70-subexcl.t ....... ok t/test80-recurs.t ........ ok t/test81-swash.t ......... ok t/test82-version.t ....... ok t/test90-strsubref.t ..... ok # Tests ended at Wed Aug 18 18:35:19 2021 t/zzz.t .................. ok Test Summary Report ------------------- t/50-errno.t (Wstat: 256 Tests: 8 Failed: 1) Failed test: 6 Non-zero exit status: 1 Files=55, Tests=4949, 249 wallclock secs ( 0.17 usr 0.12 sys + 52.19 +cusr 109.19 csys = 161.68 CPU) Result: FAIL Failed 1/55 test programs. 1/4949 subtests failed. make: *** [Makefile:1284: test_dynamic] Error 255 -> FAIL Installing Devel::NYTProf failed. See /home/user/.cpanm/work/1 +629329450.307/build.log for details. Retry with --force to force inst +all it. Expiring 3 work directories.

Replies are listed 'Best First'.
Re: help installing Devel::NYTProf under Cygwin
by kcott (Archbishop) on Aug 20, 2021 at 07:21 UTC

    G'day Special_K,

    I tried the installation myself and got the same result. I edited my CPAN Tester Report as follows:

    ------------------------------ TESTER COMMENTS ------------------------------ Additional comments from tester: I'm following up a question on PerlMonks: "help installing Devel::NYTProf under Cygwin" (https://www.perlmonks.org/?node_id=11135967). The error I have below is identical to the one posted on PerlMonks. The "CPAN Testers Matrix: Devel-NYTProf 6.10 (latest distribution)" (http://matrix.cpantesters.org/?dist=Devel-NYTProf+6.10) only has one report for Cygwin (https://www.cpantesters.org/cpan/report/a4dfd892-7306-1014-8def-c9dd7 +5d8a230) which is an identical FAIL. I see from https://github.com/timbunce/devel-nytprof/blob/master/t/50- +errno.t that the problem line is in a SKIP block: skip ... if($^O eq 'VMS'); Unless that test is essential for Cygwin, perhaps consider: skip ... if($^O eq 'VMS' or $^O eq 'cygwin');

    The CPAN Testers Matrix typically takes a while to update: my report may not appear for some time (which is why I posted it here). I hope there's sufficient information for you to see what's going on; ask if that's not the case.

    Given you got very close to success:

    Failed 1/55 test programs. 1/4949 subtests failed.

    I'd recommend you take the force option.

    Update: Force worked for me.

    cpan[2]> force install Devel::NYTProf ... JKEENAN/Devel-NYTProf-6.10.tar.gz /usr/bin/make install -- OK

    — Ken

      > I hope there's sufficient information for you to see what's going on; ask if that's not the case.

      The section of code that is failing is:
      SKIP: { skip 'On VMS buffer is not flushed', 1 if ($^O eq 'VMS'); cmp_ok $size1, '>', 0, "$nytprof_out should not be empty"; }

      Is SKIP just an arbitrary label?
      What does 'skip' do?
      How do I know if this test is safe to skip for Cygwin?

        "The section of code that is failing is ..."

        That statement is completely wrong.

        Your own OP has:

        # Failed test '$! should not be altered by NYTProf i/o' # at t/50-errno.t line 58.

        The URL I provided (https://github.com/timbunce/devel-nytprof/blob/master/t/50-errno.t) links to code with line numbers. The SKIP block starting at line 50, and ending on line 59, contains "t/50-errno.t line 58".

        "Is SKIP just an arbitrary label?"

        No, it's not. Probably the most frequently used test module is the core Test::More (wherein you'll find SKIP). If you're going to investigate "*.t" files, you should be familiar with this module; although, be aware that there are many other modules in the Test:: namespace. I'm a strong advocate of testing and would recommend that you read up on Test::More anyway.

        "How do I know if this test is safe to skip for Cygwin?"

        The short answer is: "you don't". A longer answer would, to some extent, depend on your definition of "safe". It's a developer's tool so your clients will be unaffected. If you are genuinely concerned, don't use this module.

        — Ken