Can't build via documented `cargo` commands
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...
You need protoc 3.6 or higher. What does protoc --version say?
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.
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
@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.
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.
Confirmed, successful with the 3.21.10 binary.