Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS 14.7 on Apple Silicon - EteBase wheel fails to compile with Rust 1.82 (dependency issue) #328

Closed
odkr opened this issue Oct 30, 2024 · 9 comments

Comments

@odkr
Copy link
Contributor

odkr commented Oct 30, 2024

First of all, thanks a lot for the work you put into EteSync!

Since there are no binaries for Apple Silicon-based Macs, I though I just try to install the DAV bridge manually, however, the EteBase wheel fails to compile:

% brew install rust
[...]
==> Installing rust
==> Pouring rust--1.82.0.arm64_sonoma.bottle.tar.gz
[...]
% python3.13 -mvenv ~/.local/opt/etesync-dav
% . ~/.local/opt/etesync-dav/bin/activate
% pip install --upgrade pip
[...]
% cd repos
% git clone https://github.com/etesync/etesync-dav.git
[...]
% cd etesync-dav
% pip install .
[...]
Building wheels for collected packages: etesync-dav, etebase
  Building wheel for etesync-dav (pyproject.toml): started
  Building wheel for etesync-dav (pyproject.toml): finished with status 'done'
  Created wheel for etesync-dav: filename=etesync_dav-0.32.1-py3-none-any.whl size=56491 sha256=b542d38b77c04e2f24759d658e2adde15981970542a69536c28e6c538518356e
  Stored in directory: /Users/odin/Library/Caches/pip/wheels/57/12/26/ac25ec2b5c01303396abf21c0d4a2a8fe47fea0bb6c53252d2
  Building wheel for etebase (pyproject.toml): started
  Building wheel for etebase (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Building wheel for etebase (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [210 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build/lib.macosx-14.0-arm64-cpython-313/etebase
      copying etebase/__init__.py -> build/lib.macosx-14.0-arm64-cpython-313/etebase
      running build_ext
      running build_rust
      cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features cpython/extension-module cpython/python3-sys --crate-type cdylib -- -C link-args=-undefined dynamic_lookup -Wl,-install_name,@rpath/etebase_python.cpython-313-darwin.so
         Compiling libc v0.2.73
[...]
         Compiling socket2 v0.3.12
           Running `rustc --crate-name socket2 --edition=2018 /Users/odin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/socket2-0.3.12/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("pair", "reuseport", "unix"))' -C metadata=6ffd2f5cdd8b19ae -C extra-filename=-6ffd2f5cdd8b19ae --out-dir /private/var/folders/2p/_c1f87s146sfdg0pkl379jsw0000gp/T/pip-install-apc3k0e8/etebase_14f832af419542b790933ad9213dfffd/target/release/deps -C strip=debuginfo -L dependency=/private/var/folders/2p/_c1f87s146sfdg0pkl379jsw0000gp/T/pip-install-apc3k0e8/etebase_14f832af419542b790933ad9213dfffd/target/release/deps --extern cfg_if=/private/var/folders/2p/_c1f87s146sfdg0pkl379jsw0000gp/T/pip-install-apc3k0e8/etebase_14f832af419542b790933ad9213dfffd/target/release/deps/libcfg_if-7704ecb5ce617162.rmeta --extern libc=/private/var/folders/2p/_c1f87s146sfdg0pkl379jsw0000gp/T/pip-install-apc3k0e8/etebase_14f832af419542b790933ad9213dfffd/target/release/deps/liblibc-c6d18d87643d19ef.rmeta --cap-lints allow`
         Compiling time v0.1.43
           Running `rustc --crate-name time --edition=2015 /Users/odin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.1.43/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("rustc-serialize"))' -C metadata=680630134ed1b793 -C extra-filename=-680630134ed1b793 --out-dir /private/var/folders/2p/_c1f87s146sfdg0pkl379jsw0000gp/T/pip-install-apc3k0e8/etebase_14f832af419542b790933ad9213dfffd/target/release/deps -C strip=debuginfo -L dependency=/private/var/folders/2p/_c1f87s146sfdg0pkl379jsw0000gp/T/pip-install-apc3k0e8/etebase_14f832af419542b790933ad9213dfffd/target/release/deps --extern libc=/private/var/folders/2p/_c1f87s146sfdg0pkl379jsw0000gp/T/pip-install-apc3k0e8/etebase_14f832af419542b790933ad9213dfffd/target/release/deps/liblibc-c6d18d87643d19ef.rmeta --cap-lints allow`
      error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
         --> /Users/odin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/socket2-0.3.12/src/sockaddr.rs:176:9
          |
      176 |         mem::transmute::<SocketAddrV4, sockaddr_in>(v4);
          |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          |
          = note: source type: `SocketAddrV4` (48 bits)
          = note: target type: `sockaddr_in` (128 bits)
      
           Running `/private/var/folders/2p/_c1f87s146sfdg0pkl379jsw0000gp/T/pip-install-apc3k0e8/etebase_14f832af419542b790933ad9213dfffd/target/release/build/unicase-74aecae5c85480d2/build-script-build`
      For more information about this error, try `rustc --explain E0512`.
      error: could not compile `socket2` (lib) due to 1 previous error
      
      Caused by:
        process didn't exit successfully: `rustc --crate-name socket2 --edition=2018 /Users/odin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/socket2-0.3.12/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("pair", "reuseport", "unix"))' -C metadata=6ffd2f5cdd8b19ae -C extra-filename=-6ffd2f5cdd8b19ae --out-dir /private/var/folders/2p/_c1f87s146sfdg0pkl379jsw0000gp/T/pip-install-apc3k0e8/etebase_14f832af419542b790933ad9213dfffd/target/release/deps -C strip=debuginfo -L dependency=/private/var/folders/2p/_c1f87s146sfdg0pkl379jsw0000gp/T/pip-install-apc3k0e8/etebase_14f832af419542b790933ad9213dfffd/target/release/deps --extern cfg_if=/private/var/folders/2p/_c1f87s146sfdg0pkl379jsw0000gp/T/pip-install-apc3k0e8/etebase_14f832af419542b790933ad9213dfffd/target/release/deps/libcfg_if-7704ecb5ce617162.rmeta --extern libc=/private/var/folders/2p/_c1f87s146sfdg0pkl379jsw0000gp/T/pip-install-apc3k0e8/etebase_14f832af419542b790933ad9213dfffd/target/release/deps/liblibc-c6d18d87643d19ef.rmeta --cap-lints allow` (exit status: 1)
      warning: build failed, waiting for other jobs to finish...
      error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features 'cpython/extension-module cpython/python3-sys' --crate-type cdylib -- -C 'link-args=-undefined dynamic_lookup -Wl,-install_name,@rpath/etebase_python.cpython-313-darwin.so'` failed with code 101
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for etebase
Successfully built etesync-dav
Failed to build etebase
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (etebase)

I am running macOS 14.7 on a MacBook Pro M1.

I'd be grateful if you could look into this, I haven’t picked up Rust yet.

@odkr
Copy link
Contributor Author

odkr commented Nov 23, 2024

The problem persists with version 0.33.0.

@odkr
Copy link
Contributor Author

odkr commented Nov 25, 2024

Okay, my bad. I just realized that the etebase package in PyPI is out of date. Installing etebase from its repository works just fine. However, now that I did get it to run, I can't get any DAV client to connect to etesync-dav. But that's a story for another time. I'll be patient this time and wait for the new binaries to drop and will see if I can reproduce the issue with them.

@odkr odkr closed this as completed Nov 25, 2024
@tasn
Copy link
Member

tasn commented Nov 25, 2024

Binaries are out already!

@tasn
Copy link
Member

tasn commented Nov 25, 2024

Ah, I guess not for macOS. I don't know what's wrong with the Github runners but they just aren't picking the task up. You can fork the repo and trigger the workflow yourself potentially to get it to build. :|

@odkr
Copy link
Contributor Author

odkr commented Nov 25, 2024

Apparently there’s an issue with macos-10.15. After I changed it to macos-latest it got picked up.

@odkr
Copy link
Contributor Author

odkr commented Nov 25, 2024

Hmm, judging from https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources it would seem it should be macos-12, macos-13, etc., macos-12 might be more backward-compatible than macos-latest.

@tasn
Copy link
Member

tasn commented Nov 25, 2024

Gotcha, mind opening a PR here to change it to macos-10.14 or something? We can get it to build with that. :)

@odkr
Copy link
Contributor Author

odkr commented Nov 25, 2024

Will do. The thing is, it doesn't build just yet: https://github.com/odkr/etesync-dav/actions/runs/12017712942/job/33500643730. The problem is the one I already ran into earlier: The version of etebase fetched via PyPI doesn't build on macOS. The current version from the repo does, however. I guess the most straightforward solution would be to update the version on PyPI?

@odkr
Copy link
Contributor Author

odkr commented Nov 25, 2024

Okay, it builds just fine on macOS 13. But it uses AMD64, which is less than ideal; Apple stopped selling AMD64-based computers back in 2020. And judging from GitHub's documentation, it would seem that Apple Silicon-based runners for older versions of macOS are a premium feature ("large runners"). The macOS 14 runner appears to be Arch64-based, so that'd be better. But etebase doesn't build on macOS 14. I'll submit a PR for macOS 13, so that at least the people with older Macs get binaries. Forgive the messy commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants