Commit Graph

69 Commits

Author SHA1 Message Date
nipil bfcbcd6eaa [bazel/dbg copt] fix warning name for GCC (#36040)
Reproduced with :
- bazel-bootstrap 3.5.1+ds-3 (pulling bazel 6.4.0)
- setting CC to gcc and CXX to g++ otherwise bazel does not detect it
- overall, using debian 11 using default gcc/g++ versions 10.2.1

When using --config=dbg, a warning name produces an error at the beginning of the compilation :

`cc1plus: error: '-Werror=return-stack-address':
no option '-Wreturn-stack-address';
did you mean '-Wreturn-local-addr'?`

Fixed the error following the compiler advice for GCC

PLEASE NOTE : I guess `return-stack-address` might be related to CLANG
and `return-local-addr` is the GCC equivalent. I do not know CLANG,
nor am i good enough with bazel to know how to make this option flexible
(so any help will be appreciated)

Closes #36040

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36040 from nipil:fix_compile_dbg_option 7ade99de76
PiperOrigin-RevId: 617281605
2024-03-19 13:47:54 -07:00
Esun Kim 594d370819 [Build] Prepared for Bazel 7 (#35374)
This is a prerequisite change to start supporting Bazel 7. Changes are

- Disabled bzlmod which Bazel 7 begins to enable by default. This eventually needs to be done to support bzlmod but not now.
- Upgraded some bazel rule dependencies which are required to support Bazel 7.
- Using Python 3 explcitly as Bazel 7 begins to reject Python 2.

Note that this isn't enough to enable Bazel 7 by default and another PR will follow for that.

Closes #35374

PiperOrigin-RevId: 592931675
2023-12-21 13:02:38 -08:00
Esun Kim 395ff71b8d
[Build] Workaround for upb 24.x warnings (#34200)
This is to address too many warnings coming from upb 24.x

```
In file included from external/upb/upb/mini_table/field.h:32:
external/upb/upb/mini_table/internal/message.h:36:14:
 warning: redefinition of typedef 'upb_Message' is a C11 feature [-Wtypedef-redefinition]
typedef void upb_Message;
             ^
external/upb/upb/message/tagged_ptr.h:40:14: note: previous definition is here
typedef void upb_Message;
             ^
1 warning generated.
```
2023-08-30 09:11:02 -07:00
Yash Tibrewal d2f37b8b45
[OTel] Basic C++ OTel Stats Functionality (#33650)
Note that the plugin is still under `grpc::internal` namespace and not
under `experimental` intentionally.

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-07-17 09:30:47 -07:00
Craig Tiller 338c55978b
[threading] Implement thready-tsan mode (#33193)
This test mode tries to create threads wherever it legally can to
maximize the chances of TSAN finding errors in our codebase.

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-05-19 17:26:11 -07:00
Craig Tiller 0526a51734
[channel-args] Reland UnionWith optimizations (#33163)
Same as yesterday, with a fix in
695e2e24ba.
2023-05-17 17:23:58 -07:00
Craig Tiller 6a742f0c2e
Revert "[channel_args] Optimize UnionWith" (#33159)
Reverts grpc/grpc#33154

breaks import
2023-05-17 09:20:33 -07:00
Craig Tiller cc3d034948
[channel_args] Optimize UnionWith (#33154)
<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-05-16 19:55:55 -07:00
Yijie Ma bd940c0dd5
[Fuzzing] Add a build config option which enables Clang source-based code coverage (#32858)
This maybe used to quickly verify the code coverage of a modified test
locally (e.g. fuzzer).

Example:
```
# Build and run target; the raw profile will be written to $LLVM_PROFILE_FILE when the program exits
$ bazel build --config=dbg --config=fuzzer_asan --config=coverage //test/core/end2end/fuzzers:api_fuzzer
$ LLVM_PROFILE_FILE="api_fuzzer.profraw" bazel-bin/test/core/end2end/fuzzers/api_fuzzer test/core/end2end/fuzzers/api_fuzzer_corpus/*

# Create coverage report
$ llvm-profdata-14 merge -sparse api_fuzzer.profraw -o api_fuzzer.profdata
$ llvm-cov-14 report ./bazel-bin/test/core/end2end/fuzzers/api_fuzzer --instr-profile=api_fuzzer.profdata
```

Sample report:
f94e444f25/gistfile1.txt

One trick is that the binary needs to be statically linked, e.g. specify
`linkstatic = 1` on the BUILD target.
See https://clang.llvm.org/docs/SourceBasedCodeCoverage.html for more
info.



<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-04-14 13:03:12 -07:00
Esun Kim 451b230358
Removed report_atomic_races=0 option (#32675)
It appears that we can remove this `report_atomic_races=0` workaround as
abseil fixed the issue by
091842beea
2023-03-22 09:23:00 -07:00
Craig Tiller 2bcca66712
[fuzzing] Roll forward dep on fuzztest (#32667)
<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-03-21 13:37:32 -07:00
Craig Tiller 522bed8cc6
Revert "[fuzzing] Add dep on google fuzz test" (#32666)
Reverts grpc/grpc#32578
2023-03-20 20:31:06 -07:00
Craig Tiller dbb131b193
[fuzzing] Add dep on google fuzz test (#32578)
Initial PR to establish a bazel dependency on
https://github.com/google/fuzztest, with which I'm planning on basing a
hardening program.

Casting a relatively wide net with reviewers: I'm genuinely interested
in feedback building up the docs, and general ergonomics of this change.

I've located relevant files in the `fuzztest/...` directory. The tests
only build with the `--config fuzztest` bazel argument for now (because
of needing C++17), so locating them separately keeps `bazel test
test/...` working as it does today. In a few years time, when we adopt
C++17, we'll be able to rationalize the test directories a little bit.

We'll need to add some kokoro jobs (maybe with this PR?) to execute the
relevant tests.

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-03-20 17:45:52 -07:00
AJ Heller 3a0632136d
[build] Use platform-specific -std=c++14 compile flags (#32459)
With the `--copt="-std=c++14"` setting in the bazel.rc file as it is
today, MSVC builds have complained for every cc file:

```
cl : Command line warning D9002 : ignoring unknown option '-std=c++14'
```

This adds thousands of lines of noise to Windows builds, and hides
useful warnings. Using the `/std:c++14` flag on MSVC (and clang-cl) gets
us the desired result.
2023-02-23 13:44:35 -08:00
Richard Belleville 190d095a62
Fix Python epoll1 Fork Support (#32196)
* WIP. A seemingly properly failing test

* WIP. Pre-fork handlers now work

* Roughly working.

* Clean up

* Clean up more

* Add to CI

* Format

* Ugh. Remove swap file

* And another

* clean up

* Add copyright

* Format

* Remove another debug line

* Add stub forkable methods

* Remove use of 3.9+ function

* Remove unintentional double copyright

* drfloob review comments

* Only hold lock during Close once

* Create separate job for fork test

* Bump up gdb timeout

* Format
2023-02-02 14:46:16 -08:00
Esun Kim 905df9dee6
Update Abseil to 20230125 (#32139)
* Update abseil to 1.20230125.0

* Fix IWYU
2023-01-30 16:20:24 -08:00
Craig Tiller 1f1f923a72
[benchmarks] Remove stats integration (#30900)
* remove old stats cruft

* remove

* remove

* fix

* fix
2022-09-09 04:15:12 -07:00
Craig Tiller 004788af3d
[cleanup] Remove profiling timers (#30779)
* [cleanup] Remove profiling timers

- nobody has used this system in years
- if we needed it, we'd probably rewrite it at this point to be something more modern
- let's remove it until that need arises

* fix

* fixes
2022-08-30 13:40:08 -07:00
Esun Kim df53955d16
Revert "Removed c++14 option from bazel.rc (#29711)" (#29750)
This reverts commit c88d70458c.
2022-05-20 14:38:45 -07:00
Esun Kim c88d70458c
Removed c++14 option from bazel.rc (#29711) 2022-05-19 09:56:37 -07:00
Esun Kim 03e9ac6f1f
Requiring C++14 (#29589) 2022-05-12 21:17:32 -07:00
Esun Kim 94adc74145
Fix dyld errors on macos (#28684) 2022-01-25 13:49:57 -08:00
Esun Kim f1e79853ed
Revert "Revert "Buildify Envoy upb (#28558)" (#28648)" (#28649)
This reverts commit 01011ab259.
2022-01-25 11:19:41 -08:00
Esun Kim 01011ab259
Revert "Buildify Envoy upb (#28558)" (#28648)
This reverts commit 97584d8346.
2022-01-21 08:35:13 -08:00
Esun Kim 97584d8346
Buildify Envoy upb (#28558)
* Buildigy xds

* Generate project

* Buildify envoy

* Added new upb files

* Removed unused upb targets

* Fix grpc_cel_engine

* Update envoy-api to the latest

* Regen upb

* Regen projects

* Fix bazel build on MacOS

* More fix on bazel mac

* Disable grpc_tool_test on Mac

* Regen projects
2022-01-20 22:29:58 -08:00
Esun Kim c6f96d687f
Re-enabling RBE ubsan (#27861)
* Cherry-pick #27439

* Fix StatusGetTime misalignment

* Fix memcpy with nullptr

* Fix boringssl ubsan issue

* Fix slice ubsan issue

* Ignore msan errors for ubsan

* Add upb UBSAN exception

* Add local ubsan run comment

* Revert "Fix StatusGetTime misalignment"

This reverts commit a1d0c34e8ea6933d09386867e8d4836d9e1b4e1c.

* Fix status_helper

* Added alignas

* Fix fuzzer_corpus_test

* Removed binder_transport_test from ubsan
2021-12-16 17:33:24 -08:00
Craig Tiller 179cdfcadb
Update fuzzer infrastructure for developers a little (#27403)
* add a config that will build fuzzers

* bazel run --config=fuzzer_asan //path/to:fuzzer fuzzes!
2021-09-20 08:39:52 -07:00
Craig Tiller 6d96a2221d
Enable layering checks in the Bazel build (#26591)
* Enable layering checks

* fix dep

* update projects

* fix clang-tidy
2021-07-01 15:10:51 -07:00
Esun Kim 37eecd3ce3
Updated Abseil to LTS 20210324.0 (#25835)
* Updated abseil-cpp to 20210324.0
* UBSAN with -fsanitize-link-c++-runtime
2021-03-30 09:22:05 -07:00
Lidi Zheng 4e9206f48c
Make returning a local reference a compilation error (#25568)
* Make returning a local reference a compile error

* Bazel doesn't like return-local-addr
2021-03-02 13:55:07 -08:00
Esun Kim ac8065cb04 Address TSAN problem with Abseil. 2020-10-23 13:22:38 -07:00
Esun Kim 0e0e12aa22 Using comp_db for clang-tidy 2020-10-13 09:51:31 -07:00
Jan Tattermusch 648c38380b run_microbenchmark.py should use bazel 2020-08-19 10:18:04 -04:00
Jan Tattermusch 4805538d44 add bazel "counters" config 2020-08-14 10:21:44 +02:00
Nicolas Noble 0f47005ad6
Removing obsolete comment. 2020-04-02 12:47:01 -07:00
Lidi Zheng 221a50bf87 Allow multiple asyncio engine 2020-03-09 15:20:06 -07:00
Lidi Zheng 13390e9ae9 Use fast cpp protos for Python builds 2019-12-13 18:47:38 -08:00
Richard Belleville a08da012d2 Switch to config-driven style 2019-11-05 15:17:06 -08:00
Jan Tattermusch eaf01655cd disable xds_bootstrap_test on TSAN ASAN UBSAN 2019-10-29 09:39:33 -04:00
Jan Tattermusch d10fb3ba99 fix win RBE opt build 2019-10-07 07:55:44 -04:00
Richard Belleville 1444cd1dd3 Revert "Revert "Merge pull request #20097 from gnossen/dual_version_python_tests""
This reverts commit 24c562dbaa.
2019-08-29 10:51:36 -07:00
Richard Belleville 24c562dbaa Revert "Merge pull request #20097 from gnossen/dual_version_python_tests"
This reverts commit c9c847f334, reversing
changes made to 07ba4de392.
2019-08-29 10:47:44 -07:00
Richard Belleville 426450cd82 Implement dual testing 2019-08-27 17:22:45 -07:00
Esun Kim a031f0ffd6 Remove all nanopb defines 2019-08-23 08:41:35 -07:00
Prashant Jaikumar 91d865fa54 Create new build config for ASAN on Mac OS
Workaround ASAN build issues on Mac OS.
Disable LSAN as it's not supported by the version of clang that ships with Mac OS.
2019-07-19 10:24:52 -07:00
Prashant Jaikumar c6993a3841 Run cfstream_test under ASAN and TSAN 2019-07-17 15:08:28 -07:00
Lidi Zheng dbec6006a6 Fix the entry condition of Bazel hack 2019-07-16 14:15:13 -07:00
Nicolas "Pixel" Noble 1c8894d9c4 Hail mary. 2019-06-21 01:59:19 +02:00
Nicolas "Pixel" Noble ee6a462f03 Another python fix. 2019-06-18 00:23:56 +02:00
Lidi Zheng 61bea3891b Another attempt to fix this problem cleanly 2019-02-20 14:07:34 -08:00