Hello bliako,
Perlbrew is cool! I tried it and it worked, right out of the box to build 5.20.3. First time I've built Perl from sources and it is amazing. I initially got two failed tests in Memoize but I believe the tests failed due to a time out. I found the failed tests and ran their .t file manually and they passed. Just to be sure, I ran all the tests for that module with a find command with -exec to have perl read all of the test files in that directory and all passed, so I forced the install of 5.20.3.
However, I can't totally give up on installing PerlIO::Layers in the native perl that ships with High Sierra, as others may be struggling with this too. The problem is that 'version' is defined in only one place and is used to initialize both the .pm file and the .o file by way of compiler -D macros. Setting it for the compiler hoses the .pm and setting it for the module causes the compiler to choke. There is no way to set XS_VERSION and VERSION manually, only indirectly by way of 'dist_version'. Therefore, the automated build/test process is broken. ExtUtils::CBuilder::Base sets compiler -D macros with this fragment of perl I modified: #!/usr/bin/env perl -w
##!/usr/bin/env perl -wd
use strict;
use Data::Dumper;
$Data::Dumper::Purity = 1;
my %args = (
XS_VERSION => '\'"0.011"\'',
VERSION => '\'"0.011"\'',
);
print arg_defines(%args), "\n";
exit 0;
sub arg_defines {
my (%args) = @_;
# my ($self, %args) = @_;
return map "-D$_=$args{$_}", keys %args;
}
__END__
which when run yields:$ macro-D.pl
-DXS_VERSION='"0.011"'-DVERSION='"0.011"'
Data::Dumper is syntactic sugar for when I run in Perl's debugger. Whenever anything like these strings is set in 'dist_version', the build fails and 00-compile.t fails. To manually build the module and its shared library do: ./Build clean and then ./Build and extract the two cc commands, one to compile and one to link in the bundle, run them manually and all will be well. With this work-around I was able to do what triggered this thread, namely, build PDL. So, it isn't absolutely necessary in macOS High Sierra to resort to perlbrew but it is a whole lot easier. I am a hacker at heart but I suspect most mac users are not. |