googleapis / googleapis/google-cloud-cpp

Make top-level rules usable with Bazel's `layering_check`

Abierto
#12,760 3 comentarios 0 reacciones 0 asignados Ver en GitHub
cpp: operator type: feature request
Lenguaje dominante
C++
Estrellas
659
Forks
462
Merge medio
1 d 2 h
PR fusionados (30 d)
89

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con las líneas 79-87 de BUILD.bazel e inspecciona las definiciones de las bibliotecas de nivel superior y sus grupos de archivos de cabecera. Verifica que todas las bibliotecas, incluidas las creadas manualmente, expongan las cabeceras previstas; después, habilita layering_check para el paquete y comprueba que los programas quickstart compilen con él.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cpp
Área
build-system
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.