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

Build failure with perl 5.14 and lower #31

Closed ryandesign closed 9 years ago

ryandesign commented 10 years ago

Hello, I'm a developer with the MacPorts project. p5-mouse 2.3.0 builds fine with perl 5.16, 5.18 and 5.20, but with perl 5.14, 5.12, 5.10 or 5.8 I get this error:

xs-src/MouseTypeConstraints.xs:616:5: warning: implicit declaration of function 'setup_my_cxt' is invalid in C99 [-Wimplicit-function-declaration]
    setup_my_cxt(aTHX_ aMY_CXT);
    ^
xs-src/MouseTypeConstraints.xs:619:5: warning: implicit declaration of function 'DEFINE_TC' is invalid in C99 [-Wimplicit-function-declaration]
    DEFINE_TC(Any);
    ^
xs-src/MouseTypeConstraints.xs:619:15: error: use of undeclared identifier 'Any'
    DEFINE_TC(Any);
              ^
xs-src/MouseTypeConstraints.xs:620:15: error: use of undeclared identifier 'Undef'
    DEFINE_TC(Undef);
              ^
xs-src/MouseTypeConstraints.xs:621:15: error: use of undeclared identifier 'Defined'
    DEFINE_TC(Defined);
              ^
xs-src/MouseTypeConstraints.xs:622:15: error: use of undeclared identifier 'Bool'
    DEFINE_TC(Bool);
              ^
xs-src/MouseTypeConstraints.xs:623:15: error: use of undeclared identifier 'Value'
    DEFINE_TC(Value);
              ^
xs-src/MouseTypeConstraints.xs:624:15: error: use of undeclared identifier 'Ref'
    DEFINE_TC(Ref);
              ^
xs-src/MouseTypeConstraints.xs:625:15: error: use of undeclared identifier 'Str'
    DEFINE_TC(Str);
              ^
xs-src/MouseTypeConstraints.xs:626:15: error: use of undeclared identifier 'Num'
    DEFINE_TC(Num);
              ^
xs-src/MouseTypeConstraints.xs:627:15: error: use of undeclared identifier 'Int'
    DEFINE_TC(Int);
              ^
xs-src/MouseTypeConstraints.xs:628:15: error: use of undeclared identifier 'ScalarRef'
    DEFINE_TC(ScalarRef);
              ^
xs-src/MouseTypeConstraints.xs:629:15: error: use of undeclared identifier 'ArrayRef'
    DEFINE_TC(ArrayRef);
              ^
xs-src/MouseTypeConstraints.xs:630:15: error: use of undeclared identifier 'HashRef'
    DEFINE_TC(HashRef);
              ^
xs-src/MouseTypeConstraints.xs:631:15: error: use of undeclared identifier 'CodeRef'
    DEFINE_TC(CodeRef);
              ^
xs-src/MouseTypeConstraints.xs:632:15: error: use of undeclared identifier 'GlobRef'
    DEFINE_TC(GlobRef);
              ^
xs-src/MouseTypeConstraints.xs:633:15: error: use of undeclared identifier 'FileHandle'
    DEFINE_TC(FileHandle);
              ^
xs-src/MouseTypeConstraints.xs:634:15: error: use of undeclared identifier 'RegexpRef'
    DEFINE_TC(RegexpRef);
              ^
xs-src/MouseTypeConstraints.xs:635:15: error: use of undeclared identifier 'Object'
    DEFINE_TC(Object);
              ^
xs-src/MouseTypeConstraints.xs:636:15: error: use of undeclared identifier 'ClassName'
    DEFINE_TC(ClassName);
              ^
xs-src/MouseTypeConstraints.xs:637:15: error: use of undeclared identifier 'RoleName'
    DEFINE_TC(RoleName);
              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
gfx commented 10 years ago

Can you paste your perl -V ?

syohex commented 10 years ago

http://www.cpantesters.org/distro/M/Mouse.html#Mouse-2.3.0

Building and testing modules is passed with under Perl 5.14(however tests are failed on some platforms).

https://travis-ci.org/gfx/p5-Mouse

On travis-ci, building and testing module is passed with Perl 5.8..Perl5.20.

And I can't reproduce this issue on my Linux machine with Perl 5.10.1, 5.12.5, 5.14.2.

ryandesign commented 10 years ago

I just tested on a second Mac with the same results. Perhaps there is a difference between the way perl5.14 and earlier and perl5.16 and later are being built in MacPorts.

Here's perl5.14 -V:

Summary of my perl5 (revision 5 version 14 subversion 4) configuration:

  Platform:
    osname=darwin, osvers=12.5.0, archname=darwin-thread-multi-2level
    uname='darwin tv8.local 12.5.0 darwin kernel version 12.5.0: sun sep 29 13:33:47 pdt 2013; root:xnu-2050.48.12~1release_x86_64 x86_64 '
    config_args='-D inc_version_list=5.14.2/darwin-thread-multi-2level 5.14.2 5.14.1/darwin-thread-multi-2level 5.14.1 5.14.0/darwin-thread-multi-2level 5.14.0 -des -Dprefix=/Volumes/Data/macports/mountainlion -Dscriptdir=/Volumes/Data/macports/mountainlion/bin -Dcppflags=-I/Volumes/Data/macports/mountainlion/include -Dccflags=-pipe -Os  -Dldflags=-L/Volumes/Data/macports/mountainlion/lib -Wl,-headerpad_max_install_names  -Dvendorprefix=/Volumes/Data/macports/mountainlion -Dusemultiplicity=y -Dusethreads -Duseshrplib -D cc=/usr/bin/clang -D ld=/usr/bin/clang -D man1ext=1pm -D man3ext=3pm -D man1dir=/Volumes/Data/macports/mountainlion/share/man/man1p -D man3dir=/Volumes/Data/macports/mountainlion/share/man/man3p -D sitebin=/Volumes/Data/macports/mountainlion/libexec/perl5.14/sitebin -D siteman1dir=/Volumes/Data/macports/mountainlion/share/perl5.14/siteman/man1 -D siteman3dir=/Volumes/Data/macports/mountainlion/share/perl5.14/siteman/man3 -D vendorbin=/Volumes/Data/macports/mountainlion/libexec/perl5.14 -D vendorman1dir=/Volumes/Data/macports/mountainlion/share/perl5.14/man/man1 -D vendorman3dir=/Volumes/Data/macports/mountainlion/share/perl5.14/man/man3 -D pager=/usr/bin/less -sR -D perlpath=/Volumes/Data/macports/mountainlion/bin/perl5.14 -D startperl=#!/Volumes/Data/macports/mountainlion/bin/perl5.14'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='/usr/bin/clang', ccflags ='-pipe -Os  -fno-common -DPERL_DARWIN -I/Volumes/Data/macports/mountainlion/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector -I/Volumes/Data/macports/mountainlion/include',
    optimize='-O3',
    cppflags='-I/Volumes/Data/macports/mountainlion/include -no-cpp-precomp -pipe -Os  -fno-common -DPERL_DARWIN -I/Volumes/Data/macports/mountainlion/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector -I/Volumes/Data/macports/mountainlion/include'
    ccversion='', gccversion='4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))', 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.8 /usr/bin/clang', ldflags ='-L/Volumes/Data/macports/mountainlion/lib -Wl,-headerpad_max_install_names  -fstack-protector'
    libpth=/Volumes/Data/macports/mountainlion/lib /usr/lib
    libs=-lgdbm -ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=, so=dylib, useshrplib=true, libperl=libperl.dylib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-L/Volumes/Data/macports/mountainlion/lib -Wl,-headerpad_max_install_names  -bundle -undefined dynamic_lookup -fstack-protector'

Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                        PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT
                        USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
                        USE_REENTRANT_API
  Built under darwin
  Compiled at Aug 25 2014 05:21:10
  @INC:
    /Volumes/Data/macports/mountainlion/lib/perl5/site_perl/5.14.4/darwin-thread-multi-2level
    /Volumes/Data/macports/mountainlion/lib/perl5/site_perl/5.14.4
    /Volumes/Data/macports/mountainlion/lib/perl5/vendor_perl/5.14.4/darwin-thread-multi-2level
    /Volumes/Data/macports/mountainlion/lib/perl5/vendor_perl/5.14.4
    /Volumes/Data/macports/mountainlion/lib/perl5/5.14.4/darwin-thread-multi-2level
    /Volumes/Data/macports/mountainlion/lib/perl5/5.14.4
    /Volumes/Data/macports/mountainlion/lib/perl5/site_perl
    /Volumes/Data/macports/mountainlion/lib/perl5/vendor_perl
    .

Here's perl5.16 -V:

Summary of my perl5 (revision 5 version 16 subversion 3) configuration:

  Platform:
    osname=darwin, osvers=12.5.0, archname=darwin-thread-multi-2level
    uname='darwin tv8.local 12.5.0 darwin kernel version 12.5.0: sun sep 29 13:33:47 pdt 2013; root:xnu-2050.48.12~1release_x86_64 x86_64 '
    config_args='-D inc_version_list=5.16.1/darwin-thread-multi-2level 5.16.1 5.16.0/darwin-thread-multi-2level 5.16.0 -des -Dprefix=/Volumes/Data/macports/mountainlion -Dscriptdir=/Volumes/Data/macports/mountainlion/bin -Dcppflags=-I/Volumes/Data/macports/mountainlion/include -Dccflags=-pipe -Os   -Dldflags=-L/Volumes/Data/macports/mountainlion/lib -Wl,-headerpad_max_install_names   -Dvendorprefix=/Volumes/Data/macports/mountainlion -Dusemultiplicity=y -Dusethreads -Duseshrplib -D cc=/usr/bin/clang -D ld=/usr/bin/clang -D man1ext=1pm -D man3ext=3pm -D man1dir=/Volumes/Data/macports/mountainlion/share/man/man1p -D man3dir=/Volumes/Data/macports/mountainlion/share/man/man3p -D sitebin=/Volumes/Data/macports/mountainlion/libexec/perl5.16/sitebin -D siteman1dir=/Volumes/Data/macports/mountainlion/share/perl5.16/siteman/man1 -D siteman3dir=/Volumes/Data/macports/mountainlion/share/perl5.16/siteman/man3 -D vendorbin=/Volumes/Data/macports/mountainlion/libexec/perl5.16 -D vendorman1dir=/Volumes/Data/macports/mountainlion/share/perl5.16/man/man1 -D vendorman3dir=/Volumes/Data/macports/mountainlion/share/perl5.16/man/man3 -D pager=/usr/bin/less -sR -D perlpath=/Volumes/Data/macports/mountainlion/bin/perl5.16 -D startperl=#!/Volumes/Data/macports/mountainlion/bin/perl5.16'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='/usr/bin/clang', ccflags ='-pipe -Os   -fno-common -DPERL_DARWIN -I/Volumes/Data/macports/mountainlion/include -fno-strict-aliasing -fstack-protector -I/Volumes/Data/macports/mountainlion/include',
    optimize='-O3',
    cppflags='-I/Volumes/Data/macports/mountainlion/include -pipe -Os  -fno-common -DPERL_DARWIN -I/Volumes/Data/macports/mountainlion/include -fno-strict-aliasing -fstack-protector -I/Volumes/Data/macports/mountainlion/include'
    ccversion='', gccversion='4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))', 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.8 /usr/bin/clang', ldflags ='-L/Volumes/Data/macports/mountainlion/lib -Wl,-headerpad_max_install_names   -fstack-protector'
    libpth=/Volumes/Data/macports/mountainlion/lib /usr/lib
    libs=-lgdbm -ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=, so=dylib, useshrplib=true, libperl=libperl.dylib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-L/Volumes/Data/macports/mountainlion/lib -Wl,-headerpad_max_install_names   -bundle -undefined dynamic_lookup -fstack-protector'

Characteristics of this binary (from libperl): 
  Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
                        PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
                        PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL
                        USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                        USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
                        USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
                        USE_REENTRANT_API
  Built under darwin
  Compiled at Aug  7 2014 02:42:20
  @INC:
    /Volumes/Data/macports/mountainlion/lib/perl5/site_perl/5.16.3/darwin-thread-multi-2level
    /Volumes/Data/macports/mountainlion/lib/perl5/site_perl/5.16.3
    /Volumes/Data/macports/mountainlion/lib/perl5/vendor_perl/5.16.3/darwin-thread-multi-2level
    /Volumes/Data/macports/mountainlion/lib/perl5/vendor_perl/5.16.3
    /Volumes/Data/macports/mountainlion/lib/perl5/5.16.3/darwin-thread-multi-2level
    /Volumes/Data/macports/mountainlion/lib/perl5/5.16.3
    /Volumes/Data/macports/mountainlion/lib/perl5/site_perl
    /Volumes/Data/macports/mountainlion/lib/perl5/vendor_perl/5.16.1
    /Volumes/Data/macports/mountainlion/lib/perl5/vendor_perl
    .
syohex commented 10 years ago

I can't reproduce this issue with Perl5.14 which is installed by MacPorts.

ryandesign commented 10 years ago

Were you also on Mountain Lion with Clang 4.1, or with a different OS or compiler version?

syohex commented 10 years ago

No. I used Mavericks with Clang Apple LLVM version 5.0.

dur-randir commented 9 years ago

This problem exists only on threaded builds and is caused by the outdated ExtUtils::ParseXS module. META.yml says that the version 3.18 is required, but it's not checked during Build.PL run, and older perls have 2.xx by default. I'm not experienced with the Module::Build infrastructure, so can't suggest any solution.

syohex commented 9 years ago

Required modules are installed by CPAN client such as cpanm.

% cpanm Mouse

If you install Mouse from source code, you should install dependencies at first.

% cd Mouse
% cpanm --installdeps .
% perl Build.PL
% ./Build
% ./Build test
% ./Build install
syohex commented 9 years ago

https://travis-ci.org/gfx/p5-Mouse/builds/73918646

Tests on Perl 5.14 and lower are passed. If you fail tests, please update dependencies at first. Please reopen if you still have problems.