bufbuild / protovalidate-cc

Protocol Buffer Validation for C++.
https://buf.build/bufbuild/protovalidate
Apache License 2.0
13 stars 4 forks source link

[HELP] #33

Closed lqkaixin closed 1 year ago

lqkaixin commented 1 year ago

Description

make fail

bash-4.1# make build bazel build //... Extracting Bazel installation... Starting local Bazel server and connecting to it... ERROR: /opt/app-root/src/.cache/bazel/_bazel_root/3707ecce022575f07e9d5835925fe1bf/external/rules_buf/buf/internal/toolchain.bzl:147:20: name 'json' is not defined ERROR: in /opt/app-root/src/.cache/bazel/_bazel_root/3707ecce022575f07e9d5835925fe1bf/external/rules_buf/buf/repositories.bzl: Extension 'buf/internal/toolchain.bzl' has errors INFO: Elapsed time: 5.213s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded) make: *** [Makefile:40: build] Error 1

how can i do?

Steps to Reproduce

Expected Behavior

Actual Behavior

Screenshots/Logs

Environment

centos 5.4.32-1

Possible Solution

Additional Context

emcfarlane commented 1 year ago

@lqkaixin what version of bazel are you building with? Testing with bazel 6.2.1 and builds are working. Otherwise could you try to remove cached files and build again: bazel clean --expunge.

lqkaixin commented 1 year ago

https://github.com/sub-mod/bazel-builds bazel install from here version bazel 3.4.1- (@non-git)

emcfarlane commented 1 year ago

Hey @lqkaixin, could you try upgrade bazel following the guide here: https://bazel.build/install/redhat#installing-centos

lqkaixin commented 1 year ago

after upgrade make build with zhe error blow [root@VM-12-66-centos protovalidate-cc]# bazel --version bazel 4.2.1 [root@VM-12-66-centos protovalidate-cc]# make build bazel build //... Extracting Bazel installation... Starting local Bazel server and connecting to it... INFO: SHA256 (https://github.com/bufbuild/buf/releases/download/v1.19.0/sha256.txt) = 794c0c7b64a72e23d57cee7e2aa1f071c573944de80e5313e4fffdc23fbad85a ERROR: /root/.cache/bazel/_bazel_root/17624328e7d281e5c25ace7b2527d08b/external/rules_proto/proto/private/native.bzl:28:23: name 'proto_common_do_not_use' is not defined INFO: Repository com_google_protobuf instantiated at: /data/bazel-builds/protovalidate-cc/WORKSPACE:15:10: in /root/.cache/bazel/_bazel_root/17624328e7d281e5c25ace7b2527d08b/external/com_google_cel_cpp/bazel/deps.bzl:54:17: in base_deps Repository rule http_archive defined at: /root/.cache/bazel/_bazel_root/17624328e7d281e5c25ace7b2527d08b/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in INFO: Repository com_google_googletest instantiated at: /data/bazel-builds/protovalidate-cc/WORKSPACE:15:10: in /root/.cache/bazel/_bazel_root/17624328e7d281e5c25ace7b2527d08b/external/com_google_cel_cpp/bazel/deps.bzl:25:17: in base_deps Repository rule http_archive defined at: /root/.cache/bazel/_bazel_root/17624328e7d281e5c25ace7b2527d08b/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in INFO: Repository com_google_absl instantiated at: /data/bazel-builds/protovalidate-cc/WORKSPACE:15:10: in /root/.cache/bazel/_bazel_root/17624328e7d281e5c25ace7b2527d08b/external/com_google_cel_cpp/bazel/deps.bzl:13:17: in base_deps Repository rule http_archive defined at: /root/.cache/bazel/_bazel_root/17624328e7d281e5c25ace7b2527d08b/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in INFO: Repository com_googlesource_code_re2 instantiated at: /data/bazel-builds/protovalidate-cc/WORKSPACE:15:10: in /root/.cache/bazel/_bazel_root/17624328e7d281e5c25ace7b2527d08b/external/com_google_cel_cpp/bazel/deps.bzl:45:17: in base_deps Repository rule http_archive defined at: /root/.cache/bazel/_bazel_root/17624328e7d281e5c25ace7b2527d08b/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in ERROR: /data/bazel-builds/protovalidate-cc/buf/validate/internal/BUILD.bazel:75:11: error loading package '@com_github_bufbuild_protovalidate//proto/protovalidate/buf/validate': in /root/.cache/bazel/_bazel_root/17624328e7d281e5c25ace7b2527d08b/external/rules_proto/proto/defs.bzl: Extension 'proto/private/native.bzl' has errors and referenced by '//buf/validate/internal:constraint' ERROR: Analysis of target '//buf/validate/internal:constraint' failed; build aborted: Analysis failed INFO: Elapsed time: 18.313s INFO: 0 processes. FAILED: Build did NOT complete successfully (26 packages loaded, 24 targets configured) currently loading: @com_github_bufbuild_protovalidate//proto/protovalidate-testing/buf/validate/conformance/cases ... (3 packages) Fetching @local_config_cc; fetching make: *** [Makefile:40: build] Error 1

emcfarlane commented 1 year ago

It still looks like a bazel version issue. As far as I can tell the protobuf library is expecting bazel to export proto_common_do_not_use which is used in rule_proto. It looks like the minimum version is 6.0.0.

lqkaixin commented 1 year ago

Use Bazelisk then zhe version of bazel is 6.2.1 and i make success. Thanks for your help. @emcfarlane