[protobuf] Skip sanitizers on protoc-gen-upbdefs Fuchsia's ASan and HWASan builders enable `host_asan-ubsan`, which instruments host `executable()` targets with LeakSanitizer. In upstream protobuf (https://github.com/protocolbuffers/protobuf/issues/31490), `GenerateReflectionHeader()` and `GenerateReflectionSource()` in `upb_generator/reflection` do not delete the `ZeroCopyOutputStream*` returned by `GeneratorContext::Open()`. That 32-byte leak fails `protoc-gen-upbdefs` at build time under LeakSanitizer and blocks https://fuchsia-review.googlesource.com/c/fuchsia/+/1953775. Upstream Bazel `--config=asan` misses this because `proto_lang_toolchain` builds plugins in the un-instrumented `exec` configuration. Set `exclude_toolchain_tags = [ "instrumented" ]` on `protoc-gen-upbdefs` when `is_fuchsia_tree` is true until a `third_party/protobuf` roll includes the upstream fix. Bug: 364925797 Test: fx --dir out/host_asan_test test --host tp_shell_test Test: fx --dir out/host_asan_test test --host trace_importing_fxt_test Change-Id: I7f27a93fe6169adf19fcaeda2bd09077bd5d2ef0 Reviewed-on: https://fuchsia-review.googlesource.com/c/protobuf-gn/+/1962671 Lint: android-build-ayeaye@system.gserviceaccount.com <android-build-ayeaye@system.gserviceaccount.com> Reviewed-by: Anivia Li <aniviali@google.com>
This repository contains GN build system support for Protocol Buffers. It's in its own repository because it needs to be shared by Fuchsia and Cobalt.
This repo should be checked out such that:
//build/secondary/third_party/protobuf.//third_party/protobuf/src.//.gn contains secondary_source = "//build/secondary/"See the GN documentation on secondary_source.
WARNING: DO NOT MODIFY THE BUILD.gn FILE DIRECTLY!
The BUILD.gn file in this directory is generated automatically. Any manual changes will be overwritten.
To make changes to the build configuration:
BUILD.input.gn file to suit your needs, for example managing visibility, suppressing warnings, etc.gen.py script located in this directory to regenerate the BUILD.gn file:./gen.py [commit_hash]If no commit hash is specified, it defaults to
HEAD of //third_party/protobuf/src.BUILD.input.gn and the newly generated BUILD.gn file.Failing to modify BUILD.input.gn will result in your changes being lost the next time the build file is regenerated.