Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Cannot install Config::Augeas on Mac, Big Sur

by nysus (Parson)
on Mar 09, 2021 at 18:46 UTC ( [id://11129378]=perlquestion: print w/replies, xml ) Need Help??

nysus has asked for the wisdom of the Perl Monks concerning the following question:

Wondering what's involved with trying to patch Config::Augeas to get it working on macos, version 11.2.3 (Big Sur). Relevant part of build.log:

Building Config-Augeas cc -I/Users/me/perl5/perlbrew/perls/perl-5.24.1/lib/5.24.4/darwin-2lev +el/CORE -DVERSION="1.000" -DXS_VERSION="1.000" -I/usr/local/Cellar/au +geas/1.12.0/include -Wall -Wformat -Werror=format-security -c -fno-co +mmon -DPERL_DARWIN -mmacosx-version-min=10.13 -fno-strict-aliasing -p +ipe -fstack-protector-strong -I/usr/local/include -DPERL_USE_SAFE_PUT +ENV -O3 -o lib/Config/Augeas.o lib/Config/Augeas.c ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Config/Augeas/Augea +s.bs') cc -mmacosx-version-min=10.13 -bundle -undefined dynamic_lookup -L/usr +/local/lib -fstack-protector-strong -o blib/arch/auto/Config/Augeas/A +ugeas.bundle lib/Config/Augeas.o -L/usr/local/Cellar/augeas/1.12.0/li +b -laugeas ld: warning: dylib (/usr/local/lib/libaugeas.dylib) was built for newe +r macOS version (11.0) than being linked (10.13) Can't call method "get" on an undefined value at /Users/me/.cpanm/work +/1615313587.71199/Config-Augeas-1.000/blib/lib/Config/Augeas.pm line +227. # Looks like your test exited with 255 just after 2. t/Config-Augeas.t ... Dubious, test returned 255 (wstat 65280, 0xff00) Failed 28/30 subtests

Unfortunately, I don't know much about linking in libraries but maybe I could figure it out with some guidance. Thank you.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re: Cannot install Config::Augeas on Mac, Big Sur
by bliako (Monsignor) on Mar 09, 2021 at 20:41 UTC

    Try installing libaugeas.dylib from source. If you are using macports, then ports -s will fetch the source and compile locally. Other package managers will have their own equivalent. If that fails, fetch the source yourself and compile it locally. For this last option, I am not sure installing it over existing /usr/local/lib will be a good idea though.

    Edit: hang on I got it totally wrong. The error message says that your library is version 11 which more-or-less matches your OS. And it is linked with something which is 10.13. The only thing is lib/Config/Augeas.o Perhaps bumping up -mmacosx-version-min=10.13?

    Edit2: How to do this? make CFLAGS="-mmacosx-version-min=11.0" LDFLAGS="-mmacosx-version-min=11.0" and if that creates contradictory options then cpanm My::Module --configure-args='CFLAGS="-mmacosx-version-min=11.0" LDFLAGS="-mmacosx-version-min=11.0"' And if all else fails, edit Makefile and bump up the version from 10.13 to 11.0 manually and be careful not to re-run Makefile.PL which will re-create Makefile.

    bw, bliako

      Thanks. I installed augeas with homebrew. So basically you are saying I can use homebrew but that I should compile it locally instead of installing the binary with the package manager? Have I got that right?

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks

        hang on I got it totally wrong. See update,sorry

      Thanks, but I'm not having any success.

      make CFLAGS... didn't work as this module uses Module::Build. I tried .Build CFLAGS... instead but that didn't work.

      cpanm Config::Augeas --configure... did not seem to have any effect. I got the same error as the original one.

      Fro your 3rd suggestion, there is no Makefile to edit and I could not find any 10.13 version number with grep anywhere in the distribution.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks

        Wild guess: if you built your perl with perlbrew before upgrading the OS that (or some of the config baked therein) may be the source of the older version. Try reinstalling your perl (although if that's the problem you may need to recompile all the XS modules as well to ensure they match the new binary).

        The cake is a lie.
        The cake is a lie.
        The cake is a lie.

        You can influence CFLAGS and LDFLAGS via the Module::Build constructor. It is documented here http://perl.mines-albi.fr/perl5.6.1/site_perl/5.6.1/Module/Build.html (but not in CPAN, wrong oops: it's here: https://metacpan.org/pod/distribution/Module-Build/lib/Module/Build/API.pod)

        my build = Module::Build->new( extra_compiler_flags => '... -mmacosx-version-min=11.0', extra_linker_flags => '... -mmacosx-version-min=11.0', );

        The problem is that Augeas' Build file has already some flags specified there. So, you could try to modify them with something like this (untested, just a rough sketch):

        my $extra_cflags = $aug_cflags . ' ' . $libxml2_cflags . ' -Wall -Wfor +mat -Werror=format-security'; my $extra_ldflags = $aug_libs . ' ' . $libxml2_cflags; $extra_cflags =~ s/mmacosx-version-min=10\.13/mmacosx-version-min=11.0 +/g; $extra_ldflags =~ s/mmacosx-version-min=10\.13/mmacosx-version-min=11. +0/g; print "Modified to $extra_cflags\n" ; print "Modified to $extra_ldflags\n" ; # insert the above before this: print "Using $aug_libs and $aug_cflags to compile (Augeas version $aug +_version)\n" ; print "Using $libxml2_libs and $libxml2_cflags to compile (Augeas vers +ion $aug_version)\n" ;

        And then in the constructor

        my $build = Module::Build->new ( ... extra_compiler_flags => $extra_cflags, extra_linker_flags => $extra_ldflags, ... );

        BTW, the option dynamic_config => 0 will create an intermediate file Build.PL which can be modified as per my 3rd suggestion. Currently for Augeas this is set to 1

        Fletch's suggestion is also worth checking, perhaps with this:

        perl -MConfig -e 'print $_.": ".$Config{$_}."\n" for keys %Config;'

        bw, bliako

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11129378]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-03-29 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found