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

Can't build via documented cargo commands #37

Closed
philipcraig opened this issue Dec 4, 2022 · 6 comments
Closed

Can't build via documented cargo commands #37

philipcraig opened this issue Dec 4, 2022 · 6 comments

Comments

@philipcraig
Copy link
Contributor

With Ubuntu 20.04.5 LTS and rustup, cargo, protoc installed and on path, building via cargo with the supplied command:

cargo build --bin=buck2 --release

eventually gives error text of:

error: failed to run custom build command for `buck2_data v0.1.0 (/home/philip/work/buck2/buck2_data)`

Caused by:
  process didn't exit successfully: `/home/philip/work/buck2/target/release/build/buck2_data-aee8f8c0a5c9a583/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=PROTOC
  cargo:rerun-if-env-changed=PROTOC_INCLUDE
  cargo:rerun-if-env-changed=OUT_DIR
  cargo:rerun-if-changed=data.proto
  cargo:rerun-if-changed=data.proto
  cargo:rerun-if-changed=.

  --- stderr
  INFO: Not setting $PROTOC to "../../../third-party/protobuf/dotslash/protoc", as path does not exist
  INFO: Not setting $PROTOC_INCLUDE to "../../../third-party/protobuf/protobuf/src", as path does not exist
  Error: Custom { kind: Other, error: "protoc failed: Unknown flag: --experimental_allow_proto3_optional\n" }
warning: build failed, waiting for other jobs to finish...
@ndmitchell
Copy link
Contributor

You need protoc 3.6 or higher. What does protoc --version say?

@shayne-fletcher
Copy link
Contributor

shayne-fletcher commented Dec 5, 2022

i see the same thing.

root@2ef690c32f0c:buck2# apt-get install protobuf-compiler
Reading package lists... Done
Building dependency tree       
Reading state information... Done
protobuf-compiler is already the newest version (3.6.1.3-2ubuntu5).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

root@2ef690c32f0c:buck2# protoc --version
libprotoc 3.6.1

also Ubuntu 20.04.5 LTS.

@ndmitchell
Copy link
Contributor

I think its 3.12 where this was introduced, actually. Can you try with https://github.com/protocolbuffers/protobuf/releases/download/v21.10/protoc-21.10-linux-x86_64.zip

@ndmitchell
Copy link
Contributor

@stepancheg is going to look at moving us to https://crates.io/crates/protoc-bin-vendored, which will mean we don't need to install protoc at all.

@shayne-fletcher
Copy link
Contributor

shayne-fletcher commented Dec 6, 2022

I think its 3.12 where this was introduced, actually. Can you try with https://github.com/protocolbuffers/protobuf/releases/download/v21.10/protoc-21.10-linux-x86_64.zip

that works. successful build with protoc 3.21.10.

@philipcraig
Copy link
Contributor Author

Confirmed, successful with the 3.21.10 binary.

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

3 participants