[bazel] Use includes instead of strip_include_prefix#1803
Merged
Conversation
alexkaratarakis
added a commit
to alexkaratarakis/fixed-containers
that referenced
this pull request
Jun 14, 2024
alexkaratarakis
added a commit
to alexkaratarakis/fixed-containers
that referenced
this pull request
Jun 14, 2024
google/benchmark#1803 ``` In file included from test/fixed_map_perf_test.cpp:4: bazel-out/k8-fastbuild/bin/external/com_google_benchmark/_virtual_includes/benchmark_main/benchmark/benchmark.h:1801:25: error: zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant] 1801 | memory_result(NULL), | ^~~~ | nullptr /usr/lib/llvm-17/lib/clang/17/include/stddef.h:84:18: note: expanded from macro 'NULL' 84 | # define NULL __null | ^ In file included from test/fixed_map_perf_test.cpp:4: bazel-out/k8-fastbuild/bin/external/com_google_benchmark/_virtual_includes/benchmark_main/benchmark/benchmark.h:378:7: error: 'MemoryManager' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Werror,-Wweak-vtables] 378 | class MemoryManager { | ^ bazel-out/k8-fastbuild/bin/external/com_google_benchmark/_virtual_includes/benchmark_main/benchmark/benchmark.h:1437:7: error: 'Fixture' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Werror,-Wweak-vtables] 1437 | class Fixture : public internal::Benchmark { | ^ 3 errors generated. ```
alexkaratarakis
added a commit
to teslamotors/fixed-containers
that referenced
this pull request
Jun 14, 2024
google/benchmark#1803 ``` In file included from test/fixed_map_perf_test.cpp:4: bazel-out/k8-fastbuild/bin/external/com_google_benchmark/_virtual_includes/benchmark_main/benchmark/benchmark.h:1801:25: error: zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant] 1801 | memory_result(NULL), | ^~~~ | nullptr /usr/lib/llvm-17/lib/clang/17/include/stddef.h:84:18: note: expanded from macro 'NULL' 84 | # define NULL __null | ^ In file included from test/fixed_map_perf_test.cpp:4: bazel-out/k8-fastbuild/bin/external/com_google_benchmark/_virtual_includes/benchmark_main/benchmark/benchmark.h:378:7: error: 'MemoryManager' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Werror,-Wweak-vtables] 378 | class MemoryManager { | ^ bazel-out/k8-fastbuild/bin/external/com_google_benchmark/_virtual_includes/benchmark_main/benchmark/benchmark.h:1437:7: error: 'Fixture' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Werror,-Wweak-vtables] 1437 | class Fixture : public internal::Benchmark { | ^ 3 errors generated. ```
Member
|
i had originally decided to not use thanks so much :) |
Member
|
looks like precommit has an opinion about ordering of fields. |
When using `includes`, consumers will apply the headers using `-isystem`, instead of `-I`. This will allow diagnostics of consumers to not apply to `benchmark`. More info: https://bazel.build/reference/be/c-cpp#cc_library.includes https://bazel.build/reference/be/c-cpp#cc_library.strip_include_prefix gtest uses `includes` as well: https://github.com/google/googletest/blob/1d17ea141d2c11b8917d2c7d029f1c4e2b9769b2/BUILD.bazel#L120
a53f931 to
4af61d1
Compare
Contributor
Author
Fixed and verified locally: |
Member
|
unrelated failure. thank you for the fix. |
dmah42
approved these changes
Jun 17, 2024
alexkaratarakis
added a commit
to alexkaratarakis/fixed-containers
that referenced
this pull request
Jun 18, 2024
alexkaratarakis
added a commit
to teslamotors/fixed-containers
that referenced
this pull request
Jun 18, 2024
EazyReal
pushed a commit
to EazyReal/fixed-containers
that referenced
this pull request
Jul 16, 2024
google/benchmark#1803 ``` In file included from test/fixed_map_perf_test.cpp:4: bazel-out/k8-fastbuild/bin/external/com_google_benchmark/_virtual_includes/benchmark_main/benchmark/benchmark.h:1801:25: error: zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant] 1801 | memory_result(NULL), | ^~~~ | nullptr /usr/lib/llvm-17/lib/clang/17/include/stddef.h:84:18: note: expanded from macro 'NULL' 84 | # define NULL __null | ^ In file included from test/fixed_map_perf_test.cpp:4: bazel-out/k8-fastbuild/bin/external/com_google_benchmark/_virtual_includes/benchmark_main/benchmark/benchmark.h:378:7: error: 'MemoryManager' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Werror,-Wweak-vtables] 378 | class MemoryManager { | ^ bazel-out/k8-fastbuild/bin/external/com_google_benchmark/_virtual_includes/benchmark_main/benchmark/benchmark.h:1437:7: error: 'Fixture' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Werror,-Wweak-vtables] 1437 | class Fixture : public internal::Benchmark { | ^ 3 errors generated. ```
EazyReal
pushed a commit
to EazyReal/fixed-containers
that referenced
this pull request
Jul 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using
includes, consumers will apply the headers using-isystem, instead of-I. This will allow diagnostics of consumers to not apply tobenchmark.More info:
https://bazel.build/reference/be/c-cpp#cc_library.includes
https://bazel.build/reference/be/c-cpp#cc_library.strip_include_prefix
gtest uses
includesas well:https://github.com/google/googletest/blob/1d17ea141d2c11b8917d2c7d029f1c4e2b9769b2/BUILD.bazel#L120