Commit Graph

20 Commits

Author SHA1 Message Date
David L. Jones
c2e99db90b
Add filegroups for test sources and include them in file lists. (#10049)
These will be used to generate lists of sources for non-Bazel builds.
2022-05-31 15:59:28 -07:00
David L. Jones
586b72c1ac
[Bazel/C++] Augment cc_dist_library to generate lists of source files (#10026)
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`.
2022-05-24 12:31:56 -07:00
David L. Jones
e5e8378a62
[Bazel] Make the protobuf workspace (nearly) wildcard-buildable. (#10010)
- 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/...`
2022-05-20 19:33:42 -07:00
Deanna Garcia
38f0bd4d15 Fix bazel builds 2022-05-20 21:28:55 +00:00
Deanna Garcia
da481978af Merge 21.x back to main 2022-05-20 17:39:11 +00:00
David L. Jones
171a6b1155
[Bazel/C++] Move core C++ implementation to //src/google/protobuf package. (#9988)
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.
2022-05-18 13:45:22 -07:00
David L. Jones
07303d6f54
[Bazel/C++] Factor out util library (#9987)
This change creates new Bazel packages for the C++ util libraries (similar to #9980 and #9985).
2022-05-17 18:13:22 -07:00
David L. Jones
cbd1adc6cf
[Bazel/C++] Factor out compiler packages. (#9985)
This change adds packages for protoc sources under src/google/protobuf/compiler (this is similar to what was done in #9980).
2022-05-17 16:39:47 -07:00
David L. Jones
c2c770e7ea
[Bazel/C++] Factor out stubs, io, and testing libraries. (#9980)
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.
2022-05-17 13:26:46 -07:00
David L. Jones
4e5b920625
[Bazel/macOS] Use the constructed environment when running libtool. (#9965)
This fixes errors like: `SDKROOT: unbound variable` when building a cc_dist_library rule.
2022-05-16 16:11:09 -07:00
Deanna Garcia
0f3ee3b625 Fix protoc_release target 2022-05-16 22:48:41 +00:00
David L. Jones
b3cbea18ea
[Bazel] Move Python rules to //python (#9952) 2022-05-12 19:48:58 -07:00
David L. Jones
354aba886e
Add a test for bazel-built dist archives (#9929)
This also fixes some packaging rules that are needed for the result to be buildable.
2022-05-09 16:32:59 -07:00
David L. Jones
52655b1f5e
[Bazel] Move C++ build-related logic into //build_defs (#9921)
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.)
2022-05-06 12:11:46 -07:00
David L. Jones
3c5ad8c524
Remove references to //:composer.json and JS compiler. (#9910) 2022-05-04 13:38:16 -07:00
David L. Jones
24ec0b9ffb
Add Starlark utilities to generate files with lists of files (#9882)
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.
2022-05-03 13:33:12 -07:00
David L. Jones
95da0ba5b4
Rename all BUILD files to BUILD.bazel (#9892)
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.
2022-04-29 17:57:55 -07:00
Adam Cozzette
860f8ad171
Remove the JavaScript implementation (#9874)
This implementation is about to be split out into a separate Git repo.
2022-04-28 12:08:26 -07:00
David L. Jones
d76f8c868c
Add source distribution packaging rules (#9835)
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.
2022-04-22 16:58:16 -07:00
David L. Jones
46710cabc4
Move rules_pkg targets into //pkg, and add experimental C++ library rules (#9823)
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.
2022-04-20 16:26:44 -07:00