facebook / facebook/buck2

buck2 fails to build on m3 mac

Open
#587 2 comments 0 reactions 0 assignees View on GitHub
buck2 development documentation
Dominant language
Rust
Stars
4.4k
Forks
394
PR merge metrics
No merged PRs in 30d

Description

hey folks,

when trying to build from source
``` bash
git clone git@github.com:facebook/buck2.git
cargo build
```
and with rust toolchain `cargo 1.76.0-nightly (978722961 2023-12-06)`

i see the following

``` bash
error: failed to run custom build command for `buck2_data v0.1.0 (/Users/james/buck2/app/buck2_data)`

Caused by:
process didn't exit successfully: `/Users/james/buck2/target/release/build/buck2_data-59ab57d73e33d3fd/build-script-build` (exit status: 1)
--- stdout
cargo:rerun-if-env-changed=OUT_DIR
cargo:rerun-if-changed=data.proto
cargo:rerun-if-changed=error.proto
cargo:rerun-if-changed=data.proto
cargo:rerun-if-changed=error.proto
cargo:rerun-if-changed=.

--- stderr
INFO: Variable $PROTOC set to "/Users/james/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protoc-bin-vendored-macos-x86_64-3.0.0/bin/protoc"
INFO: Variable $PROTOC_INCLUDE set to "/Users/james/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protoc-bin-vendored-macos-x86_64-3.0.0/include"
Error: Custom { kind: Uncategorized, error: "failed to invoke protoc (hint: https://docs.rs/prost-build/#sourcing-protoc): (path: \"/Users/james/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protoc-bin-v
endored-macos-x86_64-3.0.0/bin/protoc\"): Bad CPU type in executable (os error 86)" }
warning: build failed, waiting for other jobs to finish...
error: failed to compile `buck2 v0.1.0 (/Users/james/buck2/app/buck2)`, intermediate artifacts can be found at `/Users/james/buck2/target`.
```

this error is caused by the bundled protoc being compiled for x86 -- i'll find a work around and include a fix (installing protoc locally, pointing to it) -- longer term to make this just work, probably need to address https://github.com/stepancheg/rust-protoc-bin-vendored/issues/1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.