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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Build Fails on Apple Silicon M1, librocksdb-sys v6.11.4 #597

Closed
damons opened this issue Jan 21, 2021 · 5 comments 路 Fixed by #695
Closed

[Bug] Build Fails on Apple Silicon M1, librocksdb-sys v6.11.4 #597

damons opened this issue Jan 21, 2021 · 5 comments 路 Fixed by #695
Labels
bug Incorrect or unexpected behavior

Comments

@damons
Copy link

damons commented Jan 21, 2021

馃悰 Bug Report

Build currently fails on M1 chip. MacOS Big Sur, 11.0.1.

Steps to Reproduce

  1. Check out master branch.
  2. cargo build --release
snarkOS % cargo build --release
   Compiling zip v0.5.9
   Compiling librocksdb-sys v6.11.4
   Compiling warp v0.2.5
   Compiling hyper-tls v0.4.3
error: failed to run custom build command for `librocksdb-sys v6.11.4`

Caused by:
  process didn't exit successfully: `/Users/damon/aleo/snarkOS/target/release/build/librocksdb-sys-dde2dfda4a9bb753/build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'libclang error; possible causes include:
  - Invalid flag syntax
  - Unrecognized flags
  - Invalid flag arguments
  - File I/O errors
  - Host vs. target architecture mismatch
  If you encounter an error missing from this list, please file an issue or a PR!', /Users/damon/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.54.0/src/ir/context.rs:573:15
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

Expected Behavior

Successful build.

Your Environment

snarkOS repo: commit d0dd356
rustc 1.51.0-nightly (d98d2f57d 2021-01-18)
macOS Big Sur 11.0.1

@damons damons added the bug Incorrect or unexpected behavior label Jan 21, 2021
@niklaslong
Copy link
Contributor

niklaslong commented Jan 22, 2021

This may be of interest: rust-rocksdb/rust-rocksdb#483.

Until this is fixed, installing Rosetta and running SnarkOS compiled to x86_64-apple-darwin is a workable solution.

@niklaslong
Copy link
Contributor

niklaslong commented Mar 15, 2021

Update: looks like a fix is coming soon.

@jvsteiner
Copy link

I'm still getting this on the latest commit: 904f7679273c40ebead46de4f047a7eaf24e1017 :

error: failed to run custom build command for `librocksdb-sys v0.8.0+7.4.4`

Caused by:
  process didn't exit successfully: `/Users/jamie/Code/substrate-node-template/target/release/build/librocksdb-sys-5135db74e4151ca7/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'Unable to find libclang: "the `libclang` shared library at /opt/homebrew/Cellar/llvm/15.0.6/lib/libclang.dylib could not be opened: dlopen(/opt/homebrew/Cellar/llvm/15.0.6/lib/libclang.dylib, 0x0005): tried: '/usr/local/Cellar/mysql@5.6/5.6.35/lib/libclang.dylib' (no such file), '/libclang.dylib' (no such file), '/opt/homebrew/Cellar/llvm/15.0.6/lib/libclang.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))"', /Users/jamie/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.60.1/src/lib.rs:2172:31
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This is a close issue, but still seems to be happening?

@niklaslong
Copy link
Contributor

niklaslong commented Jan 16, 2023

The latest commit (at time of writing) is 8f7f6d9; could you update your repository and give it another go? 馃檹

Edit: I'm pretty sure you were trying to build another repository... substrate-developer-hub/substrate-node-template@904f767.

@jvsteiner
Copy link

I solved the problem - it was a toolchain issue. My rust installation had been carried over from a previous (non-M1) mac

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

Successfully merging a pull request may close this issue.

3 participants