xslate / p5-Mouse

Lightweight class builder for Perl, as a subset of Moose
https://metacpan.org/release/Mouse
Other
46 stars 32 forks source link

PERL_UNUSED_RESULT not defined on older perl #85

Closed dmacks closed 6 years ago

dmacks commented 6 years ago

Building Mouse-v2.5.1 on OS X 10.13 against apple's perl-5.18.2 with all non-core perl modules supplied by fink...

cc -Ixs-src -I/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -Wall -W -Wno-comment -c -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -Os -o xs-src/MouseTypeConstraints.o xs-src/MouseTypeConstraints.c
xs-src/MouseTypeConstraints.xs:152:9: warning: implicit declaration of function
      'PERL_UNUSED_RESULT' is invalid in C99 [-Wimplicit-function-declaration]
        PERL_UNUSED_RESULT(Gconvert(nv, NV_DIG, 0, buf));
        ^
1 warning generated.

and then a lot of noise during self-test

t/000-load.t ................................................... Can't load '/sw/build.build/mouse-pm5182-2.5.1-1/Mouse-v2.5.1/blib/arch/auto/Mouse/Mouse.bundle' for module Mouse: dlopen(/sw/build.build/mouse-pm5182-2.5.1-1/Mouse-v2.5.1/blib/arch/auto/Mouse/Mouse.bundle, 2): Symbol not found: _PERL_UNUSED_RESULT
  Referenced from: /sw/build.build/mouse-pm5182-2.5.1-1/Mouse-v2.5.1/blib/arch/auto/Mouse/Mouse.bundle
  Expected in: flat namespace
 in /sw/build.build/mouse-pm5182-2.5.1-1/Mouse-v2.5.1/blib/arch/auto/Mouse/Mouse.bundle at /System/Library/Perl/5.18/darwin-thread-multi-2level/DynaLoader.pm line 194.
 at /sw/build.build/mouse-pm5182-2.5.1-1/Mouse-v2.5.1/blib/lib/Mouse.pm line 67.

The PERL_UNUSED_RESULT macro was only added in the middle of the perl-5.20/5.21 development cycles.

skaji commented 6 years ago

Which version of Devel::PPPort do you have?

dmacks commented 6 years ago

Devel::PPPort 3.21. But updating to 3.36 resolved the problem. I didn't see any note about mine being outdated during the processing of Build.PL. By eye, I now see:

configure_requires:
  Devel::PPPort: '3.33'

in Mouse's META.yml, but it's not in Build.PL. Adding it there triggered the correct sequence of events (updating Devel::PPPort prior to building Mouse).

skaji commented 6 years ago

Configure requires must be met before executing Build.PL. See https://metacpan.org/pod/CPAN::Meta::Spec

dmacks commented 6 years ago

Do you know what part of the build toolchain is broken here? Did Build.PL not get regenerated from META prior to the 2.5.1 tarball getting created? Or is Build.PL supposed to read META? Or is there some other tool that I was supposed to have run?

skaji commented 6 years ago

Major CPAN clients including cpanminus take care of configure requirements automatically.