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

buck2 fails to build on m3 mac #587

Open
1024bees opened this issue Feb 29, 2024 · 0 comments
Open

buck2 fails to build on m3 mac #587

1024bees opened this issue Feb 29, 2024 · 0 comments

Comments

@1024bees
Copy link

hey folks,

when trying to build from source

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

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 stepancheg/rust-protoc-bin-vendored#1

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

1 participant