Homebrew-core: Installing certbot fails

Created on 13 Aug 2017  Â·  24Comments  Â·  Source: Homebrew/homebrew-core

  • [x] Confirmed this is a problem with brew installing one, specific formula (not cask) and not every time you run brew? If it's a general brew problem please file this issue at https://github.com/Homebrew/brew/issues/new. If it's a brew cask problem please file this issue at https://github.com/Homebrew/caskroom/homebrew-cask/new
  • [x] Ran brew update and retried your prior step?
  • [x] Ran brew doctor, fixed all issues and retried your prior step?
  • [x] Ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • [ ] If brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

brew install certbot fails with a Python errror:

OSError: ctypes.util.find_library() did not manage to locate a library called 'augeas'

augeas has been installed by Homebrew as a dependency of Certbot.

bug python stale

All 24 comments

That's odd — I've had it on two different machines, one Homebrew, one Linuxbrew. I'll play with it a bit more…

It seems doctor would have complained about it for you, but it does happen if I brew unlink augeas.

I'm a bit confused by your gist-logs.

I see /Users/alyssa/code/linuxbrew/Cellar/certbot/0.17.0_1/libexec/lib/python2.7/site-packages/pip/req/req_install.py

But brew config says HOMEBREW_CELLAR: /Users/alyssa/code/brew/Cellar

Well that's weird…

Logs getting mixed up from multiple installations? I'll have a look.

Deleted all my logs and reran it. No more weird crossover, but it still won't build… https://gist.github.com/41b77afcbd1d393c3ad863c49eb6536f

What does ls -l /Users/alyssa/code/brew/lib show?

total 56
lrwxr-xr-x  1 alyssa  staff    44B 13 Aug 18:52 libaugeas.0.dylib@ -> ../Cellar/augeas/1.8.0/lib/libaugeas.0.dylib
lrwxr-xr-x  1 alyssa  staff    38B 13 Aug 18:52 libaugeas.a@ -> ../Cellar/augeas/1.8.0/lib/libaugeas.a
lrwxr-xr-x  1 alyssa  staff    42B 13 Aug 18:52 libaugeas.dylib@ -> ../Cellar/augeas/1.8.0/lib/libaugeas.dylib
lrwxr-xr-x  1 alyssa  staff    45B 13 Aug 18:53 libdialog.a@ -> ../Cellar/dialog/1.3-20170509/lib/libdialog.a
lrwxr-xr-x  1 alyssa  staff    40B 13 Aug 18:52 libfa.1.dylib@ -> ../Cellar/augeas/1.8.0/lib/libfa.1.dylib
lrwxr-xr-x  1 alyssa  staff    34B 13 Aug 18:52 libfa.a@ -> ../Cellar/augeas/1.8.0/lib/libfa.a
lrwxr-xr-x  1 alyssa  staff    38B 13 Aug 18:52 libfa.dylib@ -> ../Cellar/augeas/1.8.0/lib/libfa.dylib
drwxr-xr-x  3 alyssa  staff   102B 13 Aug 18:52 pkgconfig/

OK, I reproduced the issue. It happens if we're using system Python, so it should be easier to troubleshoot now :)

@alyssais please try this diff:

diff --git a/Formula/certbot.rb b/Formula/certbot.rb
index b8075f6851..cee92d26c3 100644
--- a/Formula/certbot.rb
+++ b/Formula/certbot.rb
@@ -156,7 +156,15 @@ class Certbot < Formula
   end

   def install
-    venv = virtualenv_install_with_resources
+    venv = virtualenv_create(libexec)
+    venv.pip_install resources.reject { |r| r.name == "python-augeas" }
+    resource("python-augeas").stage do
+      inreplace "augeas/ffi.py",
+                "ffi.dlopen(\"augeas\")",
+                "ffi.dlopen(\"#{Formula["augeas"].opt_lib}/libaugeas.dylib\")"
+      venv.pip_install "."
+    end
+    venv.pip_install_and_link buildpath

     # Shipped with certbot, not external resources.
     %w[acme certbot-apache certbot-nginx].each do |r|

That works :D

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@ilovezfs want me to PR your diff?

@alyssais I think it needs to be reported upstream actually because it's not clear how they expect that to work on a system with SIP enabled where you cannot even set DYLD_LIBRARY_PATH. There needs to be some way to tell it where to find the library other than string replacements.

@ilovezfs okay, I'll do that.

thanks!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Quick question, does setting LD_LIBRARY_PATH work?

Only on macOS < 10.11

@ilovezfs Why is that so? I need to understand the issue before I make changes to the package.

For future reference, this was fixed by #21426, which updates the formula to depend on Python 3 as opposed to system Python. This means that SIP doesn't apply.

@alyssais please try this diff:

doesn't work for me with certbot 0.21.0 on macOS High Sierra 10.13.3 Beta (17D34a) running Python 2.7

Update: still doesn't work with Python 3.6.x installed and the patch applied as described in the diff here...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yuna9 picture yuna9  Â·  4Comments

faraazkhan picture faraazkhan  Â·  3Comments

ghostbar picture ghostbar  Â·  4Comments

xeoneux picture xeoneux  Â·  3Comments

BluePawDev picture BluePawDev  Â·  3Comments