From 9456bc59ac435fe5a0178e1f898420ee3c3f269e Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Wed, 20 Oct 2021 15:27:35 -0700 Subject: [PATCH] Ensure that release archives contain everything needed for Bazel This change adds some files to EXTRA_DIST in Makefile.am so that our published tar and zip files will have everything needed for Bazel builds. I also added a basic test for this so that next time we should find out sooner if we're missing any important files. This should fix #9129. --- Makefile.am | 2 ++ kokoro/linux/bazel/build.sh | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index f37ae9fdae91..178c124b5e27 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1424,8 +1424,10 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ examples/list_people.py \ examples/list_people_test.go \ examples/pubspec.yaml \ + maven_install.json \ protobuf.bzl \ protobuf_deps.bzl \ + protobuf_version.bzl \ third_party/zlib.BUILD \ util/python/BUILD \ internal.bzl diff --git a/kokoro/linux/bazel/build.sh b/kokoro/linux/bazel/build.sh index 5ec92ce7e5b4..d0d4b3ef4d94 100755 --- a/kokoro/linux/bazel/build.sh +++ b/kokoro/linux/bazel/build.sh @@ -35,5 +35,13 @@ bazel test -k --copt=-Werror --host_copt=-Werror \ @com_google_protobuf//:cc_proto_blacklist_test trap - EXIT -cd examples +pushd examples bazel build //... +popd + +# Verify that we can build successfully from generated tar files. +./autogen.sh && ./configure && make -j$(nproc) dist +DIST=`ls *.tar.gz` +tar -xf $DIST +cd ${DIST//.tar.gz} +bazel build //:protobuf //:protobuf_java