In Ruby 3.2 the default allocator warns if used with `Data_Wrap_Struct`. This removed the default allocator in those cases.
Ruby discussion: https://bugs.ruby-lang.org/issues/18007
Previously attempting to build the Ruby C extensionwould result in
undefined symbol:
```
Undefined symbols for architecture arm64:
"_ruby_abi_version", referenced from:
-exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
As noted in https://github.com/ruby/ruby/pull/6231,
`_ruby_abi_version` is only available for development
versions. `RUBY_PATCHLEVEL` < 0 denotes a development version, while
>= 0 denotes a released version.
Add a check that SEND_STATUS_FROM_SERVER and RECV_MESSAGE are not in the same batch.
This is necessary pre-work for #31204 and implements part of grpc/proposal#336.
Also eliminates fling instead of updating it:
My expectation is nobody has looked at this corner in many years
It's not a benchmark we want: concentrating on a microbenchmark that doesn't include a binding layer caused us to favor designs that emphasized a lightweight core at the expense of a expensive bindings. We should consider the whole.
Co-authored-by: ctiller <ctiller@users.noreply.github.com>
* Fix Ruby Windows 3.1 (x64-mingw-ucrt) build:
- Pass-in CPPFLAG "GPR_WINDOWS_UCRT" to pickup correct shared object file.
- Rename intermediate legacy SO file from 'grpc_c.64.ruby' to 'grpc_c.64-msvcrt.ruby' for clarity.
- Add artifact target for Ruby x64-mingw-ucrt
* Change CPP flag name
* replace darwin checks in extconf.rb to exclude TruffleRuby
* inherit RANLIB and STRIP from RbConfig, set LDXX
* enable overriding ranlib command in top-level makefile
* ensure the -no_warning_for_no_symbols flag is only used with Apple's ranlib
* don't embed openssl & zlib on truffleruby
* add RbConfig's cppflag to CPPFLAGS when using TruffleRuby
* this ensure the paths to find the system's OpenSSL are set up correctly with TruffleRuby (includes being able to find an OpenSSL installed via Homebrew etc)
* don't statically link standard libraries on Linux with Truffleruby
* This does not work when compiling to bitcode.
* Prefer SIGTERM to SIGQUIT for graceful shutdown in examples
* Overriding SIGQUIT is suboptimal, for example on JVM where it is very
useful to dump the thread stacktraces.
* Keep the rb_tr_abi_version symbol for TruffleRuby in grpc_c.so
* Otherwise TruffleRuby cannot verify the ABI version is correct.
* See https://github.com/oracle/truffleruby/issues/2386
* Use RbConfig::CONFIG['STRIP'] instead of just `strip`
* Use a local variable for apple_toolchain for consistency
* Add a comment about -static-libgcc -static-libstdc++ and TruffleRuby
* Split comment into two for openssl/zlib
Co-authored-by: Nicolas Laurent <nicolas.laurent@oracle.com>
* Having the entire logic of extconf.rb duplicated in 2 files is
extremely inconvenient, also because the Ruby logic in the YAML template
does not get any syntax highlighting or IDE features.
The next Ruby version, 3.2, will have builtin ABI checking (see
ruby/ruby#5474). This requires that the symbol `ruby_abi_version` is
present in the shared object, otherwise the object fails to load.
For example, this is a small repro in Ruby 3.2:
```
$ ruby -Isrc/ruby/lib -e "require 'grpc'"
<internal:/home/peter/src/ruby/install/lib/ruby/3.2.0+0/rubygems/core_ext/kernel_require.rb>:85:in `require': /home/peter/src/grpc/src/ruby/lib/grpc/grpc_c.so: undefined symbol: ruby_abi_version - ruby_abi_version (LoadError)
from <internal:/home/peter/src/ruby/install/lib/ruby/3.2.0+0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /home/peter/src/grpc/src/ruby/lib/grpc/grpc.rb:22:in `<top (required)>'
from /home/peter/src/grpc/src/ruby/lib/grpc.rb:19:in `require_relative'
from /home/peter/src/grpc/src/ruby/lib/grpc.rb:19:in `<top (required)>'
from <internal:/home/peter/src/ruby/install/lib/ruby/3.2.0+0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/home/peter/src/ruby/install/lib/ruby/3.2.0+0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from -e:1:in `<main>'
```
* Adding TLS Key export logic to core and c++ wrappers
* Adding and end2end cpp tls key export test and updating broken test due to interface changes
* regenerate projects
* updating tls key export core logic with addition of APIs to grpc_security.h
* undoing changes to tls_security_connector_test
* regenerate projects
* changing the logging format enum name as per GRFC comments
* regenerate projects
* removing some commented code
* updating changes as per review comments
* adding GRPCAPI annotations to functions defined in grpc_security.h
* regenerate projects
* fixed some code styling issues
* removing grpc_security.h include from tls_credentials_options.h
* updating files as per review comments
* minor fixes
* moving some code around
* removing key log format from tls session key log config and converting it to a simple string
* regenerate projects
* fixing mistakes in recent merge with master
* regenerate projects
* regenerate projects
* fixing some distrib and snity errors
* fixing formatting errors
* fixing more sanity checks and raising supported openssl versions to 1.1.1
* updating min supported openssl version to 1.1.1
* updating min supported openssl version in tls_key_export_test
* updating test to fix incorrect vector initialization
* updating as per latest comments
* fixing sanity checks
* addressing review comments
* fixing sanity checks
* fixed c++ comment style
* Automated change: Fix sanity tests
* fixing review comments
Co-authored-by: Vignesh2208 <Vignesh2208@users.noreply.github.com>