gromgit/homebrew-fuse

s3ql fails to run on M1 Mac

Closed this issue · 3 comments

First off, thanks for adding these packages!

I'm trying to get s3ql-mac running on an M1 Mac and I'm running into an error. I'm not sure that it's specific to M1 Macs, but I'm stuck for other ideas. I've effectively removed and rebuilt my brew with the latest versions and it hasn't helped.

Brew installs Python 3.9.6 and s3ql-mac 3.3.2. Macfuse is already installed.

s3ql starts (in that it prompts me for credentials) but before it mounts anything I get this:

ERROR: Uncaught top-level exception:
Traceback (most recent call last):
  File "/opt/homebrew/bin/mount_s3ql", line 33, in <module>
    sys.exit(load_entry_point('s3ql==3.3.2', 'console_scripts', 'mount_s3ql')())
  File "/opt/homebrew/Cellar/s3ql-mac/3.3.2/libexec/lib/python3.8/site-packages/s3ql/mount.py", line 119, in main
    backend_factory = get_backend_factory(options)
  File "/opt/homebrew/Cellar/s3ql-mac/3.3.2/libexec/lib/python3.8/site-packages/s3ql/common.py", line 255, in get_backend_factory
    from .backends.comprenc import ComprencBackend
  File "/opt/homebrew/Cellar/s3ql-mac/3.3.2/libexec/lib/python3.8/site-packages/s3ql/backends/comprenc.py", line 33, in <module>
    crypto_backend = crypto_backends.default_backend()
  File "/opt/homebrew/Cellar/s3ql-mac/3.3.2/libexec/lib/python3.8/site-packages/cryptography/hazmat/backends/__init__.py", line 15, in default_backend
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/opt/homebrew/Cellar/s3ql-mac/3.3.2/libexec/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/opt/homebrew/Cellar/s3ql-mac/3.3.2/libexec/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 16, in <module>
    from cryptography import utils, x509
  File "/opt/homebrew/Cellar/s3ql-mac/3.3.2/libexec/lib/python3.8/site-packages/cryptography/x509/__init__.py", line 8, in <module>
    from cryptography.x509.base import (
  File "/opt/homebrew/Cellar/s3ql-mac/3.3.2/libexec/lib/python3.8/site-packages/cryptography/x509/base.py", line 18, in <module>
    from cryptography.x509.extensions import Extension, ExtensionType
  File "/opt/homebrew/Cellar/s3ql-mac/3.3.2/libexec/lib/python3.8/site-packages/cryptography/x509/extensions.py", line 20, in <module>
    from cryptography.hazmat.primitives import constant_time, serialization
  File "/opt/homebrew/Cellar/s3ql-mac/3.3.2/libexec/lib/python3.8/site-packages/cryptography/hazmat/primitives/constant_time.py", line 11, in <module>
    from cryptography.hazmat.bindings._constant_time import lib
ImportError: dlopen(/opt/homebrew/Cellar/s3ql-mac/3.3.2/libexec/lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so, 2): Symbol not found: _ffi_prep_closure
  Referenced from: /opt/homebrew/Cellar/s3ql-mac/3.3.2/libexec/lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so
  Expected in: flat namespace
 in /opt/homebrew/Cellar/s3ql-mac/3.3.2/libexec/lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so

(Note it's from python3.8 not the latest 3.9 that Brew installs)

Not sure if this is similar to the other open issue but would appreciate any help - let me know if there's more info I can gather to help debug

(Note it's from python3.8 not the latest 3.9 that Brew installs)

Yeah, building with python@3.9 fails.

As for your problem, I did some searching, and the root cause seems to be that _ffi_prep_closure and related symbols are no longer found in the Big Sur system libffi. Can you please brew edit s3ql-mac, then change:

  uses_from_macos "libffi"

to:

  depends_on "libffi"

then brew reinstall s3ql-mac and try using it again? If that works, I'll commit and push the fix.

This fixed it, thank you!

@grrywlsn , I've uploaded the fix, but since it involves a change in build linkages, I've had to bump the revision and rebuild all the Intel bottles too. Please run:

git -C $(brew --repo gromgit/fuse) checkout -- Formula/s3ql-mac.rb

before your next brew update, otherwise you'll probably get a merge conflict.