tobyink / p5-type-tiny-xs Goto Github PK
View Code? Open in Web Editor NEWPerl 5 distribution Type-Tiny-XS; see homepage for downloads and documentation.
Home Page: https://metacpan.org/release/Type-Tiny-XS
Perl 5 distribution Type-Tiny-XS; see homepage for downloads and documentation.
Home Page: https://metacpan.org/release/Type-Tiny-XS
This module doesn't compile on Win32 platforms when MSVC is used as the compiler:
C:\Perl\5.10.1\bin\MSWin32-x64-multi-thread\perl.exe Makefile.PL
Running make for T/TO/TOBYINK/Type-Tiny-XS-0.008.tar.gz
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
cp lib/Type/Tiny/XS/Util.pm blib\lib\Type\Tiny\XS\Util.pm
cp lib/Type/Tiny/XS.pm blib\lib\Type\Tiny\XS.pm
Running Mkbootstrap for Type::Tiny::XS ()
C:\Perl\5.10.1\bin\MSWin32-x64-multi-thread\perl.exe -MExtUtils::Command -e chmod -- 644 XS.bs
C:\Perl\5.10.1\bin\MSWin32-x64-multi-thread\perl.exe C:\Perl\5.10.1\lib\ExtUtils\xsubpp -typemap C:\Perl\5.10.1\lib\ExtUtils\typemap Util.xs > Util.xsc && C:\Perl\5.10.1\bin\MSWin32-x64-multi-thread\perl.exe -MExtUtils::Command -e mv -- Util.xsc
Util.c
cl -c -I. -nologo -GF -W3 -MD -Zi -DNDEBUG -Ox -GL -fp:precise -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -MD -Zi -DNDEBU
G -Ox -GL -fp:precise -DVERSION=\"0.008\" -DXS_VERSION=\"0.008\" "-IC:\Perl\5.10.1\lib\MSWin32-x64-multi-thread\CORE" Util.c
Util.c
C:\Perl\5.10.1\lib\MSWin32-x64-multi-thread\CORE\sys/socket.h(32) : warning C4005: 'ENOTSOCK' : macro redefinition
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\errno.h(120) : see previous definition of 'ENOTSOCK'
Util.xs(130) : warning C4028: formal parameter 2 different from declaration
Util.xs(130) : warning C4028: formal parameter 3 different from declaration
Util.xs(178) : warning C4028: formal parameter 2 different from declaration
Util.xs(461) : warning C4267: 'function' : conversion from 'size_t' to 'const I32', possible loss of data
Util.xs(526) : warning C4267: 'function' : conversion from 'size_t' to 'const I32', possible loss of data
C:\Perl\5.10.1\bin\MSWin32-x64-multi-thread\perl.exe C:\Perl\5.10.1\lib\ExtUtils\xsubpp -typemap C:\Perl\5.10.1\lib\ExtUtils\typemap XS.xs > XS.xsc && C:\Perl\5.10.1\bin\MSWin32-x64-multi-thread\perl.exe -MExtUtils::Command -e mv -- XS.xsc XS.c
cl -c -I. -nologo -GF -W3 -MD -Zi -DNDEBUG -Ox -GL -fp:precise -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -MD -Zi -DNDEBUG -Ox -GL -fp:precise -DVERSION=\"0.008\" -DXS_VERSION=\"0.008\" "-IC:\Perl\5.10.1\lib\MSWin32-x64-multi-thread\CORE" XS.c XS.c
C:\Perl\5.10.1\lib\MSWin32-x64-multi-thread\CORE\sys/socket.h(32) : warning C4005: 'ENOTSOCK' : macro redefinition
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\errno.h(120) : see previous definition of 'ENOTSOCK'
XS.xs(51) : warning C4244: 'initializing' : conversion from '__int64' to 'const I32', possible loss of data
XS.xs(80) : warning C4028: formal parameter 2 different from declaration
XS.xs(86) : warning C4028: formal parameter 2 different from declaration
XS.xs(116) : warning C4028: formal parameter 2 different from declaration
XS.xs(122) : warning C4028: formal parameter 2 different from declaration
XS.xs(128) : warning C4028: formal parameter 2 different from declaration
XS.xs(134) : warning C4028: formal parameter 2 different from declaration
XS.xs(165) : warning C4101: 'p' : unreferenced local variable
XS.xs(172) : warning C4028: formal parameter 2 different from declaration
XS.xs(208) : error C2143: syntax error : missing ';' before 'type'
XS.xs(209) : error C2065: 'i' : undeclared identifier
XS.xs(232) : error C2143: syntax error : missing ';' before 'type'
XS.xs(233) : error C2065: 'i' : undeclared identifier
XS.xs(237) : warning C4028: formal parameter 2 different from declaration
XS.xs(259) : warning C4028: formal parameter 2 different from declaration
XS.xs(265) : warning C4028: formal parameter 2 different from declaration
XS.xs(271) : warning C4028: formal parameter 2 different from declaration
XS.xs(271) : warning C4028: formal parameter 3 different from declaration
XS.xs(281) : warning C4028: formal parameter 2 different from declaration
XS.xs(287) : warning C4028: formal parameter 2 different from declaration
XS.xs(305) : warning C4028: formal parameter 2 different from declaration
XS.xs(311) : warning C4028: formal parameter 2 different from declaration
XS.xs(317) : warning C4028: formal parameter 2 different from declaration
XS.xs(323) : warning C4028: formal parameter 2 different from declaration
XS.xs(342) : warning C4028: formal parameter 2 different from declaration
XS.xs(422) : error C2275: 'I32' : illegal use of this type as an expression
C:\perl\5.10.1\lib\mswin32-x64-multi-thread\core\handy.h(174) : see declaration of 'I32'
XS.xs(422) : error C2146: syntax error : missing ';' before identifier 'i'
XS.xs(422) : error C2065: 'i' : undeclared identifier
XS.xs(423) : error C2065: 'i' : undeclared identifier
XS.xs(423) : error C2065: 'i' : undeclared identifier
XS.xs(423) : error C2065: 'i' : undeclared identifier
XS.xs(424) : error C2065: 'i' : undeclared identifier
XS.xs(425) : error C2065: 'i' : undeclared identifier
XS.xs(442) : error C2275: 'AV' : illegal use of this type as an expression
C:\Perl\5.10.1\lib\MSWin32-x64-multi-thread\CORE\perl.h(2394) : see declaration of 'AV'
XS.xs(442) : error C2059: syntax error : 'const'
XS.xs(443) : error C2275: 'I32' : illegal use of this type as an expression
C:\perl\5.10.1\lib\mswin32-x64-multi-thread\core\handy.h(174) : see declaration of 'I32'
XS.xs(443) : error C2143: syntax error : missing ';' before 'const'
XS.xs(444) : error C2275: 'I32' : illegal use of this type as an expression
C:\perl\5.10.1\lib\mswin32-x64-multi-thread\core\handy.h(174) : see declaration of 'I32'
XS.xs(444) : error C2146: syntax error : missing ';' before identifier 'i'
XS.xs(444) : error C2065: 'i' : undeclared identifier
XS.xs(445) : error C2065: 'i' : undeclared identifier
XS.xs(445) : error C2065: 'i' : undeclared identifier
XS.xs(445) : error C2065: 'len' : undeclared identifier
XS.xs(445) : error C2065: 'i' : undeclared identifier
XS.xs(446) : error C2065: 'av' : undeclared identifier
XS.xs(446) : warning C4047: 'function' : 'AV *' differs in levels of indirection from 'int'
XS.xs(446) : warning C4024: 'Perl_av_fetch' : different types for formal and actual parameter 2
XS.xs(446) : error C2065: 'i' : undeclared identifier
XS.xs(478) : warning C4244: 'initializing' : conversion from '__int64' to 'const I32', possible loss of data
XS.xs(493) : warning C4244: 'initializing' : conversion from '__int64' to 'const I32', possible loss of data
XS.xs(614) : warning C4244: 'initializing' : conversion from '__int64' to 'const I32', possible loss of data
XS.xs(620) : warning C4267: 'function' : conversion from 'size_t' to 'const I32', possible loss of data
XS.xs(630) : warning C4244: '=' : conversion from 'I32' to 'char', possible loss of data
XS.xs(678) : warning C4267: 'function' : conversion from 'size_t' to 'U32', possible loss of data
XS.xs(706) : warning C4267: 'function' : conversion from 'size_t' to 'I32', possible loss of data
XS.xs(759) : warning C4013: 'boot_Type__Tiny__XS__Util' undefined; assuming extern returning int
XS.xs(761) : error C2275: 'my_cxt_t' : illegal use of this type as an expression
XS.xs(13) : see declaration of 'my_cxt_t'
XS.xs(761) : error C2065: 'my_cxtp' : undeclared identifier
XS.xs(762) : error C2065: 'my_cxtp' : undeclared identifier
XS.xs(762) : warning C4047: 'function' : 'my_cxt_t *' differs in levels of indirection from 'int'
XS.xs(762) : warning C4024: 'setup_my_cxt' : different types for formal and actual parameter 2
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
Stop.
TOBYINK/Type-Tiny-XS-0.008.tar.gz
"C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/nmake.exe" -- NOT OK
Stopping: 'install' failed for 'Type::Tiny::XS'.
Failed during this command:
TOBYINK/Type-Tiny-XS-0.008.tar.gz : make NO
Most of the compile errors seem to be due to MSVC requiring variables to be declared at the beginning of the block before any other code.
If I call int($num)
on a floating point number, that number is subsequently identified as an integer, even when it's not. I suspected this is because the pIOK
flag is set, but this might be a red herring (more later). Here's sample code which fails on every version (even .001
) of Type:Tiny::XS
that I've tested.
This code replicates the issue:
#!/usr/bin/env perl
use Test::More;
use Type::Tiny::XS;
use Devel::Peek;
diag $Type::Tiny::XS::VERSION;
my $num = 3.14;
Dump($num);
ok !Type::Tiny::XS::Int($num), "$num should not be an integer";
Dump($num);
{ no warnings; int($num); }
Dump($num);
ok !Type::Tiny::XS::Int($num), "$num should not be an integer";
Dump($num);
done_testing;
And the output:
type_tiny.t .. # 0.014
SV = NV(0x7fb6e4903088) at 0x7fb6e49030a0
REFCNT = 1
FLAGS = (NOK,pNOK)
NV = 3.14
ok 1 - 3.14 should not be an integer
not ok 2 - 3.14 should not be an integer
SV = PVNV(0x7fb6e48027f0) at 0x7fb6e49030a0
REFCNT = 1
FLAGS = (NOK,pNOK)
IV = 0
NV = 3.14
PV = 0x7fb6e45df090 "3.14"\0
CUR = 4
LEN = 32
SV = PVNV(0x7fb6e48027f0) at 0x7fb6e49030a0
REFCNT = 1
FLAGS = (NOK,pIOK,pNOK)
IV = 3
NV = 3.14
PV = 0x7fb6e45df090 "3.14"\0
CUR = 4
LEN = 32
# Failed test '3.14 should not be an integer'
# at type_tiny.t line 16.
SV = PVNV(0x7fb6e48027f0) at 0x7fb6e49030a0
REFCNT = 1
FLAGS = (NOK,pIOK,pNOK)
IV = 3
NV = 3.14
PV = 0x7fb6e45df090 "3.14"\0
CUR = 4
LEN = 32
1..2
# Looks like you failed 1 test of 2.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests
Test Summary Report
-------------------
type_tiny.t (Wstat: 256 Tests: 2 Failed: 1)
Failed test: 2
Non-zero exit status: 1
Files=1, Tests=2, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.06 cusr 0.01 csys = 0.09 CPU)
Result: FAIL
And I suspect this is the cause of the same int
bug reported by Peter Mottram. However, all versions of Perl we've tested have pIOK
set and this might be a red herring.
I found the problem in a large codebase and reduced it to this:
perl -MTypes::Standard=is_Int -E \
'my $num = 3.14; say is_Int($num)?"Yes":"No"; int($num); say is_Int($num)?"Yes":"No";say $num'
On my box, that shows:
No
Yes
3.14
But one of our developers did this:
Intriguing -- I just brewed a plain perl-5.26.3, installed Types::Standard, and it passes -- here's the installations I've got:
% perlbrew exec --with perl-5.26.3,perl-5.26.3-veure,perl-5.28.1,perl-5.26.2,perl-5.26.0,perl-5.25.1,perl-5.24.2,perl-5.22.1 perl -MTypes::Standard=is_Int -E 'say "Types::Standard " . $Types::Standard::VERSION; my $num = 3.14; say is_Int($num)?"Yes":"No"; int($num); say is_Int($num)?"Yes":"No";say $num'
perl-5.26.3
==========
Types::Standard 1.004004
No
No
3.14
perl-5.26.3-veure
==========
Types::Standard 1.004004
No
Yes
3.14
perl-5.28.1
==========
Types::Standard 1.004002
No
No
3.14
perl-5.26.2
==========
Types::Standard 1.004004
No
No
3.14
perl-5.26.0
==========
Types::Standard 1.004004
No
No
3.14
perl-5.25.1
==========
Types::Standard 1.004004
No
No
3.14
perl-5.24.2
==========
Types::Standard 1.002001
No
Yes
3.14
perl-5.22.1
==========
Types::Standard 1.000005
No
No
3.14
So I also asked my Twitter followers to run that Types::Standard
snippet and they received similarly inconsistent results.
So I don't know what's causing it, but at least I have a small test case for you in the first code snippet I posted above. I hope it helps because this is a serious issue in our current codebase.
This outputs 1
with the pure Perl version and q{}
with the XS version:
use Types::Standard qw( Bool )
use Cpanel::JSON::XS
say Bool->check(Cpanel::JSON::XS::true)
Running perl -MType::Tiny::XS
crashes.
Installed with cpan
Summary of my perl5 (revision 5 version 22 subversion 0) configuration:
Platform:
osname=MSWin32, osvers=6.3, archname=MSWin32-x64-multi-thread
uname='Win32 strawberry-perl 5.22.0.1 #1 Mon Jun 1 23:58:39 2015 x64'
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
useithreads=define, usemultiplicity=define
use64bitint=define, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing -mms-bitfields',
optimize='-s -O2',
cppflags='-DWIN32'
ccversion='', gccversion='4.9.2', gccosandvers=''
intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8, longdblkind=3
ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='long long', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='g++', ldflags ='-s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib"'
libpth=C:\STRAWB~1\c\lib C:\STRAWB~1\c\x86_64-w64-mingw32\lib C:\STRAWB~1\c\lib\gcc\x86_64-w64-mingw32\4.9.2
libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
libc=, so=dll, useshrplib=true, libperl=libperl522.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=xs.dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-mdll -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib"'
Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY
PERLIO_LAYERS PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
PERL_MALLOC_WRAP PERL_NEW_COPY_ON_WRITE
PERL_PRESERVE_IVUV USE_64_BIT_INT USE_ITHREADS
USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME
USE_PERLIO USE_PERL_ATOF
Built under MSWin32
Compiled at Jun 2 2015 00:03:35
@INC:
C:/usr/site/lib/MSWin32-x64-multi-thread
C:/usr/site/lib
C:/usr/vendor/lib
C:/usr/lib
# cpanm Type::Tiny::XS
--> Working on Type::Tiny::XS
Fetching http://www.cpan.org/authors/id/T/TO/TOBYINK/Type-Tiny-XS-0.023.tar.gz ... OK
Configuring Type-Tiny-XS-0.023 ... OK
Building and testing Type-Tiny-XS-0.023 ... FAIL
! Installing Type::Tiny::XS failed. See /root/.cpanm/work/1666185128.18/build.log for details. Retry with --force to force install it.
# cat /root/.cpanm/work/1666185128.18/build.log
cpanm (App::cpanminus) 1.7044 on perl 5.028001 built for x86_64-linux-gnu-thread-multi
Work directory is /root/.cpanm/work/1666185128.18
You have make /usr/bin/make
You have LWP 6.36
You have /bin/tar: tar (GNU tar) 1.30
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.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 Type::Tiny::XS () on cpanmetadb ...
--> Working on Type::Tiny::XS
Fetching http://www.cpan.org/authors/id/T/TO/TOBYINK/Type-Tiny-XS-0.023.tar.gz
-> OK
Unpacking Type-Tiny-XS-0.023.tar.gz
Entering Type-Tiny-XS-0.023
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.64)
Configuring Type-Tiny-XS-0.023
Running Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Type::Tiny::XS
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Test::More 0.92 ... Yes (1.302191)
Checking if you have ExtUtils::ParseXS 3.16 ... Yes (3.39)
Building and testing Type-Tiny-XS-0.023
cp lib/Type/Tiny/XS.pm blib/lib/Type/Tiny/XS.pm
cp lib/Type/Tiny/XS/Util.pm blib/lib/Type/Tiny/XS/Util.pm
Running Mkbootstrap for XS ()
chmod 644 "XS.bs"
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- XS.bs blib/arch/auto/Type/Tiny/XS/XS.bs 644
"/usr/bin/perl" "/usr/share/perl/5.28/ExtUtils/xsubpp" -typemap '/usr/share/perl/5.28/ExtUtils/typemap' Util.xs > Util.xsc
mv Util.xsc Util.c
x86_64-linux-gnu-gcc -c -I. -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.023\" -DXS_VERSION=\"0.023\" -fPIC "-I/usr/lib/x86_64-linux-gnu/perl/5.28/CORE" Util.c
"/usr/bin/perl" "/usr/share/perl/5.28/ExtUtils/xsubpp" -typemap '/usr/share/perl/5.28/ExtUtils/typemap' XS.xs > XS.xsc
mv XS.xsc XS.c
x86_64-linux-gnu-gcc -c -I. -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.023\" -DXS_VERSION=\"0.023\" -fPIC "-I/usr/lib/x86_64-linux-gnu/perl/5.28/CORE" XS.c
XS.xs: In function 'typetiny_parameterized_ArrayLike':
XS.xs:505:49: warning: passing argument 1 of 'typetiny_parameterized_ArrayRef' from incompatible pointer type [-Wincompatible-pointer-types]
return typetiny_parameterized_ArrayRef( param, sv );
^~~~~
In file included from xshelper.h:36,
from typetiny.h:6,
from XS.xs:1:
/usr/lib/x86_64-linux-gnu/perl/5.28/CORE/perl.h:174:22: note: expected 'PerlInterpreter *' {aka 'struct interpreter *'} but argument is of type 'SV * const' {aka 'struct sv * const'}
# define pTHX tTHX my_perl PERL_UNUSED_DECL
^
/usr/lib/x86_64-linux-gnu/perl/5.28/CORE/perl.h:187:18: note: in expansion of macro 'pTHX'
# define pTHX_ pTHX,
^~~~
XS.xs:478:33: note: in expansion of macro 'pTHX_'
typetiny_parameterized_ArrayRef(pTHX_ SV* const param, SV* const sv) {
^~~~~
XS.xs:505:16: error: too few arguments to function 'typetiny_parameterized_ArrayRef'
return typetiny_parameterized_ArrayRef( param, sv );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
XS.xs:478:1: note: declared here
typetiny_parameterized_ArrayRef(pTHX_ SV* const param, SV* const sv) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/x86_64-linux-gnu/perl/5.28/CORE/perl.h:5310,
from xshelper.h:36,
from typetiny.h:6,
from XS.xs:1:
XS.xs:524:20: warning: passing argument 2 of 'Perl_call_sv' from incompatible pointer type [-Wincompatible-pointer-types]
call_sv(cvp[0x02], G_SCALAR);
~~~^~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.28/CORE/embed.h:80:42: note: in definition of macro 'call_sv'
#define call_sv(a,b) Perl_call_sv(aTHX_ a,b)
^
In file included from /usr/lib/x86_64-linux-gnu/perl/5.28/CORE/perl.h:5271,
from xshelper.h:36,
from typetiny.h:6,
from XS.xs:1:
/usr/lib/x86_64-linux-gnu/perl/5.28/CORE/proto.h:304:42: note: expected 'SV *' {aka 'struct sv *'} but argument is of type 'CV *' {aka 'struct cv *'}
PERL_CALLCONV I32 Perl_call_sv(pTHX_ SV* sv, volatile I32 flags);
~~~~^~
XS.xs: In function 'typetiny_parameterized_HashLike':
XS.xs:575:48: warning: passing argument 1 of 'typetiny_parameterized_HashRef' from incompatible pointer type [-Wincompatible-pointer-types]
return typetiny_parameterized_HashRef( param, sv );
^~~~~
In file included from xshelper.h:36,
from typetiny.h:6,
from XS.xs:1:
/usr/lib/x86_64-linux-gnu/perl/5.28/CORE/perl.h:174:22: note: expected 'PerlInterpreter *' {aka 'struct interpreter *'} but argument is of type 'SV * const' {aka 'struct sv * const'}
# define pTHX tTHX my_perl PERL_UNUSED_DECL
^
/usr/lib/x86_64-linux-gnu/perl/5.28/CORE/perl.h:187:18: note: in expansion of macro 'pTHX'
# define pTHX_ pTHX,
^~~~
XS.xs:546:32: note: in expansion of macro 'pTHX_'
typetiny_parameterized_HashRef(pTHX_ SV* const param, SV* const sv) {
^~~~~
XS.xs:575:16: error: too few arguments to function 'typetiny_parameterized_HashRef'
return typetiny_parameterized_HashRef( param, sv );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
XS.xs:546:1: note: declared here
typetiny_parameterized_HashRef(pTHX_ SV* const param, SV* const sv) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/x86_64-linux-gnu/perl/5.28/CORE/perl.h:5310,
from xshelper.h:36,
from typetiny.h:6,
from XS.xs:1:
XS.xs:594:20: warning: passing argument 2 of 'Perl_call_sv' from incompatible pointer type [-Wincompatible-pointer-types]
call_sv(cvp[0x03], G_SCALAR);
~~~^~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.28/CORE/embed.h:80:42: note: in definition of macro 'call_sv'
#define call_sv(a,b) Perl_call_sv(aTHX_ a,b)
^
In file included from /usr/lib/x86_64-linux-gnu/perl/5.28/CORE/perl.h:5271,
from xshelper.h:36,
from typetiny.h:6,
from XS.xs:1:
/usr/lib/x86_64-linux-gnu/perl/5.28/CORE/proto.h:304:42: note: expected 'SV *' {aka 'struct sv *'} but argument is of type 'CV *' {aka 'struct cv *'}
PERL_CALLCONV I32 Perl_call_sv(pTHX_ SV* sv, volatile I32 flags);
~~~~^~
make: *** [Makefile:351: XS.o] Error 1
-> FAIL Installing Type::Tiny::XS failed. See /root/.cpanm/work/1666185128.18/build.log for details. Retry with --force to force install it.
Note: running in a docker container, based upon debian:buster (bitnami/minideb:buster)
# perl -V |head
Summary of my perl5 (revision 5 version 28 subversion 1) configuration:
Platform:
osname=linux
osvers=4.9.0
archname=x86_64-linux-gnu-thread-multi
uname='linux localhost 4.9.0 #1 smp debian 4.9.0 x86_64 gnulinux '
config_args='-Dusethreads -Duselargefiles -Dcc=x86_64-linux-gnu-gcc -Dcpp=x86_64-linux-gnu-cpp -Dld=x86_64-linux-gnu-gcc -Dccflags=-DDEBIAN -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/perl-voFw8F/perl-5.28.1=. -fstack-protector-strong -Wformat -Werror=format-security -Dldflags= -Wl,-z,relro -Dlddlflags=-shared -Wl,-z,relro -Dcccdlflags=-fPIC -Darchname=x86_64-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.28 -Darchlib=/usr/lib/x86_64-linux-gnu/perl/5.28 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/x86_64-linux-gnu/perl5/5.28 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.28.1 -Dsitearch=/usr/local/lib/x86_64-linux-gnu/perl/5.28.1 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Duse64bitint -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -Ui_libutil -Ui_xlocale -Uversiononly -DDEBUGGING=-g -Doptimize=-O2 -dEs -Duseshrplib -Dlibperl=libperl.so.5.28.1'
For example, "00" validates as a PositiveInt. Here is a snippet showing this:
# cat test.pl
use strict;
use warnings;
use Types::Common::Numeric qw( PositiveInt is_PositiveInt );
my @xx = (1, '1', 0, '0', 00, '00', ':');
for my $x (@xx) {
if (is_PositiveInt($x)) {
print "$x is";
} else {
print "$x isn't";
}
if (is_PositiveInt(0+$x)) {
print ", 0+$x is";
} else {
print ", 0+$x isn't";
}
print "\n";
}
# perl test.pl
1 is, 0+1 is
1 is, 0+1 is
0 isn't, 0+0 isn't
0 isn't, 0+0 isn't
0 isn't, 0+0 isn't
00 is, 0+00 isn't <-------
Argument ":" isn't numeric in addition (+) at test.pl line 13.
: isn't, 0+: isn't
Please see the line I highlighted with <------
.
I believe the cause is here as it gets past the if (len == 1 && i[0] == '0') {
check.
Thank you!
I reported this on RT:
https://rt.cpan.org/Public/Bug/Display.html?id=130458
because the POD says to report there, but without acknowledgement there I'm thinking maybe here is the better platform?
The new version(s) of Type:Tiny:XS failed to build in a container for an internal project; the new test gh8.t dumps core. gcc issued a warning during compilation, which might be indicative.
Our workaround was to fix the version at 0.014 in this project.
Thanks for all your contributions Toby!
I am seeing fails for classes using Types::Standard and Optional when Type::Tiny::XS (0.008) is installed. The following case passes when Type::Tiny::XS is not installed and fails for not enough arguments when it is. I don't know any XS so I'm not exactly sure what part is failing and what parts are not essential to the test case. I run Strawberry perl 5.14 on windows 64 but I am getting fails for linux on all versions of perl for modules I have posted to CPAN(updated) with Types::Standard qw( Optional ) for apparently the same reason (inferred).
#!perl
package MyTest;
use strict;
use warnings;
use Type::Utils 0.046 -all;
use Test::Most;
eval "use Type::Tiny::XS";
use Type::Library 0.046
-base,
-declare => qw(
TestDictionary SuperClassesList NameSpace
);
use Types::Standard 0.046 -types;
declare NameSpace,
as Str,
where{ $_ =~ /^[A-Za-z:]+$/ },
message{ "-$_- does not match: " . qr/^[A-Za-z:]+$/ };
declare SuperClassesList,
as ArrayRef[ ClassName ],
where{ scalar( @$_ ) > 0 };
declare TestDictionary,
as Dict[
package => Optional[ NameSpace ],
superclasses => Optional[ SuperClassesList ],
],;
ok TestDictionary->( { package => 'My::Package' } ),
"Test TestDictionary";
done_testing();
The error message with ~::XS installed is;
Too few arguments for type constraint check functions at C:/strawberry/perl/site/lib/Type/Tiny.pm line 358.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.