To allow checked-in and generated versions of the well-known type
generated code to coexist in the repo, we have to give the checked-in
versions a long file path (e.g.
//src/google/protobuf:wkt/google/protobuf/any.pb.cc). However, this path
inadvertently leaked into the generated file_lists.cmake file, so this
commit corrects that problem.
The cc_dist_library() rule originally included only the sources from
direct dependencies. This resulted in a less than ideal developer
experience, because if you ever added a new cc_library() then you would
have to carefully update the necessary cc_dist_library() targets to
ensure that the change was correctly reflected in the CMake build.
This commit addresses that issue by making cc_dist_library() include
transitive sources. We have to be careful to avoid introducing ODR
violations (e.g. from libprotoc duplicating sources from libprotobuf),
so we introduce a new dist_deps attribute on cc_dist_library(). Anything
in dist_deps is assumed to be covered by a separate cc_dist_library()
and is not included. We also make sure to exclude anything that's not
part of our repo (i.e. Abseil and zlib).
This cl hit an issue during the shared library cmake build from ODR violations, leading to mismatched absl hash seeds. The problem was pre-existing but didn't manifest until now, and can be traced to the fact that in shared library builds we linked Abseil statically. All of the cmake changes here remove the underlying ODR violation.
PiperOrigin-RevId: 485787671
* Upgrade upb to latest head
My motivation for this is that I plan to make use of upb's
staleness_test() macro, which was recently renamed
(protocolbuffers/upb#810).
* Add a staleness test for src/file_lists.cmake
This test is tagged "manual", because ordinarily no one should be
directly running this test. If we were to run this test regularly during
development then we would expect it to fail occasionally, because
file_lists.cmake will sometimes be temporarily stale until it is
auto-updated by our post-merge GitHub action. We want to run this test
nightly just as a safeguard to alert us if anything ever goes wrong with
the auto-update.
* Using glob to remove headers instead of cyclic file_lists
* Simplify CMake config and include missing files
* Don't remove generated proto headers
* Fix broken CMake proto dependencies instead of opting out pb.h files.
* Fixing cyclic dependency
* Use generated WKT code in Bazel builds
* Prefer src over external for genrule
* Prefer external over src for genrule
* Proper fix for windows proto path issues
* Fixing typos
* Revert new files that were deleted by sync script
* Fix CMake breakages
* bump upb version
* Sync from Piper @468772608
PROTOBUF_SYNC_PIPER
* Adding abseil to include path for python C++ extension
* Adding abseil linkage for python C++ extension
* Fixing linkage order
* Bazelfying conformance tests
Adding infrastructure to "Bazelify" languages other than Java and C++
* Delete benchmarks for languages supported by other repositories
* Bazelfying benchmark tests
* Bazelfying python
Use upb's system python rule instead of branching tensorflow
* Bazelfying Ruby
* Bazelfying C#
* Bazelfying Objective-c
* Bazelfying Kokoro mac builds
* Bazelfying Kokoro linux builds
* Deleting all deprecated files from autotools cleanup
This boils down to Makefile.am and tests.sh and all of their remaining references
* Cleanup after PR reorganizing
- Enable 32 bit tests
- Move conformance tests back
- Use select statements to select alternate runtimes
- Add internal prefixes to proto library macros
* Updating READMEs to use bazel instead of autotools.
* Bazelfying Kokoro release builds
* First round of review fixes
* Second round of review fixes
* Third round of review fixes
* Filtering out conformance tests from Bazel on Windows (b/241484899)
* Add version metadata that was previously scraped from configure.ac
* fixing typo from previous fix
* Adding ruby version tests
* Bumping pinned upb version, and adding tests to python CI
This change largely moves internal logic that creates the the `CcFileList` provider from `build_systems.bzl` to `cc_dist_library.bzl`.
There are also some associated changes to the particular `cc_dist_library` targets, since the output didn't really make sense after previous BUILD.bazel refactoring. There is also a target now for `libprotoc`.
- Add back benchmarks/datasets/BUILD.bazel to dist archive
- Change dist/build_systems.bzl to be compatible with Bazel 4.0.0.
After this, most builds can use //..., with one exception: non-Mac environments must also exclude objectivec:
`bazel build -- //... -//objectivec/...`
This is somewhat of a rough cut, since it doesn't split apart the lite and full targets, or unit tests. However, it does split sources under src/google/protobuf into a separate package, which is a fairly impactful change.
This change creates packages under src/google/protobuf/{io,stubs,testing} and moves build definitions there. Future changes will handle .../util and .../compiler, and finally src/google/protobuf.
These are all "toolchain-y" things, like copts, link_opts, and config_settings. These are very different from what is in //toolchain, though, so I chose the somewhat common name build_defs for the package. For now, I am only using this package for purely internal things. (Most public "defs"-type things should come from rules_proto/rules_cc, anyhow.)
This adds logic to generate files with lists of files in cmake and automake syntax. This will allow Bazel to serve as the single Source of Truth for library sources, with cmake and automake using Bazel-derived definitions.
The definition files are not yet generated or checked in, but that will be a fairly straightforward set of follow-up changes.
This avoids conflicting names in a couple of cases.
1. Within google, we want to sync files but not name them BUILD (since the structure doesn't match).
2. On case-insensitive filesystems, `build` may be used for a build directory. Naming `BUILD.bazel` avoids potentioal conflicts.
This change adds `rules_pkg`-based targets that will produce source distribution archives, similar to `make dist`.
These rules produce nearly the same outputs as `make dist`. However, there are some differences and caveats:
1. The outputs do not contain vendored googletest sources.
2. You have to run `autogen.sh` before `blaze build pkg:all`. This produces several autotools-related files directly into the source tree.
3. The output .zip files do not have a directory prefix like `protobuf-3.20.1-rc-1` (this will be addressed after [Substitute package variables in `pkg_zip#package_dir`. bazelbuild/rules_pkg#577](https://github.com/bazelbuild/rules_pkg/pull/577); the tar files do have this prefix, though.)
4. One file is missing from the archives, which is produced during the `make` build: benchmarks/gogo/cpp_no_group/cpp_benchmark.cc
5. In several places, I have explicitly excluded some files that are not in the autotools distribution outputs. I think most of those files should probably be included, but for now, I'm aiming for parity with `make dist`. These are marked with comments, so it should be easy to clean them up later.
This change moves the `pkg_*` rules into the `//pkg` package, which cleans up the root package.
It also adds an experimental `cc_dist_library` rule, which is similar to Bazel's `cc_import` rule. The goal of `cc_dist_library` is to produce output libraries from several targets. For example, splitting `//:protobuf` into multiple targets means that `bazel-bin/libprotobuf.a` won't contain all of the objects. The `cc_dist_library` creates a single library from several different `cc_library` targets. This may be useful for future packaging targets.