googleapis / googleapis/google-cloud-cpp
Make top-level rules usable with Bazel's `layering_check`
- 主要言語
- C++
- スター
- 659
- フォーク
- 462
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 89
説明
Bazel enforces "Header inclusion rules": https://bazel.build/reference/be/c-cpp#hdrs
When the `layering_check` feature is enabled, none of the top-level targets are usable. They have no `hdrs` value:
https://github.com/googleapis/google-cloud-cpp/blob/8ecdff6cd9ad79e2b2b847edd83205fb8ae65071/BUILD.bazel#L79-L87
- [x] I think we need to change the code to something like:
```bzl
[cc_library(
name = "{library}".format(library = library),
hdrs = ["//google/cloud/{dir}:hdrs".format(dir=google_cloud_cpp_library_dir_name(library)],
deps = [
"//google/cloud/{library_dir}:google_cloud_cpp_{library}".format(
library = library,
library_dir = google_cloud_cpp_library_dir_name(library),
),
],
) for library in GA_LIBRARIES + TRANSITION_LIBRARIES]
```
- [x] Verify all libraries, specially the hand-crafted libraries, have a `filegroup` defined for the headers.
- [x] It might be desirable to remove anything with `/internal/` in the name from this `filegroup` too.
- [ ] We should enable `layering_check` in the package once this is working
- [ ] We should verify the `quickstart` programs compile with `layering_check` once this is working
コントリビューションガイド
調査の方向性
BUILD.bazel の79-87行目から始め、トップレベルのライブラリ定義とそれらのヘッダーファイルグループを調べます。手作業で作成されたものを含むすべてのライブラリが意図されたヘッダーを公開していることを確認し、その後パッケージで layering_check を有効にして、quickstart プログラムがそれを使ってコンパイルできることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp
- 領域
- build-system
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100