Skip Menu |

This queue is for tickets about the UUID CPAN distribution.

Report information
The Basics
Id: 104394
Status: resolved
Priority: 0/
Queue: UUID

People
Owner: JRM [...] cpan.org
Requestors: dwheeler [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.24
Fixed in: 0.24_03



Subject: Unable to build on OS X Yosemite
With Perl 5.20.2: ~/.cpan/build/UUID-0.24-q6KN6b> perl Makefile.PL # # ===> Checking for -luuid # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertlibuGTNA525.c -o assertlibTHRf03Ix -luuid # # ===> Checking for uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertlibZIDEw3MN.c -o assertlibKlIpXbPG # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertlibSyXj7UWK.c -o assertlib9kMQU8l8 -luuid # ===> Found! # # ===> Checking for uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertlibYMoMQ5eA.c -o assertlibauNKOKSy assertlibYMoMQ5eA.c:1:10: fatal error: 'uuid.h' file not found #include <uuid.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertlibIQ2iaKa5.c -o assertlibK98k3lXs -luuid assertlibIQ2iaKa5.c:1:10: fatal error: 'uuid.h' file not found #include <uuid.h> ^ 1 error generated. # # ===> Checking for rpc.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertlibo9zGRwoa.c -o assertlibHfHAVOUZ assertlibo9zGRwoa.c:1:10: fatal error: 'rpc.h' file not found #include <rpc.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertlib0wI6l67_.c -o assertlibieupBYSn -luuid assertlib0wI6l67_.c:1:10: fatal error: 'rpc.h' file not found #include <rpc.h> ^ 1 error generated. # # ===> Checking for RPC interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertlibwn1EgmBD.c -o assertlib4XgWWJwJ # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertliba9xv1yfU.c -o assertlibUbXBu9Oj -luuid assertliba9xv1yfU.c:5:13: error: unknown type name 'int32_t'; did you mean '__int32_t'? int32_t r,s; ^~~~~~~ __int32_t /usr/include/i386/_types.h:44:15: note: '__int32_t' declared here typedef int __int32_t; ^ assertliba9xv1yfU.c:6:13: warning: implicit declaration of function 'uuid_create' is invalid in C99 [-Wimplicit-function-declaration] uuid_create(&u1,&s); ^ assertliba9xv1yfU.c:7:13: warning: implicit declaration of function 'uuid_create_nil' is invalid in C99 [-Wimplicit-function-declaration] uuid_create_nil(&u2,&s); ^ assertliba9xv1yfU.c:8:13: warning: implicit declaration of function 'uuid_from_string' is invalid in C99 [-Wimplicit-function-declaration] uuid_from_string(str,&u1,&s); ^ assertliba9xv1yfU.c:9:13: warning: implicit declaration of function 'uuid_to_string' is invalid in C99 [-Wimplicit-function-declaration] uuid_to_string(&u1,&str,&s); ^ assertliba9xv1yfU.c:10:38: error: too many arguments to function call, expected 2, have 3 r = uuid_compare(&u1,&u2,&s); ~~~~~~~~~~~~ ^~ /usr/include/uuid/uuid.h:55:1: note: 'uuid_compare' declared here int uuid_compare(const uuid_t uu1, const uuid_t uu2); ^ assertliba9xv1yfU.c:11:17: warning: implicit declaration of function 'uuid_equal' is invalid in C99 [-Wimplicit-function-declaration] r = uuid_equal(&u1,&u2,&s); ^ assertliba9xv1yfU.c:12:17: warning: implicit declaration of function 'uuid_is_nil' is invalid in C99 [-Wimplicit-function-declaration] r = uuid_is_nil(&u1,&s); ^ 6 warnings and 2 errors generated. # ===> Err(47): "Can't link/include C library 'uuid', aborting. " # ===> Checking for e2fs interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertlib1fKhrmc6.c -o assertlibSdbVPbjW # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertlibTERTFF0z.c -o assertlibrd0FI5nC -luuid # ===> Err(21): "wrong result: 'uuid' " # ===> Checking for Win interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertlib6x6n4R0o.c -o assertlibgs9P98CV # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertlib7vQhycA1.c -o assertlibtuzDDkLr assertlib7vQhycA1.c:2:10: fatal error: 'rpcdce.h' file not found #include <rpcdce.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib assertlibhB0YP4en.c -o assertlibHHqUZlDg -lrpcrt4 assertlibhB0YP4en.c:2:10: fatal error: 'rpcdce.h' file not found #include <rpcdce.h> ^ 1 error generated. # ===> Err(61): "Can't link/include C library 'rpcdce.h', 'rpcrt4', aborting. " No interface found. Can't continue.
FWIW, here's the OS X uuid.h file: http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/uuid/uuid.h The only diff between that version and the one on my system is: @@ -36,11 +36,7 @@ #define _UUID_UUID_H #include <sys/_types.h> - -#ifndef _UUID_T -#define _UUID_T -typedef __darwin_uuid_t uuid_t; -#endif /* _UUID_T */ +#include <sys/_types/_uuid_t.h> #ifndef _UUID_STRING_T #define _UUID_STRING_T
On 2015-05-12 18:42:05, DWHEELER wrote: Show quoted text
> -#ifndef _UUID_T > -#define _UUID_T > -typedef __darwin_uuid_t uuid_t; > -#endif /* _UUID_T */ > +#include <sys/_types/_uuid_t.h>
And the complete contents of sys/_types/_uuid_t.h: #ifndef _UUID_T #define _UUID_T typedef __darwin_uuid_t uuid_t; #endif /* _UUID_T */
I was able to get it to build and for all tests to pass by forcing to only look for e2fs and to ignore the error message in try_e2fs(). That error is "wrong result: 'uuid'". Not sure where it comes from.
On 2015-05-12 19:19:19, DWHEELER wrote: Show quoted text
> I was able to get it to build and for all tests to pass by forcing to > only look for e2fs and to ignore the error message in try_e2fs(). That > error is "wrong result: 'uuid'". Not sure where it comes from.
To be clear, it works with this patch, though I suspect it's not a good idea to ignore the "wrong result" error: --- Makefile.PL.orig 2015-05-12 16:27:12.000000000 -0700 +++ Makefile.PL 2015-05-12 16:27:14.000000000 -0700 @@ -105,7 +105,7 @@ return 0; /, )}; - if ($@) { my $L = length $@; print "# ===> Err($L): \"$@\"\n"; return 0 } + if ($@ && $@ !~ /wrong result/) { my $L = length $@; print "# ===> Err($L): \"$@\"\n"; return 0 } push @$defs, '-DPERL__UUID__E2FS_INT'; push @$libs, '-luuid'; print "# ===> Found!\n";
On Tue May 12 19:28:12 2015, DWHEELER wrote: Show quoted text
> On 2015-05-12 19:19:19, DWHEELER wrote: >
> > I was able to get it to build and for all tests to pass by forcing to > > only look for e2fs and to ignore the error message in try_e2fs(). > > That > > error is "wrong result: 'uuid'". Not sure where it comes from.
> > To be clear, it works with this patch, though I suspect it's not a > good idea to ignore the "wrong result" error: > > --- Makefile.PL.orig 2015-05-12 16:27:12.000000000 -0700 > +++ Makefile.PL 2015-05-12 16:27:14.000000000 -0700 > @@ -105,7 +105,7 @@ > return 0; > /, > )}; > - if ($@) { my $L = length $@; print "# ===> Err($L): \"$@\"\n"; > return 0 } > + if ($@ && $@ !~ /wrong result/) { my $L = length $@; print "# > ===> Err($L): \"$@\"\n"; return 0 } > push @$defs, '-DPERL__UUID__E2FS_INT'; > push @$libs, '-luuid'; > print "# ===> Found!\n";
My first (wrong) thought was that your system prototypes a couple of the parse/unparse functions a little differently. For instance: void uuid_unparse(const uuid_t uu, uuid_string_t out); Versus: void uuid_unparse(uuid_t uu, char *out); It's possible there's a buffer overflow there if your system expects more than a 37 char destination. It's not clear what uuid_string_t ultimately typedefs to. But, that doesn't make sense since test.pl passes... The "wrong result" is really coming from Devel::CheckLib in the block around line 330. Apparently the second system() call is failing, or at least not returning 0. That's where it tries to actually run the try_e2fs() test code. You might try something like this patch against CheckLib.pm: --- CheckLib.pm~ 2015-01-03 21:08:55.000000000 -0500 +++ /usr/lib/perl5/site_perl/5.20.1/Devel/CheckLib.pm 2015-08-16 06:55:11.457961878 -0400 @@ -327,7 +327,11 @@ push @missing, $lib if $rv != 0 || ! -x $exefile; my $absexefile = File::Spec->rel2abs($exefile); $absexefile = '"'.$absexefile.'"' if $absexefile =~ m/\s/; - push @wrongresult, $lib if $rv == 0 && -x $exefile && system($absexefile) != 0; + if ( $rv == 0 && -x $exefile ) { + my $runexe = system($absexefile); + warn "# system() returned $runexe\n" if $args{debug}; + push @wrongresult, $lib if $runexe != 0; + } unlink $ofile if -e $ofile; _cleanup_exe($exefile); } For bonus points you could add a die() too, just so you can run the leftover test program manually. I'd say it would dump core, but I wouldn't bet more than a half bucket of rusty bent nails on that. =)
Applied that patch, but the results look the same: # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlib97MmZvAr.c -o assertlibfzxTmOkG -luuid # # ===> Checking for -luuid # system() returned 0 # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlib49kv6hJ_.c -o assertlibjuEhS_xh # # ===> Checking for uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibKQGQTZOq.c -o assertlib0YDQu60a -luuid # system() returned 0 # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibsHYrpL6T.c -o assertlibYrAgpWWL # ===> Found! # # ===> Checking for uuid.h assertlibsHYrpL6T.c:1:10: fatal error: 'uuid.h' file not found #include <uuid.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibFyJgAXZP.c -o assertlibECYnoIX3 -luuid assertlibFyJgAXZP.c:1:10: fatal error: 'uuid.h' file not found #include <uuid.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlib6GjHxggS.c -o assertlibAv0bew4a # # ===> Checking for rpc.h assertlib6GjHxggS.c:1:10: fatal error: 'rpc.h' file not found #include <rpc.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibayp117po.c -o assertlib9y94WYjQ -luuid assertlibayp117po.c:1:10: fatal error: 'rpc.h' file not found #include <rpc.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibsRCkKPpB.c -o assertlibgg8Q1gfp # # ===> Checking for RPC interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibHZjJWtEV.c -o assertlibnWH2I1Kr -luuid assertlibHZjJWtEV.c:5:13: error: unknown type name 'int32_t'; did you mean '__int32_t'? int32_t r,s; ^~~~~~~ __int32_t /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/i386/_types.h:44:15: note: '__int32_t' declared here typedef int __int32_t; ^ assertlibHZjJWtEV.c:6:13: warning: implicit declaration of function 'uuid_create' is invalid in C99 [-Wimplicit-function-declaration] uuid_create(&u1,&s); ^ assertlibHZjJWtEV.c:7:13: warning: implicit declaration of function 'uuid_create_nil' is invalid in C99 [-Wimplicit-function-declaration] uuid_create_nil(&u2,&s); ^ assertlibHZjJWtEV.c:8:13: warning: implicit declaration of function 'uuid_from_string' is invalid in C99 [-Wimplicit-function-declaration] uuid_from_string(str,&u1,&s); ^ assertlibHZjJWtEV.c:9:13: warning: implicit declaration of function 'uuid_to_string' is invalid in C99 [-Wimplicit-function-declaration] uuid_to_string(&u1,&str,&s); ^ assertlibHZjJWtEV.c:10:38: error: too many arguments to function call, expected 2, have 3 r = uuid_compare(&u1,&u2,&s); ~~~~~~~~~~~~ ^~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/uuid/uuid.h:55:1: note: 'uuid_compare' declared here int uuid_compare(const uuid_t uu1, const uuid_t uu2); ^ assertlibHZjJWtEV.c:11:17: warning: implicit declaration of function 'uuid_equal' is invalid in C99 [-Wimplicit-function-declaration] r = uuid_equal(&u1,&u2,&s); ^ assertlibHZjJWtEV.c:12:17: warning: implicit declaration of function 'uuid_is_nil' is invalid in C99 [-Wimplicit-function-declaration] r = uuid_is_nil(&u1,&s); ^ 6 warnings and 2 errors generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibbyL0iv2B.c -o assertlibsxa85XIj # ===> Err(47): "Can't link/include C library 'uuid', aborting. " # ===> Checking for e2fs interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibV24iT6Nv.c -o assertlib3TZWNJwB -luuid # system() returned 11 # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibSMbaxQCf.c -o assertlib4ssuqGax # ===> Err(21): "wrong result: 'uuid' " # ===> Checking for Win interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibEgS56uX4.c -o assertlibVWkATWjQ assertlibEgS56uX4.c:2:10: fatal error: 'rpcdce.h' file not found #include <rpcdce.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibx5F0pVzg.c -o assertlibkG_zwA6I -lrpcrt4 assertlibx5F0pVzg.c:2:10: fatal error: 'rpcdce.h' file not found #include <rpcdce.h> ^ 1 error generated. No interface found. Can't continue. # ===> Err(61): "Can't link/include C library 'rpcdce.h', 'rpcrt4', aborting. "
Hrm, just upgraded to the El Capitan beta, and that wiped out uuid.h. I re-installed the command-line client and now it's back, but still not finding it. :-( # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibjcutfNyH.c -o assertlib8isnsesN -luuid # # ===> Checking for -luuid # system() returned 0 # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibheMd6cNX.c -o assertlibZ5iSORry # # ===> Checking for uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibXuOOu3YK.c -o assertlibaLheH8FL -luuid # system() returned 0 # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibkQHuN59O.c -o assertlibUla4moj4 # ===> Found! # # ===> Checking for uuid.h assertlibkQHuN59O.c:1:10: fatal error: 'uuid.h' file not found #include <uuid.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibXJCA3Efi.c -o assertlibr1RzacDe -luuid assertlibXJCA3Efi.c:1:10: fatal error: 'uuid.h' file not found #include <uuid.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlib21JOoQdp.c -o assertlibiNVF1PGR # # ===> Checking for rpc.h assertlib21JOoQdp.c:1:10: fatal error: 'rpc.h' file not found #include <rpc.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibOZxckKzS.c -o assertlibhJYftcN5 -luuid assertlibOZxckKzS.c:1:10: fatal error: 'rpc.h' file not found #include <rpc.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibAw25agwZ.c -o assertlibtpOrJfeT # # ===> Checking for RPC interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlib8iWRxRqd.c -o assertlibJyBqfeNc -luuid assertlib8iWRxRqd.c:5:13: error: unknown type name 'int32_t'; did you mean '__int32_t'? int32_t r,s; ^~~~~~~ __int32_t /usr/include/i386/_types.h:44:15: note: '__int32_t' declared here typedef int __int32_t; ^ assertlib8iWRxRqd.c:6:13: warning: implicit declaration of function 'uuid_create' is invalid in C99 [-Wimplicit-function-declaration] uuid_create(&u1,&s); ^ assertlib8iWRxRqd.c:7:13: warning: implicit declaration of function 'uuid_create_nil' is invalid in C99 [-Wimplicit-function-declaration] uuid_create_nil(&u2,&s); ^ assertlib8iWRxRqd.c:8:13: warning: implicit declaration of function 'uuid_from_string' is invalid in C99 [-Wimplicit-function-declaration] uuid_from_string(str,&u1,&s); ^ assertlib8iWRxRqd.c:9:13: warning: implicit declaration of function 'uuid_to_string' is invalid in C99 [-Wimplicit-function-declaration] uuid_to_string(&u1,&str,&s); ^ assertlib8iWRxRqd.c:10:38: error: too many arguments to function call, expected 2, have 3 r = uuid_compare(&u1,&u2,&s); ~~~~~~~~~~~~ ^~ /usr/include/uuid/uuid.h:55:1: note: 'uuid_compare' declared here int uuid_compare(const uuid_t uu1, const uuid_t uu2); ^ assertlib8iWRxRqd.c:11:17: warning: implicit declaration of function 'uuid_equal' is invalid in C99 [-Wimplicit-function-declaration] r = uuid_equal(&u1,&u2,&s); ^ assertlib8iWRxRqd.c:12:17: warning: implicit declaration of function 'uuid_is_nil' is invalid in C99 [-Wimplicit-function-declaration] r = uuid_is_nil(&u1,&s); ^ 6 warnings and 2 errors generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibG061zxio.c -o assertlibYbbeAzbd # ===> Err(47): "Can't link/include C library 'uuid', aborting. " # ===> Checking for e2fs interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibAKfc5mkI.c -o assertlibv1Yba_Tx -luuid # system() returned 11 # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibQlz1cecI.c -o assertlib03UZ78EP # ===> Err(21): "wrong result: 'uuid' " # ===> Checking for Win interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlib3YJi8sa0.c -o assertlibe3epzU7r assertlib3YJi8sa0.c:2:10: fatal error: 'rpcdce.h' file not found #include <rpcdce.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibABel8xld.c -o assertliblbtWSvCL -lrpcrt4 assertlibABel8xld.c:2:10: fatal error: 'rpcdce.h' file not found #include <rpcdce.h> ^ 1 error generated. No interface found. Can't continue. # ===> Err(61): "Can't link/include C library 'rpcdce.h', 'rpcrt4', aborting. "
On Mon Aug 17 20:37:27 2015, DWHEELER wrote: Show quoted text
> # ===> Checking for e2fs interface in uuid/uuid.h > # system() returned 11 > # ===> Err(21): "wrong result: 'uuid' > "
Looks like a SIGSEGV. At least that's what signal 11 is here... Best guess is the additional uuid_string_t type on OS/X, so maybe this will solve the problem against Makefile.PL: --- Makefile.PL~ 2014-12-28 08:33:02.920933847 -0500 +++ Makefile.PL 2015-08-17 20:37:28.341680792 -0400 @@ -89,7 +89,7 @@ debug => 1, function => qq/ int i; - char s[37]; + uuid_string_t s; uuid_t u,uu; uuid_generate(u); uuid_generate_random(u); If not, well, I'd just be grasping at straws. You could also try deleting the uuid_*() calls one at a time in the try_e2fs() code, working from the bottom up until system() returns 0.
Arrrgh.. RT hides the quoted text, so be sure to expand that on my last message to see what I was looking at.
# /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibh9_3wxb6.c -o assertlib69iK2L9s -luuid # # ===> Checking for -luuid # system() returned 0 # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibOVUhCTnT.c -o assertlibR542oXvg # # ===> Checking for uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibRLRyzbIz.c -o assertlib8cqduAPR -luuid # system() returned 0 # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibvbc3di7f.c -o assertlibxEhZQ29e # ===> Found! # # ===> Checking for uuid.h assertlibvbc3di7f.c:1:10: fatal error: 'uuid.h' file not found #include <uuid.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibEePk8Rqm.c -o assertlib9k6gra_G -luuid assertlibEePk8Rqm.c:1:10: fatal error: 'uuid.h' file not found #include <uuid.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibHgIJB1rD.c -o assertlibRW664jKd # # ===> Checking for rpc.h assertlibHgIJB1rD.c:1:10: fatal error: 'rpc.h' file not found #include <rpc.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibhvn83ah8.c -o assertlibM1snNYjw -luuid assertlibhvn83ah8.c:1:10: fatal error: 'rpc.h' file not found #include <rpc.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlib3t47xZqu.c -o assertlibv74IEtGA # # ===> Checking for RPC interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibhAHsPjjW.c -o assertlibCk9OAqH1 -luuid assertlibhAHsPjjW.c:6:13: error: unknown type name 'int32_t'; did you mean '__int32_t'? int32_t r,s; ^~~~~~~ __int32_t /usr/include/i386/_types.h:44:15: note: '__int32_t' declared here typedef int __int32_t; ^ assertlibhAHsPjjW.c:6:23: error: redefinition of 's' with a different type: '__int32_t' (aka 'int') vs 'uuid_string_t' (aka 'char [37]') int32_t r,s; ^ assertlibhAHsPjjW.c:4:27: note: previous definition is here uuid_string_t s; ^ assertlibhAHsPjjW.c:7:13: warning: implicit declaration of function 'uuid_create' is invalid in C99 [-Wimplicit-function-declaration] uuid_create(&u1,&s); ^ assertlibhAHsPjjW.c:8:13: warning: implicit declaration of function 'uuid_create_nil' is invalid in C99 [-Wimplicit-function-declaration] uuid_create_nil(&u2,&s); ^ assertlibhAHsPjjW.c:9:13: warning: implicit declaration of function 'uuid_from_string' is invalid in C99 [-Wimplicit-function-declaration] uuid_from_string(str,&u1,&s); ^ assertlibhAHsPjjW.c:10:13: warning: implicit declaration of function 'uuid_to_string' is invalid in C99 [-Wimplicit-function-declaration] uuid_to_string(&u1,&str,&s); ^ assertlibhAHsPjjW.c:11:38: error: too many arguments to function call, expected 2, have 3 r = uuid_compare(&u1,&u2,&s); ~~~~~~~~~~~~ ^~ /usr/include/uuid/uuid.h:55:1: note: 'uuid_compare' declared here int uuid_compare(const uuid_t uu1, const uuid_t uu2); ^ assertlibhAHsPjjW.c:12:17: warning: implicit declaration of function 'uuid_equal' is invalid in C99 [-Wimplicit-function-declaration] r = uuid_equal(&u1,&u2,&s); ^ assertlibhAHsPjjW.c:13:17: warning: implicit declaration of function 'uuid_is_nil' is invalid in C99 [-Wimplicit-function-declaration] r = uuid_is_nil(&u1,&s); ^ 6 warnings and 3 errors generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibxJHxoO8e.c -o assertlib0WaaUX4l # ===> Err(47): "Can't link/include C library 'uuid', aborting. " # ===> Checking for e2fs interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibAgBk9Jl9.c -o assertlibsObYprHY -luuid # system() returned 11 # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibTbtolaYl.c -o assertlibooPF_muX # ===> Err(21): "wrong result: 'uuid' " # ===> Checking for Win interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibv1oqUzjQ.c -o assertlibAeWtNe_O assertlibv1oqUzjQ.c:2:10: fatal error: 'rpcdce.h' file not found #include <rpcdce.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibLW2JYi85.c -o assertlibUxWJAXKY -lrpcrt4 assertlibLW2JYi85.c:2:10: fatal error: 'rpcdce.h' file not found #include <rpcdce.h> ^ 1 error generated. No interface found. Can't continue. # ===> Err(61): "Can't link/include C library 'rpcdce.h', 'rpcrt4', aborting. "
With that segfault still showing up this looks like an OSX problem, but it's really strange that test.pl passes with your earlier patch. Perhaps some strange interaction between Perl's system() call with scalar value and the shell? If you'll indulge me one last time though, maybe we can at least narrow down which sandbox to play in. Copy the following code block into testprog.c, then run: cc -luuid -o testprog testprog.c && ./testprog It should either segfault or print a cheery message. =) Show quoted text
---- begin code ---- #include <stdio.h> #include <uuid/uuid.h> int main(void) { int i; char s[37]; uuid_t u,uu; uuid_generate(u); uuid_generate_random(u); uuid_generate_time(u); uuid_unparse(u,s); uuid_unparse_lower(u,s); uuid_unparse_upper(u,s); uuid_parse(s,u); uuid_clear(u); uuid_copy(uu,u); i = uuid_compare(u,uu); i = uuid_is_null(u); printf("Success!\n"); return 0; } ---- end code ---- And by the way, thanks for the help. If it's not obvious, I don't have an OSX machine available so this is a little more than frustrating from my vantage point too.
Subject: Re: [rt.cpan.org #104394] Unable to build on OS X Yosemite
Date: Tue, 18 Aug 2015 17:03:02 -0700
To: bug-UUID [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
On Aug 18, 2015, at 4:38 PM, Rick Myers via RT <bug-UUID@rt.cpan.org> wrote: Show quoted text
> cc -luuid -o testprog testprog.c && ./testprog > > It should either segfault or print a cheery message. =)
Show quoted text
> cc -luuid -o testprog testprog.c && ./testprog
zsh: segmentation fault ./testprog By applying comments and removing comments, I reduced the error to this line: i = uuid_compare(u,uu); With that line commented-out, I get the cheery message. I can also get it to run successfully with that line uncommented, but all of the uuid_unparse() lines commented: /* uuid_unparse(u,s); */ /* uuid_unparse_lower(u,s); */ /* uuid_unparse_upper(u,s); */ So it seems like it doesn’t like to compare UUIDs that have been unparsed. Show quoted text
> And by the way, thanks for the help. If it's not obvious, I don't have an OSX machine available so this is a little more than frustrating from my vantage point too.
Hey, I get it. Thanks for poking at this, even if this async process is slow! Hope the above helps. Best, David
Subject: Re: [rt.cpan.org #104394] Unable to build on OS X Yosemite
Date: Tue, 18 Aug 2015 17:06:01 -0700
To: bug-UUID [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Hrm. And it seems if I have only this line commented out: uuid_parse(s,u); I get a bus error instead of a sefault. Cute. Thanks, David
I've filed a bug report with Apple: rdar://22370147 http://openradar.appspot.com/radar?id=6069753579831296
On 2015-08-20 18:43:52, DWHEELER wrote: Show quoted text
> I've filed a bug report with Apple: > > rdar://22370147 > http://openradar.appspot.com/radar?id=6069753579831296
Apple got back to me. They pointed out that if you omit the `-luuid` option, it works. This is because UUID is part of libc on OS X. I was able to confirm that fix with the following patch: --- Makefile.PL.org 2015-10-10 09:56:40.000000000 -0700 +++ Makefile.PL 2015-10-10 09:57:29.000000000 -0700 @@ -84,7 +84,7 @@ my $hdr = shift; print "# ===> Checking for e2fs interface in $hdr\n"; eval { assert_lib( - lib => 'uuid', + # lib => 'uuid', header => $hdr, debug => 1, function => qq/ @@ -107,7 +107,7 @@ )}; if ($@) { my $L = length $@; print "# ===> Err($L): \"$@\"\n"; return 0 } push @$defs, '-DPERL__UUID__E2FS_INT'; - push @$libs, '-luuid'; + # push @$libs, '-luuid'; print "# ===> Found!\n"; print "#\n"; return 1; However, the tests die: $ make test PERL_DL_NONLAZY=1 "/Users/david/perl5/perlbrew/perls/perl-5.22.0/bin/perl" "-Iblib/lib" "-Iblib/arch" test.pl 1..34 # Running under perl version 5.022000 for darwin # Current time local: Sat Oct 10 10:08:54 2015 # Current time GMT: Sat Oct 10 17:08:54 2015 # Using Test.pm version 1.26 # Header: uuid/uuid.h # Interface: e2fs # Buffer size: 5 # Struct size: 0 ok 1 ok 2 ok 3 make: *** [test_dynamic] Abort trap: 6 :-(
Subject: [rt.cpan.org #104394]
Date: Thu, 3 Mar 2016 17:49:13 -0500
To: bug-UUID [...] rt.cpan.org
From: William Faulk <wfaulk [...] gmail.com>
The problem is that get_struct_size() in Makefile.PL is returning 0. That sets the value for the define for PERL__UUID__STRUCT_SZ, which is used in UUID.xs to set the value returned by UUID_BUF_SZ(), which is used to size the string buffers in the various unparse functions. I can't figure out why get_struct_size() is failing, but I changed UUID.xs to use uuid_string_t and it compiles and the tests work now. Here's the entire patch that seems to make the UUID distribution work under MacOSX 10.11.3: diff -u UUID-0.24/Makefile.PL UUID-0.24.macos/Makefile.PL --- UUID-0.24/Makefile.PL 2014-12-28 08:33:02.000000000 -0500 +++ UUID-0.24.macos/Makefile.PL 2016-03-03 17:39:15.000000000 -0500 @@ -14,7 +14,7 @@ # no sense wasting our time... print "# ===> Checking for -luuid\n"; check_lib_or_exit( - lib => 'uuid', + #lib => 'uuid', debug => 1, ); print "#\n"; @@ -24,7 +24,7 @@ for my $try (qw{ uuid/uuid.h uuid.h rpc.h }) { print "# ===> Checking for $try\n"; eval { assert_lib( - lib => 'uuid', + #lib => 'uuid', header => $try, debug => 1, )}; @@ -84,7 +84,7 @@ my $hdr = shift; print "# ===> Checking for e2fs interface in $hdr\n"; eval { assert_lib( - lib => 'uuid', + #lib => 'uuid', header => $hdr, debug => 1, function => qq/ @@ -107,7 +107,7 @@ )}; if ($@) { my $L = length $@; print "# ===> Err($L): \"$@\"\n"; return 0 } push @$defs, '-DPERL__UUID__E2FS_INT'; - push @$libs, '-luuid'; + #push @$libs, '-luuid'; print "# ===> Found!\n"; print "#\n"; return 1; diff -u UUID-0.24/UUID.xs UUID-0.24.macos/UUID.xs --- UUID-0.24/UUID.xs 2015-01-19 01:01:14.000000000 -0500 +++ UUID-0.24.macos/UUID.xs 2016-03-03 17:45:44.000000000 -0500 @@ -96,9 +96,9 @@ void do_unparse(SV *in, SV * out) { #ifdef PERL__UUID__E2FS_INT - char str[UUID_BUF_SZ()]; + uuid_string_t str; uuid_unparse(SV2UUID(in), str); - sv_setpvn(out, str, UUID_BUF_SZ()-1); + sv_setpvn(out, str, sizeof(uuid_string_t)-1); #elif PERL__UUID__RPC_INT char *str; int32_t s; @@ -119,9 +119,9 @@ void do_unparse_lower(SV *in, SV * out) { #ifdef PERL__UUID__E2FS_INT - char str[UUID_BUF_SZ()]; + uuid_string_t str; uuid_unparse_lower(SV2UUID(in), str); - sv_setpvn(out, str, UUID_BUF_SZ()-1); + sv_setpvn(out, str, sizeof(uuid_string_t)-1); #elif PERL__UUID__RPC_INT char *p, *str; int32_t s; @@ -145,9 +145,9 @@ void do_unparse_upper(SV *in, SV * out) { #ifdef PERL__UUID__E2FS_INT - char str[UUID_BUF_SZ()]; + uuid_string_t str; uuid_unparse_upper(SV2UUID(in), str); - sv_setpvn(out, str, UUID_BUF_SZ()-1); + sv_setpvn(out, str, sizeof(uuid_string_t)-1); #elif PERL__UUID__RPC_INT char *p, *str; int32_t s; @@ -271,10 +271,10 @@ SV* do_uuid() { UUID_T uuid; #ifdef PERL__UUID__E2FS_INT - char str[UUID_BUF_SZ()]; + uuid_string_t str; uuid_generate(uuid); uuid_unparse(uuid, str); - return newSVpvn(str, UUID_BUF_SZ()-1); + return newSVpvn(str, sizeof(uuid_string_t)-1); #elif PERL__UUID__RPC_INT SV *sv; char *str;
I can confirm that this patch fixes it for me, too. Though I couldn't get it to apply, so made the changes manually and generated a new patch, attached. Not sure how this would translate for a general solution, though.
Subject: uuid-osx.patch
diff -Naur UUID-0.24/Makefile.PL UUID-0.24.osx/Makefile.PL --- UUID-0.24/Makefile.PL 2014-12-28 05:33:02.000000000 -0800 +++ UUID-0.24.osx/Makefile.PL 2016-03-03 14:58:43.000000000 -0800 @@ -14,7 +14,7 @@ # no sense wasting our time... print "# ===> Checking for -luuid\n"; check_lib_or_exit( - lib => 'uuid', + # lib => 'uuid', debug => 1, ); print "#\n"; @@ -24,7 +24,7 @@ for my $try (qw{ uuid/uuid.h uuid.h rpc.h }) { print "# ===> Checking for $try\n"; eval { assert_lib( - lib => 'uuid', + # lib => 'uuid', header => $try, debug => 1, )}; @@ -84,7 +84,7 @@ my $hdr = shift; print "# ===> Checking for e2fs interface in $hdr\n"; eval { assert_lib( - lib => 'uuid', + # lib => 'uuid', header => $hdr, debug => 1, function => qq/ @@ -107,7 +107,7 @@ )}; if ($@) { my $L = length $@; print "# ===> Err($L): \"$@\"\n"; return 0 } push @$defs, '-DPERL__UUID__E2FS_INT'; - push @$libs, '-luuid'; + # push @$libs, '-luuid'; print "# ===> Found!\n"; print "#\n"; return 1; diff -Naur UUID-0.24/UUID.xs UUID-0.24.osx/UUID.xs --- UUID-0.24/UUID.xs 2015-01-18 22:01:14.000000000 -0800 +++ UUID-0.24.osx/UUID.xs 2016-03-03 14:56:22.000000000 -0800 @@ -96,9 +96,9 @@ void do_unparse(SV *in, SV * out) { #ifdef PERL__UUID__E2FS_INT - char str[UUID_BUF_SZ()]; + uuid_string_t str; uuid_unparse(SV2UUID(in), str); - sv_setpvn(out, str, UUID_BUF_SZ()-1); + sv_setpvn(out, str, sizeof(uuid_string_t)-1); #elif PERL__UUID__RPC_INT char *str; int32_t s; @@ -119,9 +119,9 @@ void do_unparse_lower(SV *in, SV * out) { #ifdef PERL__UUID__E2FS_INT - char str[UUID_BUF_SZ()]; + uuid_string_t str; uuid_unparse_lower(SV2UUID(in), str); - sv_setpvn(out, str, UUID_BUF_SZ()-1); + sv_setpvn(out, str, sizeof(uuid_string_t)-1); #elif PERL__UUID__RPC_INT char *p, *str; int32_t s; @@ -145,9 +145,9 @@ void do_unparse_upper(SV *in, SV * out) { #ifdef PERL__UUID__E2FS_INT - char str[UUID_BUF_SZ()]; + uuid_string_t str; uuid_unparse_upper(SV2UUID(in), str); - sv_setpvn(out, str, UUID_BUF_SZ()-1); + sv_setpvn(out, str, sizeof(uuid_string_t)-1); #elif PERL__UUID__RPC_INT char *p, *str; int32_t s; @@ -271,10 +271,10 @@ SV* do_uuid() { UUID_T uuid; #ifdef PERL__UUID__E2FS_INT - char str[UUID_BUF_SZ()]; + uuid_string_t str; uuid_generate(uuid); uuid_unparse(uuid, str); - return newSVpvn(str, UUID_BUF_SZ()-1); + return newSVpvn(str, sizeof(uuid_string_t)-1); #elif PERL__UUID__RPC_INT SV *sv; char *str;
Subject: Re: [rt.cpan.org #104394]
Date: Fri, 4 Mar 2016 10:24:04 -0500
To: bug-UUID [...] rt.cpan.org
From: William Faulk <wfaulk [...] gmail.com>
Sorry about the patch. I copied-and-pasted when I should have attached. I think a general solution might be to use uuid_string_t, typedef-ing it to the current thing if it doesn't already exist. MacOS #defines _UUID_STRING_T. Of course, that assumes that uuid_string_t is always going to be implemented as a string by OSes, since it's being treated as such. The MacOS man page for uuid_unparse explicitly says "uuid_string_t (37-byte string including tailing '\0')", though. I'm not sure that the current sizing calculation really makes sense, to be honest: /* 2 hex digits per byte + 4 separators + 1 trailing null */ #define UUID_BUF_SZ() (2 * PERL__UUID__STRUCT_SZ + 4 + 1) PERL__UUID__STRUCT_SZ is sizeof(uuid_t). Why are we basing the size of the string representation on the size of an opaque binary representation? We're assuming that uuid_t is only ever going to contain the raw 128-bit value, but is that a valid assumption? In addition, is it ever going to be anything other than the space to hold a 36-character string?
On Thu Mar 03 18:02:15 2016, DWHEELER wrote: Show quoted text
> > Not sure how this would translate for a general solution, though.
Actually, it translates very well. The attached patch was done on FreeBSD, but it had a very similar problem -- the uuid code is within libc. I had to link explicitly with -lc instead of -luuid, so on the basis of the latest XS changes I'm assuming OSX needs the same thing.
Subject: makefile.diff
--- Makefile.PL~ 2014-12-28 08:33:02.000000000 -0500 +++ Makefile.PL 2016-03-05 06:05:31.000000000 -0500 @@ -12,11 +12,19 @@ # if the compiler can't find it, # no sense wasting our time... -print "# ===> Checking for -luuid\n"; -check_lib_or_exit( - lib => 'uuid', - debug => 1, -); +my $link_lib; +for my $try (qw{ rpcrt4 uuid c }) { + print "# ===> Checking for -l$try\n"; + if ( check_lib( lib => $try, debug => 1 ) ) { + $link_lib = $try; + last; + } +} +unless ( $link_lib ) { + print "# ===> Not found! Can't continue\n"; + exit 0; +} +print "# ===> Linking with -l$link_lib\n"; print "#\n"; @@ -24,7 +32,7 @@ for my $try (qw{ uuid/uuid.h uuid.h rpc.h }) { print "# ===> Checking for $try\n"; eval { assert_lib( - lib => 'uuid', + lib => $link_lib, header => $try, debug => 1, )}; @@ -55,7 +63,7 @@ my $hdr = shift; print "# ===> Checking for RPC interface in $hdr\n"; eval { assert_lib( - lib => 'uuid', + lib => $link_lib, header => $hdr, debug => 1, function => qq/ @@ -74,7 +82,7 @@ )}; if ($@) { my $L = length $@; print "# ===> Err($L): \"$@\"\n"; return 0 } push @$defs, '-DPERL__UUID__RPC_INT'; - push @$libs, '-luuid'; + push @$libs, "-l$link_lib", print "# ===> Found!\n"; print "#\n"; return 1; @@ -84,7 +92,7 @@ my $hdr = shift; print "# ===> Checking for e2fs interface in $hdr\n"; eval { assert_lib( - lib => 'uuid', + lib => $link_lib, header => $hdr, debug => 1, function => qq/ @@ -107,7 +115,7 @@ )}; if ($@) { my $L = length $@; print "# ===> Err($L): \"$@\"\n"; return 0 } push @$defs, '-DPERL__UUID__E2FS_INT'; - push @$libs, '-luuid'; + push @$libs, "-l$link_lib", print "# ===> Found!\n"; print "#\n"; return 1; @@ -117,7 +125,7 @@ my $hdr = shift; print "# ===> Checking for Win interface in $hdr\n"; eval { assert_lib( - lib => 'rpcrt4', + lib => $link_lib, header => [ $hdr, 'rpcdce.h' ], debug => 1, function => qq/ @@ -139,7 +147,7 @@ )}; if ($@) { my $L = length $@; print "# ===> Err($L): \"$@\"\n"; return 0 } push @$defs, '-DPERL__UUID__WIN_INT'; - push @$libs, '-lrpcrt4'; + push @$libs, "-l$link_lib"; print "# ===> Found!\n"; print "#\n"; return 1;
On Fri Mar 04 10:24:34 2016, wfaulk@gmail.com wrote: Show quoted text
> Sorry about the patch. I copied-and-pasted when I should have attached. > > I think a general solution might be to use uuid_string_t, typedef-ing > it to the current thing if it doesn't already exist. MacOS #defines > _UUID_STRING_T. > > Of course, that assumes that uuid_string_t is always going to be > implemented as a string by OSes, since it's being treated as such. > The MacOS man page for uuid_unparse explicitly says "uuid_string_t > (37-byte string including tailing '\0')", though. >
Currently, Apple is the only vendor defining uuid_string_t. Everywhere else the prototypes are for either char* or char**. And my fear is that eventually others will start jumping on the uuid_string_t bandwagon also, and naturally all have their own way of doing it. So, worst case, I think we'd see the two existing unix interfaces turning into 4 or 8 as we deal with the variations. I think I like just leaving it the way it is since that uuid_string_t is ultimately just a char[37] anyway. Show quoted text
> > I'm not sure that the current sizing calculation really makes sense, > to be honest: > > /* 2 hex digits per byte + 4 separators + 1 trailing null */ > #define UUID_BUF_SZ() (2 * PERL__UUID__STRUCT_SZ + 4 + 1) > > PERL__UUID__STRUCT_SZ is sizeof(uuid_t). Why are we basing the size > of the string representation on the size of an opaque binary > representation? We're assuming that uuid_t is only ever going to > contain the raw 128-bit value, but is that a valid assumption? In > addition, is it ever going to be anything other than the space to hold > a 36-character string? >
Honestly, I think the only reason that UUID_BUF_SZ is defined at all is because it bothered me having all the hardcoded 37's in the code. And since sizeof(uuid_t) is the only really universal constant, that's how it came to be calculated like that. It could easily be moved to Makefile.PL and passed as a variable instead, or just simply defined as 37.
This has been released to CPAN as version 0.24_02, along with a few other minor changes. So far there's been one successful install on OS X (0.24_01) so I'll wait to close this until we see more. Thanks to both of you though for pointing me in the right direction. And sorry for the long delay. I totally missed the update back in Oct.(?)
Subject: Re: [rt.cpan.org #104394] Unable to build on OS X Yosemite
Date: Fri, 11 Mar 2016 19:41:05 -0800
To: bug-UUID [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
On Mar 11, 2016, at 1:24 PM, Rick Myers via RT <bug-UUID@rt.cpan.org> wrote: Show quoted text
> This has been released to CPAN as version 0.24_02, along with a few other minor changes. So far there's been one successful install on OS X (0.24_01) so I'll wait to close this until we see more. > > Thanks to both of you though for pointing me in the right direction. And sorry for the long delay. I totally missed the update back in Oct.(?)
Sadly did not work for me: cpan[2]> install J/JR/JRM/UUID-0.24_02.tar.gz Fetching with LWP: http://cpan.metacpan.org/authors/id/J/JR/JRM/UUID-0.24_02.tar.gz CPAN: Digest::SHA loaded ok (v5.95) Warning (usually harmless): 'YAML' not installed, cannot parse '/Users/david/.cpan/FTPstats.yml' Fetching with LWP: http://cpan.metacpan.org/authors/id/J/JR/JRM/CHECKSUMS Checksum for /Users/david/.cpan/sources/authors/id/J/JR/JRM/UUID-0.24_02.tar.gz ok Scanning cache /Users/david/.cpan/build for sizes ....................--------------------------------------------------------DONE CPAN: Archive::Tar loaded ok (v2.04) x UUID-0.24_02/ x UUID-0.24_02/Makefile.PL x UUID-0.24_02/META.json x UUID-0.24_02/Changes x UUID-0.24_02/UUID.pm x UUID-0.24_02/README x UUID-0.24_02/MANIFEST x UUID-0.24_02/t/ x UUID-0.24_02/t/test.t x UUID-0.24_02/META.yml x UUID-0.24_02/UUID.xs x UUID-0.24_02/License CPAN: File::Temp loaded ok (v0.2304) 'YAML' not installed, will not store persistent state CPAN: CPAN::Meta::Requirements loaded ok (v2.132) CPAN: Parse::CPAN::Meta loaded ok (v1.4414) CPAN: CPAN::Meta loaded ok (v2.150001) CPAN: Module::CoreList loaded ok (v5.20150520) Configuring J/JR/JRM/UUID-0.24_02.tar.gz with Makefile.PL CPAN::Reporter not installed. No reports will be sent. # # ===> Checking for -lrpcrt4 # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibdXl8DpD0.c -o assertlibpoeFc0q1 -lrpcrt4 ld: library not found for -lrpcrt4 clang: error: linker command failed with exit code 1 (use -v to see invocation) # ===> Checking for -luuid # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlib_7in6xSn.c -o assertlibP7YUX35n -luuid # system() returned 0 # ===> Linking with -luuid # # ===> Checking for uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibVdoaqa62.c -o assertlibNifNdno2 # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlib8C9FFw86.c -o assertlibiYLva3AP -luuid # system() returned 0 # ===> Found! # # ===> Checking for uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlib5jktib68.c -o assertlibVoPixtB8 assertlib5jktib68.c:1:10: fatal error: 'uuid.h' file not found #include <uuid.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibEItpQtAI.c -o assertlibGzz0GT9h -luuid assertlibEItpQtAI.c:1:10: fatal error: 'uuid.h' file not found #include <uuid.h> ^ 1 error generated. # # ===> Checking for rpc.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibRL9CD8gZ.c -o assertlib2cwy4kzU assertlibRL9CD8gZ.c:1:10: fatal error: 'rpc.h' file not found #include <rpc.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibp2nRt0nd.c -o assertlib7UHgT1qg -luuid assertlibp2nRt0nd.c:1:10: fatal error: 'rpc.h' file not found #include <rpc.h> ^ 1 error generated. # # ===> Checking for RPC interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibbsOQbeVF.c -o assertlibkIWeKRm2 # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibCkFfOy9L.c -o assertlibaHtLnqA0 -luuid assertlibCkFfOy9L.c:5:13: error: unknown type name 'int32_t'; did you mean '__int32_t'? int32_t r,s; ^~~~~~~ __int32_t /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/i386/_types.h:44:15: note: '__int32_t' declared here typedef int __int32_t; ^ assertlibCkFfOy9L.c:7:13: warning: implicit declaration of function 'uuid_create' is invalid in C99 [-Wimplicit-function-declaration] uuid_create(&u1,&s); ^ assertlibCkFfOy9L.c:8:13: warning: implicit declaration of function 'uuid_create_nil' is invalid in C99 [-Wimplicit-function-declaration] uuid_create_nil(&u2,&s); ^ assertlibCkFfOy9L.c:9:13: warning: implicit declaration of function 'uuid_from_string' is invalid in C99 [-Wimplicit-function-declaration] uuid_from_string(str,&u1,&s); ^ assertlibCkFfOy9L.c:10:13: warning: implicit declaration of function 'uuid_to_string' is invalid in C99 [-Wimplicit-function-declaration] uuid_to_string(&u1,&str,&s); ^ assertlibCkFfOy9L.c:11:38: error: too many arguments to function call, expected 2, have 3 r = uuid_compare(&u1,&u2,&s); ~~~~~~~~~~~~ ^~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/uuid/uuid.h:55:1: note: 'uuid_compare' declared here int uuid_compare(const uuid_t uu1, const uuid_t uu2); ^ assertlibCkFfOy9L.c:12:17: warning: implicit declaration of function 'uuid_equal' is invalid in C99 [-Wimplicit-function-declaration] r = uuid_equal(&u1,&u2,&s); ^ assertlibCkFfOy9L.c:13:17: warning: implicit declaration of function 'uuid_is_nil' is invalid in C99 [-Wimplicit-function-declaration] r = uuid_is_nil(&u1,&s); ^ 6 warnings and 2 errors generated. # ===> Err(47): "Can't link/include C library 'uuid', aborting. " # ===> Checking for e2fs interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibRgCF1FsV.c -o assertlibwtzgqOFq # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlib_4zFaMyj.c -o assertlibIs62Pzvo -luuid # system() returned 11 # ===> Err(21): "wrong result: 'uuid' " # ===> Checking for Win interface in uuid/uuid.h # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibQE2Tmtzd.c -o assertlibKLRHpSmc # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibRXfMdyvN.c -o assertlibeO3Dp0wn assertlibRXfMdyvN.c:2:10: fatal error: 'rpcdce.h' file not found #include <rpcdce.h> ^ 1 error generated. # /usr/bin/cc -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fstack-protector-strong -L/usr/local/lib assertlibYQj25180.c -o assertlibqTtsNJxW -luuid assertlibYQj25180.c:2:10: fatal error: 'rpcdce.h' file not found #include <rpcdce.h> ^ 1 error generated. # ===> Err(59): "Can't link/include C library 'rpcdce.h', 'uuid', aborting. " No interface found. Can't continue. Warning: No success on command[/Users/david/perl5/perlbrew/perls/perl-5.22.0/bin/perl Makefile.PL] JRM/UUID-0.24_02.tar.gz /Users/david/perl5/perlbrew/perls/perl-5.22.0/bin/perl Makefile.PL -- NOT OK Failed during this command: JRM/UUID-0.24_02.tar.gz : writemakefile NO '/Users/david/perl5/perlbrew/perls/perl-5.22.0/bin/perl Makefile.PL' returned status 512 cpan[3]>
Yes, it's pretty bothersome that it links and runs as long as there aren't any uuid function calls. I've released 0.24_03 now which delays the link flag decision until later when it tries to run something more substantial. Since the build is possibly a lot more verbose though, I've also turned off all the debug parameters. To turn them back on... perl Makefile.PL DEBUG=1 Thanks!
Subject: Re: [rt.cpan.org #104394] Unable to build on OS X Yosemite
Date: Sun, 13 Mar 2016 20:17:40 -0700
To: bug-UUID [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
There we go! Generating a Unix-style Makefile Writing Makefile for UUID Writing MYMETA.yml and MYMETA.json JRM/UUID-0.24_03.tar.gz /Users/david/perl5/perlbrew/perls/perl-5.22.0/bin/perl Makefile.PL -- OK Running make for J/JR/JRM/UUID-0.24_03.tar.gz cp UUID.pm blib/lib/UUID.pm Running Mkbootstrap for UUID () chmod 644 "UUID.bs" "/Users/david/perl5/perlbrew/perls/perl-5.22.0/bin/perl" "/Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/ExtUtils/xsubpp" -typemap "/Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/ExtUtils/typemap" UUID.xs > UUID.xsc && mv UUID.xsc UUID.c cc -c -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -O3 -DVERSION=\"0.24_03\" -DXS_VERSION=\"0.24_03\" "-I/Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/darwin-2level/CORE" -DPERL__UUID__E2FS_INT -DPERL__UUID__STRUCT_SZ=16 -DPERL__UUID__UUID_UUID_H UUID.c rm -f blib/arch/auto/UUID/UUID.bundle env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong UUID.o -o blib/arch/auto/UUID/UUID.bundle \ -lc \ ld: warning: object file (UUID.o) was built for newer OSX version (10.11) than being linked (10.4) chmod 755 blib/arch/auto/UUID/UUID.bundle "/Users/david/perl5/perlbrew/perls/perl-5.22.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- UUID.bs blib/arch/auto/UUID/UUID.bs 644 Manifying 1 pod document JRM/UUID-0.24_03.tar.gz /usr/bin/make -- OK Running make test Running Mkbootstrap for UUID () chmod 644 "UUID.bs" PERL_DL_NONLAZY=1 "/Users/david/perl5/perlbrew/perls/perl-5.22.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/test.t .. ok All tests successful. Files=1, Tests=34, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.02 cusr 0.00 csys = 0.05 CPU) Result: PASS JRM/UUID-0.24_03.tar.gz /usr/bin/make test -- OK Running make install Prepending /Users/david/.cpan/build/UUID-0.24_03-Gjoa3J/blib/arch /Users/david/.cpan/build/UUID-0.24_03-Gjoa3J/blib/lib to PERL5LIB for 'install' Manifying 1 pod document Files found in blib/arch: installing files in blib/lib into architecture dependent library tree Installing /Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/darwin-2level/auto/UUID/UUID.bundle Installing /Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/darwin-2level/UUID.pm Installing /Users/david/perl5/perlbrew/perls/perl-5.22.0/man/man3/UUID.3 Appending installation info to /Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/darwin-2level/perllocal.pod JRM/UUID-0.24_03.tar.gz make install UNINST=1 — OK Thanks, David
The uploaded file UUID-0.25.tar.gz has entered CPAN as file: $CPAN/authors/id/J/JR/JRM/UUID-0.25.tar.gz size: 14383 bytes md5: d9f615fda1b61668f5e5ba1f4f87d21f