Title
#general
aucker

aucker

09/24/2022, 4:13 AM
Hi, I want to build databend from source on WSL2 Ubuntu20.04, but I have the error with the following:
error: failed to run custom build command for `common-protos v0.1.0 (/home/aucker/mldb/databend/src/meta/protos)`

Caused by:
  process didn't exit successfully: `/home/aucker/mldb/databend/target/release/build/common-protos-9e69ee3140623eb7/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=/home/aucker/mldb/databend/src/meta/protos/proto/metadata.proto
  cargo:rerun-if-changed=/home/aucker/mldb/databend/src/meta/protos/proto/datatype.proto
  cargo:rerun-if-changed=/home/aucker/mldb/databend/src/meta/protos/proto/user.proto
  cargo:rerun-if-changed=/home/aucker/mldb/databend/src/meta/protos/proto/database.proto
  cargo:rerun-if-changed=/home/aucker/mldb/databend/src/meta/protos/proto/share.proto
  cargo:rerun-if-changed=/home/aucker/mldb/databend/src/meta/protos/proto/table.proto
  cargo:rerun-if-changed=/home/aucker/mldb/databend/src/meta/protos/proto/config.proto

  --- stderr
  Error: Custom { kind: Other, error: "protoc failed: Unknown flag: --experimental_allow_proto3_optional\n" }
warning: build failed, waiting for other jobs to finish...
All done...
# Reduce binary size by compressing binaries.
objcopy --compress-debug-sections=zlib-gnu /home/aucker/mldb/databend/target/release/databend-query
objcopy: '/home/aucker/mldb/databend/target/release/databend-query': No such file
make: *** [Makefile:51: build-release] Error 1
I refer the instruction, is there any solutions? thanks
4:23 AM
and my protoc version is
➜  databend git:(main) protoc --version
libprotoc 3.6.1
Xuanwo

Xuanwo

09/24/2022, 5:02 PM
Hi,
experimental_allow_proto3_optional
is added in 3.12.x. Please try upgrade protoc to newer versions~
River wubx

River wubx

09/25/2022, 12:56 AM
sudo mv /usr/bin/protoc /usr/bin/protoc_bak make clean make build
aucker

aucker

09/25/2022, 3:13 AM
Thank you! both methods works❤️