postgres@16.2.bcr.3: Fix missing header when building a program that uses libpq (#5857)
When I attempt to use `bazel_dep(name = "postgres", version =
"16.2.bcr.2")`, I get an error like this:
```
% bazel build --sandbox_debug --verbose_failures //example:example
INFO: Analyzed target //example:example (0 packages loaded, 0 targets configured).
ERROR: /Users/jhemphill/oss/bazel-central-registry/temp_test_repos/postgres/16.2.bcr.2/test_module/output/postgresql-16.2/example/BUILD.bazel:3:10: Compiling example/example.c failed: (Exit 1): sandbox-exec failed: error executing CppCompile command
(cd /private/var/tmp/_bazel_jhemphill/613e429a891d16ab2bacf2417ddcce71/sandbox/darwin-sandbox/1125/execroot/_main && \
exec env - \
PATH=<redacted> \
PWD=/proc/self/cwd \
TMPDIR=/var/folders/wr/v3z5smnj5kj1bmkbxh7fr1xr0000gn/T/ \
/usr/bin/sandbox-exec -f /private/var/tmp/_bazel_jhemphill/613e429a891d16ab2bacf2417ddcce71/sandbox/darwin-sandbox/1125/sandbox.sb /var/tmp/_bazel_jhemphill/install/96e26d97222159f904e14600d7490eb0/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_jhemphill/613e429a891d16ab2bacf2417ddcce71/sandbox/darwin-sandbox/1125/stats.out' external/rules_cc~~cc_configure_extension~local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-frandom-seed=bazel-out/darwin_arm64-fastbuild/bin/example/_objs/example/example.o' '-mmacosx-version-min=10.11' -MD -MF bazel-out/darwin_arm64-fastbuild/bin/example/_objs/example/example.d -iquote . -iquote bazel-out/darwin_arm64-fastbuild/bin -iquote external/openssl~ -iquote bazel-out/darwin_arm64-fastbuild/bin/external/openssl~ -iquote external/rules_cc~ -iquote bazel-out/darwin_arm64-fastbuild/bin/external/rules_cc~ -iquote external/bazel_tools -iquote bazel-out/darwin_arm64-fastbuild/bin/external/bazel_tools -isystem src/include -isystem bazel-out/darwin_arm64-fastbuild/bin/src/include -isystem src/interfaces -isystem bazel-out/darwin_arm64-fastbuild/bin/src/interfaces -isystem external/openssl~/include -isystem bazel-out/darwin_arm64-fastbuild/bin/external/openssl~/include -c example/example.c -o bazel-out/darwin_arm64-fastbuild/bin/example/_objs/example/example.o -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"')
In file included from example/example.c:1:
In file included from src/interfaces/libpq/libpq-fe.h:29:
src/include/postgres_ext.h:26:10: fatal error: 'pg_config_ext.h' file not found
26 | #include "pg_config_ext.h"
| ^~~~~~~~~~~~~~~~~
1 error generated.
Target //example:example failed to build
INFO: Elapsed time: 0.261s, Critical Path: 0.15s
INFO: 3 processes: 3 internal.
ERROR: Build did NOT complete successfully
```
Since `pg_config_ext.h` is transitively included by the public header
`libpq-fe.h`, it must be a public header as well.
I've added a minimal example to the `overlays` directory and
`source.json`, so that this example will be built on presubmit. The
minimal example fails to build when `pg_config_ext.h` is not in
`LIBPQ_PUBLIC_HDRS` and succeeds when `pg_config_ext.h` is in
`LIBPQ_PUBLIC_HDRS`.The Bazel Central Registry (BCR) is the default registry for Bazel's external dependency system (“Bzlmod”). This is the GitHub repository backing the contents of the BCR, hosted at https://bcr.bazel.build/. For the website that allows you to search modules and see their versions conveniently, visit https://registry.bazel.build/.
Besides hosting metadata about Bazel-specific libraries (commonly known as “rulesets”), the BCR is also a central host for projects that don't have upstream support for Bazel (most commonly, C/C++ projects).
The BCR is just like a regular Bazel registry, with some extra metadata fields and policy restrictions. You can contribute to the BCR by sending pull requests; see BCR policies and contribution guidelines for more information.
The core infrastructure of the Bazel Central Registry depends on GitHub and Google Cloud. Bazel users who enable Bzlmod (the default since Bazel 8) depend on the BCR by default. While we try to keep the BCR infrastructure simple and reliable, we assume no liability for any damages caused by build failures due to potential BCR infrastructure failures.
If you consider it necessary, you can do the following to avoid depending on the BCR infrastructure while still making use of the information checked into the BCR.
--registry is a flag that can be specified multiple times.--registry flag is specified, the BCR is the only registry Bazel consults.--registry flag is specified, Bazel will consult the specified registries in order, but will not consult the BCR unless the BCR is explicitly specified as a registry. In other words, to use your own registry layered on top of the BCR, use --registry=https://my.own.registry.com/ --registry=https://bcr.bazel.build/../bazel_registry.json. You can run bazel run //tools:print_all_src_urls to get the list of source URLs to mirror for all Bazel modules checked into the BCR. For example, https://foo.com/bar.zip should be mirrored to https://<your mirror>/foo.com/bar.zip.