Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
analysis_v2/ | H | 25-Apr-2025 | - | 1,509 | 1,220 | |
build/ | H | 25-Apr-2025 | - | 3,513 | 2,889 | |
README.md | H A D | 25-Apr-2025 | 1.3 KiB | 28 | 23 |
README.md
1This directory contains generated Go wrappers for Bazel cquery result 2protocol buffers defined in https://github.com/bazelbuild/bazel/tree/master/src/main/protobuf. 3 4An attempt was made to use [go_proto_library](https://github.com/bazelbuild/rules_go/blob/master/proto/core.rst#go-proto-library) 5to generate this code at build time, sourcing the embedded_tools dependency, but that 6was never successful. The cause appears to be that the protobufs in Bazel's source 7defined messages of the same name (specifically "Target") which creates a build 8conflict. The command below generates the two Go classes with different package names 9to avoid this conflict - which is what the Bazel generated Java wrapper does. 10 11They were generated as so: 12 13```bash 14BAZEL_DIR=/path/to/bazel/source 15DST_DIR=${PWD}/bazel/exporter/build_proto 16GO_PACKAGE=go.skia.org/skia/bazel/exporter/build_proto 17GO_GEN_CODE_ROOT=${DST_DIR}/go.skia.org/skia/bazel/exporter/build_proto 18 19protoc \ 20 --proto_path=${BAZEL_DIR} \ 21 --go_out=${DST_DIR} \ 22 --go_opt=Msrc/main/protobuf/build.proto=${GO_PACKAGE}/build \ 23 --go_opt=Msrc/main/protobuf/analysis_v2.proto=${GO_PACKAGE}/analysis_v2 \ 24 ${SRC_DIR}/analysis_v2.proto ${SRC_DIR}/build.proto 25``` 26 27The call above writes the generated code to `${DST_DIR}/go.skia.org/skia/bazel/exporter/build_proto` 28which is then moved into `${DST_DIR}/build` and `${DST_DIR}/build`.