Commit Graph

46 Commits

Author SHA1 Message Date
Ming-Chuan d6bb391449 [Build] Migrate Android NDK, android rules and platforms (#36116)
This commit does the following 3 things for Android bazel rules, which depends on each other

1. Update NDK to 26.2.11394342 (and a few other Android things)
2. Use rules_android_ndk instead of builtin `native.android_ndk_repository`
    * `third_party/android/android_configure.bzl` was a workaround for users who don't set `$ANDROID_NDK_HOME` env var. Now with rules_android_ndk, we can declare repo without registering the toolchain. Instead users who need NDK toolchain should use `--extra_toolchains` to manually register the toolchain, as shown in README.md.
3. Migrate to platforms. See https://bazel.build/concepts/platforms
    * Currently we declares android platforms that is needed for binder transport APK. Later gRPC repo can gradually migrate to platforms for other platforms.
    * The value of `crosstool_top` will still be `//external:android/crosstool` (which is the default value), so existings android `config_settings` will still work. We should migrate them to match with `@platforms//os:android` constraint later.

The platforms migration needs Bazel 7.0 to work so we also override bazel version in testing scripts.

Closes #36116

PiperOrigin-RevId: 617244655
2024-03-19 11:46:15 -07: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
apolcyn 017786f151
[c-ares] Upgrade c-ares dependency to 1.19.1 (#33392)
WIP
2023-06-12 13:38:20 -07:00
Hannah Shi d8a52a5043
build multi arc ios unit test for m1 (#31930) 2023-01-05 16:27:21 -08:00
3405691582 e55be30ffb
Start to buildfix OpenBSD. (#30557)
Some minor changes for the platform:

* `sys/types.h` needs to be included before `netinet/tcp.h` to provide
  definitions for `u_int8_t`, `u_int16_t`, and `u_int32_t`.

* cares has an OpenBSD-specific config header but is not actually hooked
  up in cares.BUILD. Remedy that.
2022-08-18 09:09:40 -07:00
apolcyn 9f1663fb74
Upgrade c-ares to 1.17.2 (#28671)
Upgrade c-ares dependency to 1.17.2
2022-01-25 10:41:18 -08:00
Thi Doãn 0ced4f5caa
Add darwin_arm64 and darwin_arm64e to c-ares' config settings
This fixes Bazel selecting the wrong source for `cares` when building
with `--cpu=darwin_arm64` or `--cpu=darwin_arm64e` (it was selecting the
source in the default condition, which is for Linux).

We're having the same patch in Bazel
(1782f0ae75;
it was using an older grpc release). Fixing this here so we can remove
the patch in the next update.
2020-12-08 19:56:10 +09:00
Damon f7f48c4ea0
Include ares_android.(c|h) in the build config.
This change adds `ares_android.h` and `ares_android.c` to the `third_party/cares/cares.BUILD` in order to support builds in the Android Native Development Kit (NDK).

Fixes grpc#21437
2020-10-01 18:14:09 +10:00
Tom Lundell a4a5206da1 Switch genrule to skylib's copy_file.
genrules are not supported on Windows without
an msys bash installation, which is an undesirable
dependency. Fortunately we can use skylib's copy_file
to accomplish the same thing as the genrules were doing.

release notes: no
2020-05-12 18:50:14 -04:00
Tony Lu b4eefcfc0e Added source of new CPUs 2019-08-14 22:26:37 -07:00
Tony Lu c81dfd91de Added cpu architecture for tvos and watchos 2019-08-07 17:01:37 -07:00
billfeng327 242500b811 explicitly added header file for correctly compiling c-ares with Bazel 2019-03-29 15:41:20 -07:00
Fabian Holler cab0c36d99 adapt cares config headers files to new version
2250b598fe
introduced a new HAVE___SYSTEM_PROPERTY_GET define, adapt the
ares_config.h files.
2019-03-26 13:13:49 -07:00
Fabian Holler 8c49802f75 add strsplit.c, strsplit.h files to build and test files
The files are new in the updated cares release.
2019-03-26 13:13:49 -07:00
Fabian Holler 113e84b8dd update cares to version cares-1_15_0
This fixes the issue: https://github.com/grpc/grpc/issues/16688

Which causes that grpc can not be build because of the following
compiler error:
  third_party/cares/cares/ares_init.c: In function ‘ares_dup’:
  third_party/cares/cares/ares_init.c:301:17: error: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer- memaccess] sizeof(src->local_dev_name));
2019-03-26 13:13:49 -07:00
Alex Polcyn 9644e588f6 Build c-ares bazel lib with alwayslink=1 2019-02-27 23:06:11 -08:00
Tony Allevato 330e0f3ba8 Support "darwin_x86_64" CPU in cares.BUILD.
Bazel recognizes both "darwin" and "darwin_x86_64" as CPU values, and
the Apple Bazel rules currently recommend the latter for building
macOS targets. Until this is cleaned up, this change allows grpc to
build correctly when that configuration is used.

Fixes #17649.
2019-02-21 09:52:17 -08:00
Loo Rong Jie 73b613b6b0 Remove -DWIN32_LEAN_AND_MEAN 2018-06-08 14:50:46 +08:00
Loo Rong Jie d21bde15c6 Build C-Ares with Bazel on Windows 2018-06-03 10:37:47 +08:00
Ning Ren 174e02ae3e Packs contents of WORKSPACE into a bzl function, so that it can be resued by other projects, and simplifies cares build. 2017-12-14 17:37:55 -08:00
josh d692b76864 Pulling upstream changes and resolving merge conflicts with third_party/cares/cares.BUILD 2017-11-13 21:51:27 -07:00
Param Reddy 8ccb83a9e2 Update comments to mention iOS also is not supported. 2017-10-24 14:06:21 -07:00
Param Reddy 819ec5069b Android does not have getservbyport_r so use getservbyport 2017-10-24 13:17:29 -07:00
Param Reddy b96287a13f Fix build for ios app using grpc as cc_library
For ios build,  bazel build needs to be invoked with:
--ios_multi_cpu=armv7,arm64 build.  This in turn gets picked as
cpu based on the docs:
--[no]experimental_enable_objc_cc_deps default: "true"
Allows objc_* rules to depend on cc_library and causes any objc dependencies to be built with --cpu set to "ios_<--ios_cpu>" for any values in --ios_multi_cpu.

This diff explicitly adds darwin config for cpu being ios_x86_64, ios_armv7,
ios_armv7s and ios_arm64. We cant use ios_cpu as condition because its set to x86_64
by default and causes linux build break.
2017-10-20 18:21:16 -07:00
josh 5d710a5dfe Update Bazel WORKSPACE file and third_party/cares BUILD files to that Bazel can build gRPC as a dependency.
The WORKSPACE file now pulls third_party dependencies directly instead of requiring a git submodule init and update.
The git hashes pulled by Bazel are exactly the same as the git submodules checked into third_party.

A tiny bit of complexity comes from the c-ares project's use of ares_config.h.cmake and ares_build.c.cmake.
The current solution to this problem is to check in a valid ares_config.h and a few valid ares_config.h files.
This is the same general approach used still, but ares_config.h and ares_build.h are supplied to cares.BUILD
from the only remaining local_repository, which serves only to export these two header files.
2017-10-19 18:47:58 -06:00
Frank Groeneveld fbf8128da8 Add OpenBSD support 2017-10-12 13:50:38 -07:00
Alexander Polcyn 6dcbc1bb96 avoid __int64 for mingw portability 2017-09-09 16:32:48 +02:00
Mehrdad Afshari e8e9541715 Update config_freebsd/ares_config.h to FreeBSD 11 ares 1.13 2017-09-09 16:32:48 +02:00
Jan Tattermusch bb650ca875 reintroduce ares_build.h modification from #10719 2017-09-09 16:32:48 +02:00
Jan Tattermusch f0208acffc ares using monotonic clock on darwin breaks the build 2017-09-09 16:32:48 +02:00
Jan Tattermusch f1a3e0c25a add back manual edits to config_linux/ares_config.h 2017-09-09 16:32:48 +02:00
Jan Tattermusch 7a816865a5 regenerate darwin ares_config.h 2017-09-09 16:32:47 +02:00
Jan Tattermusch 138eea81f9 cherrypick fixed version of ares_build.h 2017-09-09 16:32:47 +02:00
Jan Tattermusch ade414a191 fix ares 1.13 build on linux 2017-09-09 16:32:47 +02:00
Jan Tattermusch b0f180afac bump c-ares submodule to 1.13 2017-09-09 16:32:47 +02:00
murgatroid99 882ba60fcb Merge remote-tracking branch 'upstream/v1.4.x' into master_1.4.1_upmerge 2017-07-06 10:15:11 -07:00
apolcyn 59c232c904 Merge pull request #11404 from apolcyn/fix_ruby_glibc_upgrade
Redefine fd_set macros for compatibilty with older glibc
2017-06-16 19:55:32 -07:00
Makarand Dharmapurikar 1d8e46559b fixes #11473 2017-06-12 13:18:17 -07:00
Alexander Polcyn c3735cbe90 hack to reimplement FDS macros 2017-06-05 12:39:37 -07:00
Alexander Polcyn 4616dd0685 dont use clock_gettime in grpc compatibiltiy mode 2017-06-03 13:51:07 -07:00
David Garcia Quintas 81aae44858 Merge branch 'v1.3.x' into master-upmerge-v1.3.x 2017-04-28 14:37:17 -07:00
Mehrdad Afshari 79ec0ff542 Increase portability of CMakeLists.txt
- Update CMakeLists.txt (original template and generated code)
  to prevent forcefully linking `dl` on all UNIX platforms,
  and rely on `${CMAKE_DL_LIBS}` portable variable instead.
- Do not try linking against `librt` on macOS.
- Add a `config_freebsd` directory containing the header file
  generated by the `configure` script for the `ares` library.
2017-04-20 14:33:13 -07:00
Yuchen Zeng 2aa194329b c-ares mingw32 support 2017-04-18 15:21:40 -07:00
Makarand Dharmapurikar 72c4d00019 fix bazel build for osx
add config setting for building c-ares on osx
2017-04-18 14:51:43 -07:00
Yuchen Zeng c09fd8c58a Update c-ares to 1.12.0 2017-01-23 17:14:47 -08:00
Yuchen Zeng 4c702ed1a1 Add bazel build rule for c-ares 2017-01-23 10:30:10 -08:00