Closed bmw closed 3 years ago
You should create a pull request for Augeas and then also add a patch block to the homebrew formula. See https://docs.brew.sh/Updating-Software-in-Homebrew for more information on the latter
Digging into this a bit more, the real root problem here is in GNU's libtool. The files it generates do not properly set compiler flags for macOS 11+. The issues for this in their bug tracker are https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44684 and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44605 which I just bumped. Homebrew is maintaining a patch for this at https://github.com/Homebrew/formula-patches/blob/50a00afbf4549fbc0ffd3855c884f7d045cf4f93/libtool/dynamic_lookup-11.patch.
With this in mind, would you all accept a similar patch modifying Augeas' libtool.m4
and configure
files? This would only need to be done for stable releases as when building from head, Homebrew's patched version of libtool is used avoiding the problem. The issue is that Homebrew's libtool patch hasn't made its way upstream so the configure
script included in Augeas releases has a bug.
For what it's worth, I would expect other Homebrew formula using configure
scripts from upstream to have similar problems while libtool remains unpatched. I found a few patches for other Homebrew formula doing similar things, but no where near as many as I would expect.
Any thoughts on the above proposal? A patch implementing this would look something like:
diff --git a/Formula/augeas.rb b/Formula/augeas.rb
index 1652af1530..af540583dd 100644
--- a/Formula/augeas.rb
+++ b/Formula/augeas.rb
@@ -23,17 +23,20 @@ class Augeas < Formula
head do
url "https://github.com/hercules-team/augeas.git"
- depends_on "autoconf" => :build
- depends_on "automake" => :build
depends_on "bison" => :build
depends_on "libtool" => :build
end
+ depends_on "autoconf" => :build
+ depends_on "automake" => :build
depends_on "pkg-config" => :build
depends_on "readline"
uses_from_macos "libxml2"
+ # TODO: Patch is only required on stable
+ patch :DATA
+
def install
args = %W[--disable-debug --disable-dependency-tracking --prefix=#{prefix}]
@@ -57,3 +60,54 @@ class Augeas < Formula
system bin/"augtool", "print", etc
end
end
+__END__
+diff --git a/configure b/configure
+index 4b8fb40..b8b62da 100755
+--- a/configure
++++ b/configure
+@@ -11039,16 +11039,11 @@ $as_echo "$lt_cv_ld_force_load" >&6; }
+ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+- darwin*) # darwin 5.x on
+- # if running on 10.5 or later, the deployment target defaults
+- # to the OS version, if on x86, and 10.4, the deployment
+- # target defaults to 10.4. Don't you love it?
+- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+- 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+- 10.[012][,.]*)
++ darwin*)
++ case ${MACOSX_DEPLOYMENT_TARGET},$host in
++ 10.[[012]],*|,*powerpc*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+- 10.*)
++ *)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+diff --git a/gnulib/m4/libtool.m4 b/gnulib/m4/libtool.m4
+index a644432..c8a4d45 100644
+--- a/gnulib/m4/libtool.m4
++++ b/gnulib/m4/libtool.m4
+@@ -1067,16 +1067,11 @@ _LT_EOF
+ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+- darwin*) # darwin 5.x on
+- # if running on 10.5 or later, the deployment target defaults
+- # to the OS version, if on x86, and 10.4, the deployment
+- # target defaults to 10.4. Don't you love it?
+- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+- 10.[[012]][[,.]]*)
++ darwin*)
++ case ${MACOSX_DEPLOYMENT_TARGET},$host in
++ 10.[[012]],*|,*powerpc*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+- 10.*)
++ *)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
If a patch like this would be accepted, I'd implement the TODO and am happy to put the patch outside of the formula if that is desired.
Please suggest formula changes as a pull request. It's really much easier for us to judge the effects that way.
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputbrew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
I work at EFF on Certbot which is packaged in Homebrew. Due to this problem in
augeas
which is one of Certbot's dependencies, many of our users are reporting problems using Certbot on Big Sur. This is my attempt to report the root problem and I apologize that these instructions are somewhat convoluted.What happened (include all command output)?
To reproduce the problem, you can run:
where
break.py
is:The output of the last command is:
What did you expect to happen?
python break.py
in the above section should just outputNone
. This is the behavior you should see on versions of macOS other than Big Sur or if you installaugeas
on Big Sur usingbrew install augeas --head
. I've reproduced this problem both on Intel and M1 Macs running Big Sur. The error you see in my output above is Augeas failing to parse its own lenses.I believe the root cause here is that the configure script in the latest Augeas release doesn't properly handle the macOS version number change from 10.x to 11. I reported this problem upstream a month ago at https://github.com/hercules-team/augeas/issues/729 and received no response. At least until Augeas does another release, I'd love it if Homebrew would patch its copy of the configure script to properly set the compiler flags to avoid this problem and to fix the issue in the Augeas bottles for Big Sur.
Step-by-step reproduction instructions (by running
brew
commands)