Commit Graph

1666 Commits

Author SHA1 Message Date
AJ Heller 1a8b22f2de [build] Restrict visibility for creating core credentials types. (#36216)
Closes #36216

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36216 from drfloob:conceal-core-cred-creation a44a299273
PiperOrigin-RevId: 625425746
2024-04-17 01:21:29 +00:00
Yijie Ma cd30592193 [release] Bump dev version 202404101721 (#36333)
<!--

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.

-->

Closes #36333

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36333 from yijiem:bump_dev_version_202404101721 0a7cc5b4b7
PiperOrigin-RevId: 623878150
2024-04-11 11:04:35 -07:00
Jean byroot Boussier 930b3934bc ruby: register grpc_rb_sStatus as a global variable (#36125)
Ref: https://bugs.ruby-lang.org/issues/20311

C global variable that contain references to Ruby object MUST be declared to the Ruby GC to prevent these objects from being collected or moved.

There are a few exceptions to that, such as classes defined using the C APIs such as `rb_define_class` etc.

Up to Ruby 3.4 however, there was a bug that caused classes created from Ruby with the `Struct.new("Name")` API to also be marked as immortal and immovable.

GRPC has been relying on this bug, which I fixed in Ruby 3.4, and now GRPC is crashing when `Struct::Status` is moved around by the GC.

```
-- C level backtrace information -------------------------------------------
ruby(rb_print_backtrace+0x14) [0x5577db219d41] ruby-3.4.0/vm_dump.c:820
ruby(rb_vm_bugreport) ruby-3.4.0/vm_dump.c:1151
ruby(rb_bug_for_fatal_signal+0xfc) [0x5577db3cc60c] ruby-3.4.0/error.c:1066
ruby(sigsegv+0x4d) [0x5577db16358d] ruby-3.4.0/signal.c:926
libc.so.6(0x7f5bacd32520) [0x7f5bacd32520]
ruby(rb_class_superclass+0x32) [0x5577db0a9152] ruby-3.4.0/object.c:2239
ruby(struct_ivar_get+0x2a) [0x5577db194e02] ruby-3.4.0/struct.c:49
ruby(struct_ivar_get) ruby-3.4.0/struct.c:40
ruby(num_members) ruby-3.4.0/struct.c:705
ruby(rb_struct_new+0x56) [0x5577db19a9d6] ruby-3.4.0/struct.c:848
lib/grpc/grpc_c.so(grpc_run_batch_stack_build_result+0xe6) [0x7f5b84bb6b96] /tmp/bundle/ruby/3.4.0+0/bundler/gems/grpc-5ed33ee673e3/src/ruby/ext/grpc/rb_call.c:780
lib/grpc/grpc_c.so(grpc_rb_call_run_batch_try) /tmp/bundle/ruby/3.4.0+0/bundler/gems/grpc-5ed33ee673e3/src/ruby/ext/grpc/rb_call.c:839
ruby(rb_ensure+0x10c) [0x5577db007d3c] ruby-3.4.0/eval.c:1000
/tmp/bundle/ruby/3.4.0+0/bundler/gems/grpc-5ed33ee673e3/src/ruby/lib/grpc/grpc_c.so(grpc_rb_call_run_batch+0xca) [0x7f5b84bb595a] /tmp/bundle/ruby/3.4.0+0/bundler/gems/grpc-5ed33ee673e3/src/ruby/ext/grpc/rb_call.c:893
ruby(vm_call_cfunc_with_frame_+0x117) [0x5577db1f4c77] ruby-3.4.0/vm_insnhelper.c:3524
```

cc @apolcyn @peterzhu2118 @k0kubun

Closes #36125

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36125 from Shopify:fix-ruby-3.4-compat 7a127599c8
PiperOrigin-RevId: 616152904
2024-03-15 09:27:32 -07:00
Stan Hu 489d24cf7e [ruby] Make `GRPC::DeadlineExceeded` report properly (#33565)
In grpc v1.46.2 and later versions, #29155 caused the Ruby client to return `GRPC::Core::CallError`, a non-standard error, with a message: `grpc_call_start_batch failed with outstanding read or write present (code=8)`. However, the actual error should have been `GRPC::DeadlineExceeded`. This occurred because when `GRPC::DeadlineExceeded` is raised, the `@metadata_received` flag doesn't get flipped. When `receive_and_check_status` runs to determine
the error, the `RECV_INITIAL_METADATA` is erroneously sent again.

To avoid this, flip the flag in an `ensure` block whenever the `RECV_INITIAL_METADATA` op is set.

Closes #33283

Closes #33565

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/33565 from stanhu:sh-ruby-fix-issue-33283 850889558c
PiperOrigin-RevId: 614088694
2024-03-08 17:20:56 -08:00
Esun Kim 7b98cda1f4 No public description
PiperOrigin-RevId: 613626993
2024-03-07 10:26:42 -08:00
Esun Kim 34be0d84a9 [Core] Remove wrap_memcpy (#35826)
gRPC has been having the `wrap_memcpy` workaround to handle the breaking change of `memcpy` on glibc 2.14 ([ref1](https://www.win.tue.nl/~aeb/linux/misc/gcc-semibug.html), [ref2](https://stackoverflow.com/questions/35656696/explanation-of-memcpy-memmove-glibc-2-14-2-2-5)). This was necessary to build more portable artifacts which are expected to run on most linux distributions and we manged to have https://github.com/grpc/grpc/pull/5007 years ago for this.

Since we started to use manylinux2010-based docker images for artifacts, however, this became unnecessary since CentOS 6 has glibc 2.12 which is older than 2.14 so it doesn't have memcpy issue, which is another benefit of using manylinux2010.

Superseding https://github.com/grpc/grpc/pull/23385
Changes after the original PR was made; Ruby is using manylinux images (manylinux2014) enabling this change, no more old docker images in our test env.

Closes #35826

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35826 from veblush:del-wrap-memcpy-2 71e6718356
PiperOrigin-RevId: 607499060
2024-02-15 16:53:19 -08:00
Eugene Ostroukhov 6c157f9128 [Release] Bump version to 1.63.0-dev (on master branch) (#35899)
Change was created by the release automation script. See go/grpc-release.

Closes #35899

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35899 from eugeneo:bump_dev_version_202402131133 73950425c9
PiperOrigin-RevId: 606777850
2024-02-13 16:09:36 -08:00
Mark D. Roth 574b0572f1 [client channel] remove grpc_channel_num_external_connectivity_watchers() (#35840)
Implements gRFC L113 (https://github.com/grpc/proposal/pull/417).

Closes #35840

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35840 from markdroth:client_channel_remove_num_external_watchers 334670c13c
PiperOrigin-RevId: 606766495
2024-02-13 15:31:33 -08:00
Stan Hu c637a9f82b [ruby] Fix compilation errors on clang 16 (#34481)
As announced in https://discourse.llvm.org/t/clang-16-notice-of-potentially-breaking-changes/65562, clang 16 defaults `-Wincompatible-function-pointer-types` to be on. This causes a number of hard errors due to implicit conversions between `void *` and `void`, such as:

```
../../../../src/ruby/ext/grpc/rb_channel.c:770:47: error: incompatible function pointer types passing 'VALUE (VALUE)' (aka 'unsigned long (unsigned long)') to parameter of type 'VALUE (*)(void *)' (aka 'unsigned long (*)(void *)') [-Wincompatible-function-pointer-types]
  g_channel_polling_thread = rb_thread_create(run_poll_channels_loop, NULL);
                                              ^~~~~~~~~~~~~~~~~~~~~~
/root/.rbenv/versions/3.1.4/include/ruby-3.1.0/ruby/internal/intern/thread.h:190:32: note: passing argument to parameter 'f' here
VALUE rb_thread_create(VALUE (*f)(void *g), void *g);
                               ^
../../../../src/ruby/ext/grpc/rb_channel.c:780:41: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void grpc_rb_channel_polling_thread_stop() {
                                        ^
                                         void
../../../../src/ruby/ext/grpc/rb_channel.c:786:30: error: incompatible function pointer types passing 'void (void *)' to parameter of type 'void *(*)(void *)' [-Wincompatible-function-pointer-types]
  rb_thread_call_without_gvl(run_poll_channels_loop_unblocking_func, NULL, NULL,
```

This commit fixes these pointer types using wrapper functions where necessary.

This issue was also raised on the FreeBSD port of the grpc gem: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271540

<!--

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.

-->

Closes #34481

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/34481 from stanhu:sh-ruby-fix-clang-16 63c7424ad0
PiperOrigin-RevId: 600548467
2024-01-22 13:13:30 -08:00
Esun Kim fe75f2b5ff [GPR] Removed GPR_BACKWARDS_COMPATIBILITY_MODE (#35602)
`GPR_BACKWARDS_COMPATIBILITY_MODE` was devised to support old Linux kernel with old glibc but gRPC is now expected to support glibc 2.17 and later (2.17 is derived from the oldest but supported Linux distro, CentOS 7). Effectively, gRPC doesn't need `GPR_BACKWARDS_COMPATIBILITY_MODE` anymore. Hence, let's remove it.

gRPC Python and Ruby that distribute binary artifacts already began to use `manylinux` environment dealing with this issue in a better way so they don't need this flag anymore.

Closes #35602

PiperOrigin-RevId: 599895270
2024-01-19 12:48:26 -08:00
Alan Wu b85ebb9bba [ruby] Fix use-after-free for post-fork channel recreation (#35488)
The `grpc_channel_args` is retained on the Ruby object and used for recreating the channel after forking in
grpc_rb_channel_maybe_recreate_channel_after_fork(). Previously, the key for each argument was taken from a Ruby string directly, which could be invalidated if the Ruby string is modified or moved by the GC. Duplicate the string for the key instead, so we own it.

Reproducer in https://github.com/grpc/grpc/issues/35489

<!--

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.

-->

Closes #35488

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35488 from Shopify:key-uaf c1813cee01
PiperOrigin-RevId: 599304551
2024-01-17 15:19:45 -08:00
Stanley Cheung 7c347b96eb [Release] Bump version to 1.62.0-dev (on master branch) (#35580)
Change was created by the release automation script. See go/grpc-release.

Closes #35580

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35580 from stanley-cheung:bump_dev_version_202401171835 b363888ca5
PiperOrigin-RevId: 599267642
2024-01-17 13:19:59 -08:00
alto-ruby eaf1a92264 [Ruby] remove #include <sys/time.h> (#34178)
#34168

Closes #34178

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/34178 from alto-ruby:no-sys-time-h 42c5ad0f79
PiperOrigin-RevId: 590223092
2023-12-12 09:05:07 -08:00
Luwei Ge dd12460018 [tls] Add set min/max TLS version APIs to TLS credentials APIs. (#34861)
Address #28382. This is a recreation of #31368 except e2e tests are not handled here (yet).

Closes #34861

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/34861 from rockspore:tls_version f9a1215ac1
PiperOrigin-RevId: 589847110
2023-12-11 09:27:44 -08:00
Mark D. Roth 15e2f9e873
[release] Bump version on master to 1.61.0-dev (#34923) 2023-11-13 08:33:46 -08:00
Adam Cozzette 016ed921ce
[deps] Upgrade protobuf version to v25.0 (#34513)
This commit upgrades gRPC to protobuf v25.0 and makes some fixes to
account for upb changes. One major change is that upb has been merged
into the protobuf repo, so we can now drop the separate `@upb`
dependency. Another is that `.upb.c` files no longer exist and there are
new `.upb_minitable.h` and `.upb_minitable.c` files. The longer
filenames exceeded a Windows restriction, so to work around that I
renamed the `upb-generated` directory to just `upb-gen`, and likewise
for `upbdefs-generated`.
2023-11-10 00:11:09 -08:00
Matthew Stevenson 07985907f2
[tls] Fix ownership bugs in TlsCredentialsOptions and grpc_tls_credentials_options. (#34758)
Currently it is very easy to use the `TlsCredentialsOptions` in such a
way that it produces a memory leak. For example, the code block
```
{
  TlsCredentialsOptions options;
}
```
produces a memory leak. This PR fixes up the ownership bugs in this
class and its `grpc_tls_credentials_options`, the C-core analogue.
2023-10-27 08:09:04 -07:00
apolcyn 36af323673
[ruby] create debug symbol packages (#34632)
Introduce `grpc-native-debug` gems containing debug symbol packages that
complement the shared libraries shipped in pre-compiled binary gems.

src/ruby/nativedebug/README.md has details on usage.
2023-10-17 10:45:08 -07:00
Richard Belleville 3bdd972c4a
[Release] Bump master version to 1.60 (gjallarhorn) (#34488)
<!--

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-09-26 13:10:20 -07:00
Stan Hu b3467cdab4
[ruby] Fix linking errors on x86-darwin (#34134)
https://github.com/grpc/grpc/pull/33538 added `-weak_framework
CoreFoundation` in `DLDFLAGS` for only `arm64-darwin` builds, but the
issue reported in https://github.com/grpc/grpc/issues/33483 can also
happen on `x86-darwin` builds. This can happen if:

1. The Ruby interpreter is compiled without
`-Wl,-undefined,dynamic_lookup`.
2. This happens if the Ruby interpreter is built with XCode 14.0 to 14.2
(https://bugs.ruby-lang.org/issues/19005).

Simplify the logic and always include `-weak_framework CoreFoundation`
for macOS builds.
2023-09-21 21:23:11 -07:00
alto-ruby dfa040f49f
[Ruby] replace strdup with gpr_strdup (#34177)
grpc 1.57.0 crashes win ruby and alpine due to no `strdup` in musl libc.
This diff replace `strdup` with `grp_strdup`

```
Thread 1 "ruby" received signal SIGSEGV, Segmentation fault.
0x00000000000a4596 in ?? ()
(gdb) bt
#0  0x00000000000a4596 in ?? ()
#1  0x00007ffff14e298c in grpc_rb_channel_create_in_process_add_args_hash_cb (key=<optimized out>, val=<optimized out>, args_obj=<optimized out>) at rb_channel_args.c:84
#2  0x00007ffff7c2b9ea in hash_ar_foreach_iter (error=0, argp=140737488344784, value=<optimized out>, key=<optimized out>) at hash.c:1341
```

fixes #34044
closes #27995
2023-09-19 11:56:18 -07:00
Esun Kim 1a1124903c
[Deps] Upgrade Protobuf and Upb to 24.x (#34123)
On top of https://github.com/grpc/grpc/pull/34120
2023-08-29 10:58:48 -07:00
Esun Kim a90f30008d
[Release] Bump version to 1.59.0-dev (on master branch) (#34144)
Change was created by the release automation script. See
go/grpc-release.
2023-08-23 15:53:32 -07:00
apolcyn 06d0a6c0fd
[ruby] improve handling for recv_message op failures (#34016)
[ruby] improve handling for recv_message op failures (don't assume recv_message ops won't fail e.g. if the call was cancelled by the peer)
2023-08-10 12:25:29 -07:00
alto-ruby f3419f8373
[Ruby] set metadata_sent after call success (#33998)
fixes #25373
2023-08-09 23:56:07 +00:00
alto-ruby b4a39a2230
[Ruby] add special status msg interop test (#33990)
fixes #24176

```
./tools/run_tests/run_interop_tests.py -l ruby -s c++ --use_docker
No module named 'apiclient'
Seen --use_docker flag, will run interop tests under docker.

IMPORTANT: The changes you are testing need to be locally committed
because only the committed changes in the current branch will be
copied to the docker environment.
START: Building interop docker images.
PASSED: build_docker_ruby [time=479.4sec, retries=0:0]
PASSED: build_docker_c++ [time=686.0sec, retries=0:0]
SUCCESS: All docker images built successfully.
START: interop_server_c++
PASSED: cloud_to_cloud:ruby:c++_server:cancel_after_begin:tls [time=0.9sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:empty_unary:tls [time=1.0sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:empty_stream:tls [time=1.0sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:cancel_after_first_response:tls [time=1.0sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server🏓tls [time=1.0sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:server_streaming:tls [time=1.0sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:client_streaming:tls [time=1.0sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:large_unary:tls [time=1.0sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:status_code_and_message:tls [time=0.8sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:unimplemented_method:tls [time=0.8sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:custom_metadata:tls [time=0.9sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:unimplemented_service:tls [time=0.8sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:client_compressed_streaming:tls [time=0.8sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:special_status_message:tls [time=0.8sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:client_compressed_unary:tls [time=0.8sec, retries=0:0]
PASSED: cloud_to_cloud:ruby:c++_server:timeout_on_sleeping_server:tls [time=1.8sec, retries=0:0]
SUCCESS: All tests passed
```
2023-08-09 16:52:39 -07:00
apolcyn 7c21997dba
[ruby] remove unnecessary background thread startup wait logic that interferes with forking (#33805)
Alternative to https://github.com/grpc/grpc/pull/33804 - this takes the
approach in
https://github.com/grpc/grpc/pull/33804#issuecomment-1645792677

Fix https://github.com/grpc/grpc/issues/33802

cc @casperisfine
2023-07-24 15:17:54 -07:00
AJ Heller 42b0d01e68
[Release] Bump version to 1.58.0-dev (on master branch) (#33825)
Change was created by the release automation script. See go/grpc-release
2023-07-24 10:09:08 -07:00
apolcyn 3d9f2d8f77
[ruby] improve possible error message in postfork parent (#33791)
The case of `!grpc_ruby_initial_pid()` can be a *cause* of the second
case, `!grpc_ruby_initial_thread`, so check the pid first.
2023-07-20 13:47:13 -07:00
apolcyn d4cbb7a96d
[ruby] fix crash when prefork/postfork is used without previously using grpc (#33788)
Should fix https://github.com/grpc/grpc/issues/33787
2023-07-20 11:26:02 -07:00
apolcyn a28900a9cf
[ruby] raise RPC deadline in a flakey test (#33713)
As title - use a deadline that rules out starvation as a source of
flakiness
2023-07-20 10:07:24 -07:00
alto-ruby 75ecd170f8
[Ruby] remove manual strip in ruby ext conf (#33641)
Custom strip invalidates the signature, caused the arm64-darwin gem
failed to run on M1 macs.
Error in mac console: `Exception Type: EXC_BAD_ACCESS (SIGKILL (Code
Signature Invalid))`

Warning in gem build log:
```
# linking shared-object grpc/grpc_c.bundle
# Stripping grpc_c.bundle
# /opt/osxcross/target/bin/aarch64-apple-darwin20.2-strip: warning: changes being made to the file will invalidate the code signature in: /Users/jeff/work/ruby/grpc/tmp/arm64-darwin/grpc_c/3.2.0/grpc_c.bundle
```

Custom stripping is not really needed (any more), this diff removes it
from `src/ruby/ext/grpc/extconf.rb`, the [gem
artifact](https://console.cloud.google.com/storage/browser/grpc-testing-kokoro-prod/test_result_public/prod/grpc/core/pull_request/linux/grpc_distribtests_ruby/19833/20230708-181642/github/grpc/artifacts?pageState=(%22StorageObjectListTable%22:(%22f%22:%22%255B%255D%22))&prefix=&forceOnObjectsSortingFiltering=false)
size didn't change and arm64-darwin gem runs fine on M1 mac.

fixes: #28631
fixes: #29100
2023-07-17 16:57:45 -07:00
AJ Heller c81bdf7a83
[Protobuf] Upgrade third_party/protobuf to 23.4 (#33695)
This was done manually due to a problem with
`tools/distrib/python/make_grpcio_tools.py`. ~I fixed it in this PR
(depends on cl/547979185), so there is a fair chance this upgrade will
work normally for the next release.~ The fix may be problematic for
upgrading protobuf on older release branches, so the improvement will be
worked on separately. CC @jtattermusch

This also updates the UPB dep to the latest commit on the 23.x branch.
2023-07-14 12:04:40 -07:00
apolcyn b21152269d
[ruby] simplify shutdown; remove unnecessary attempts at grpc_shutdown (#33674)
So far, we've structured global C-core init/shutdown as follows:
1) every grpc-ruby object calls `grpc_init` when allocated, and
`grpc_shutdown` when finalized
2) grpc-ruby background threads are each wrapped in a
`grpc_init/shutdown` pair - for example see
b32d94de05/src/ruby/ext/grpc/rb_event_thread.c (L122)
and
b32d94de05/src/ruby/ext/grpc/rb_event_thread.c (L136)

But because ruby doesn't join ruby threads when the process is
terminating, the `init/shutdown` pairs in 2) are always left open. I.e.,
thus far we have never been invoking the final call to `grpc_shutdown`
which actually does C-core global shutdown. Thus our calls to
`grpc_shutdown` are useless.

So we might as well keep things simple and not even attempt to call
`grpc_shutdown`. Now we just call `grpc_init` before using C-core, and
then never even attempt global shutdown (in non-forking situations).

As a bonus, this fixes the issue with the event thread's
`grpc_ruby_init` racing with `prefork` that is mentioned in
https://github.com/grpc/grpc/pull/33666
2023-07-12 15:50:33 -07:00
apolcyn fe11ec9bcb
[ruby] experimental client side fork support (#33430)
Adds experimental fork support to gRPC/Ruby

Works towards https://github.com/grpc/grpc/issues/8798 (see caveats for why this wasn't marked fixed yet)
Works towards https://github.com/grpc/grpc/issues/33578 (see caveats for why this wasn't marked fixed yet)

This leverages existing `pthread_atfork` based C-core support for
forking that python/php use, but there's a bit extra involved mainly
because gRPC/Ruby has additional background threads.

New tests under `src/ruby/end2end` show example usage.

Based on https://github.com/grpc/grpc/pull/33495

Caveats:
- Bidi streams are not yet supported (bidi streams spawn background
threads which are not yet fork safe)
- Servers not supported
- Only linux supported
2023-07-10 13:34:10 -07:00
alto-ruby f7b1ed8287
[Ruby] remove objs and strip libs in ruby extension build (#33596)
Remove `src/ruby/ext/grpc/objs/` and strip `src/ruby/ext/grpc/libs/` in
ruby build dir to save some space.
This can reduce the grpc gem size from more than 1G to about 70~80M.
This only affects opt build, dbg build remains the same.

A proper fix maybe use the same makefile to build c-core and the
extension rather than building c-core when generating the extension
makefile.

fixes: https://github.com/grpc/grpc/issues/33412
2023-07-09 18:38:53 -07:00
Matthew Stevenson 278978d6f0
[tls] Remove use of SSL_CTX_set_client_CA_list for TLS server credentials. (#33558)
This PR does the following: for the TLS server credentials, stops
calling `SSL_CTX_set_client_CA_list` by default in
`ssl_transport_security.cc`, and gives users a knob to re-enable calling
this API.

## What does the `SSL_CTX_set_client_CA_list` API do?

When this API is called, a gRPC TLS server sends the following data in
the ServerHello: for each certificate in the server's trust bundle, the
CA name in the certificate.

This API does not change the set of certificates trusted by the server
in any way. Rather, it is just providing a hint to the client about what
client certificate should be sent to the server.

## Why are we removing the use of `SSL_CTX_set_client_CA_list` by
default for the TLS server credentials?

Removing the use of this API by default has 2 benefits:
1. Calling this API makes gRPC TLS unusable for servers with a
sufficiently large trust bundle. Indeed, if the server trust bundle is
too large, then the server will always fail to build the ServerHello.
2. Calling this API is introducing a huge amount of overhead (1000s of
bytes) to each ServerHello, so removing this feature will improve
connection establishment latency for all users of the TLS server
credentials.
2023-06-29 09:48:15 -07:00
Mike Dalessio 6076825390
[ruby] Add `-weak_framework CoreFoundation` to link line (#33538)
Add -weak_framework CoreFoundation to the ruby extension link line on
arm64-darwin, to address "undefined symbols" issues from #33483

This is a variation on #33513 in response to feedback and so I've made
sure @alto-ruby is credited as co-author.

Closes #33483

Supersedes #33513

cc @apolcyn

Co-authored-by: alto-ruby <altorubys@gmail.com>
2023-06-23 15:43:02 -07:00
Peter Zhu a4ab4d0033
[Ruby] Fix memory leak in grpc_rb_call_run_batch (#33368)
The function grpc_rb_call_run_batch has many places that could raise
errors, including in child functions. Since a raised error will longjump
out of the function, it will cause memory leaks since the function
cannot perform any clean up. This commit fixes the issue by wrapping the
whole function in an rb_ensure, which will ensure that a cleanup
function is ran before the error is propagated upwards.
2023-06-09 14:30:23 -07:00
Peter Zhu 4fd6dc2066
[Ruby] Fix memory leak in grpc_rb_server_request_call (#33371)
The function grpc_rb_server_request_call has many places that could
raise errors, including in child functions. Since a raised error will
longjump out of the function, it will cause memory leaks since the
function cannot perform any clean up. This commit fixes the issue by
wrapping the whole function in an rb_ensure, which will ensure that a
cleanup function is ran before the error is propagated upwards.
2023-06-09 14:30:05 -07:00
Yijie Ma 5a0678001b
[Release] Bump version to 1.57.0-dev (on master branch) (#33311)
Change was created by the release automation script. See
go/grpc-release.
2023-06-01 10:55:31 -07:00
Stan Hu 01c87e24da
[ruby] fix re2 compilation when older system version installed (#32580)
re2 previously failed to compile if:

1. An old `re2` version is installed with a non-standard system prefix,
such as `/opt/local`.
2. The environment variable is set: `CPPFLAGS=-I/opt/local/include`.

Running `make` would result in function prototype mismatches because the
Makefile would previously attempt to use the headers from
`/opt/local/include/re2` before the `third_party/re2/re2` directory.

https://github.com/grpc/grpc/pull/27660 caused `CPPFLAGS` to inherit
from the environment, but this can cause the Makefile to use external
include files for re2 and other libraries if `-I` flags are defined.

This commit reverts to the original behavior of only using
`RbConfig::CONFIG` values to avoid using the wrong headers.
2023-05-16 11:09:55 -07:00
Yash Tibrewal dc075539e7
[Release] Bump version to 1.56.0-dev (on master branch) (#32918)
Change was created by the release automation script. See go/grpc-release
2023-04-24 10:47:57 -07:00
y.okamoto 0ce39dca7e
[Ruby] Fixed the return value of `PLATFORM.architecture` when MacOS is Ventura ( #31782 ). (#31783)
i apologize if my PR is wrong. I'm not used to sending PRs. 🙇 

i fixed the bug(#31782).
please read this issue for more information.
2023-03-30 08:33:25 -07:00
Stanley Cheung ec1d75bb0a
[Release process] Bump version to 1.55.0-dev (on master branch) (#32743)
Change was created by the release automation script. See
go/grpc-release.
2023-03-29 11:03:07 -07:00
Mark D. Roth 50e6af14ff
Bump dev version to 1.54.0-dev (#32426) 2023-02-21 12:03:19 -08:00
apolcyn 4777db3003
[ruby testing]: experimental change to grpc_class_init_test (#32337)
Let's see if this fixes the "Bus error" flakes that have been happening
in CI.

If it does, then we can narrow things down a bit. If flakes continue,
then we can revert this PR.
2023-02-14 14:49:11 -08:00
apolcyn 8734964482
Simplify ruby class init test (#32307) 2023-02-07 10:39:03 -08:00
apolcyn c1a4b526fb
[ruby]: add pre-compiled binaries for ruby 3.2; drop them for ruby 2.6 (#32089)
[ruby]: add pre-compiled binaries for ruby 3.2; drop them for ruby 2.6
2023-01-19 15:32:26 -08:00
Jan Tattermusch 17cadf8689
Fix regenerate protos scripts. (#32135)
* src/proto/grpc/core/stats.proto no longer exists

* remove PHP generated file for proto that no longer exists

* run src/ruby/pb/generate_proto_ruby.sh
2023-01-19 09:16:23 +01:00