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.


In reply to Re^4: PerlIO::Layers 0.011 fails to build in macOS 10.13.3 by perlboy_emeritus
in thread PerlIO::Layers 0.011 fails to build in macOS 10.13.3 by perlboy_emeritus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.