On my iMac with Catalina (10.15.6), I installed the augeas brew package and then installed the perl module "Config::Augeas" without issue. On Big Sur, I have not had the same success. After installing the brew package and then doing "cpanm Config::Augeas", I get the following output in the build log:
27 Building Config-Augeas
28 cc -I/Users/me/perl5/perlbrew/perls/perl-5.32.1/lib/5.32.1/darwin-2level/CORE -DVERSION="1.000" -DXS_VERSION="1.000" -I/usr/local/Cellar/augeas/1.12.0/include -Wall -Wformat -Werror=format-security -c -fno-common -DPERL_DARWIN -mmacosx-version-min=11.2 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -DPERL_USE_SAFE_PUTENV -O3 -o lib/Config/Augeas.o lib/Config/Augeas.c
29 ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Config/Augeas/Augeas.bs')
30 cc -mmacosx-version-min=11.2 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong -o blib/arch/auto/Config/Augeas/Augeas.bundle lib/Config/Augeas.o -L/usr/local/Cellar/augeas/1.12.0/lib -laugeas
31 Can't call method "get" on an undefined value at /Users/me/.cpanm/work/1615471944.29922/Config-Augeas-1.000/blib/lib/Config/Augeas.pm line 227.
32 # Looks like your test exited with 255 just after 2.
33 t/Config-Augeas.t ...
34 Dubious, test returned 255 (wstat 65280, 0xff00)
35 Failed 28/30 subtests
36
37 # Failed test 'Created new Augeas object without backup file'
38 # at t/Config-AugeasC.t line 76.
39 Can't call method "set" on an undefined value at t/Config-AugeasC.t line 78.
40 # Looks like your test exited with 255 just after 4.
41 t/Config-AugeasC.t ..
42 Dubious, test returned 255 (wstat 65280, 0xff00)
43 Failed 29/32 subtests
44 Can't stat config-model-edit: No such file or directory
45 at /Users/me/perl5/perlbrew/perls/perl-5.32.1/lib/site_perl/5.32.1/Test/Pod.pm line 223.
46 t/pod.t ............. ok
Both machines are running perlbrew (though different versions of perl). I don't think the version of perl is the problem and is more likely that Big Sur made some changes the perl module doesn't like. Any ideas?
The problem is a bug in libtool which causes dynamic libraries to be compiled with a flat namespace. This again leads to a conflict between two symbols with the same name in the shared libraries
libSystem.B.dylibandlibfa.1.dylib. Both libraries declare a symbol namedhash_create(), however the Perl module needs to resolve the symbol tolibfa.1.dylibbutlibSystem.B.dylibis always loaded beforelibfa.1.dyliband the wrong version ofhash_create()is therefore used.The problem has been encountered before, see this issue. Further explanations can be found here.
Since the fix to the bug in
libtoolhas not been released as a new version oflibtoolyet, the problem is not simply solved by upgrading xcode command line tools. Instead you could try to download the libaugeas source and compile from source:Note: by specifying
MACOSX_DEPLOYMENT_TARGET=10.15in the above command, we work around the bug and thus do not have to patchconfigure.The Perl module should now install fine.
An alternative workaround: you can use dynamic linking (instead of dynamic loading) for
libfa.1.dylib. To achieve this I rewrote the module to ExtUtils::MakeMaker instead of Module::Build. Next to install using dynamic linking, you can do:Note: The last command overwrites your existing perl binary so be careful, see this link for more information.
Now, the module can be tested and installed successfully: