Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc patch: Fixed NAN/INFINITY definitions to work on Windows 11 SDK. #5998

Merged
merged 24 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions packages/g/grpc/patches/1.68.2/fix-nan-on-win11.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/third_party/upb/upb/message/internal/message.c b/third_party/upb/upb/message/internal/message.c
index 265d30d..afc6e51 100644
--- a/third_party/upb/upb/message/internal/message.c
+++ b/third_party/upb/upb/message/internal/message.c
@@ -17,9 +17,9 @@
// Must be last.
#include "upb/port/def.inc"

-const float kUpb_FltInfinity = INFINITY;
-const double kUpb_Infinity = INFINITY;
-const double kUpb_NaN = NAN;
+const float kUpb_FltInfinity = (float)(1.0 / 0.0);
+const double kUpb_Infinity = 1.0 / 0.0;
+const double kUpb_NaN = 0.0 / 0.0;

bool UPB_PRIVATE(_upb_Message_Realloc)(struct upb_Message* msg, size_t need,
upb_Arena* a) {

6 changes: 5 additions & 1 deletion packages/g/grpc/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ package("grpc")
"https://github.com/grpc/grpc.git")
add_versions("v1.51.3", "17720fd0a690e904a468b4b3dae6fa5ec40b0d1f4d418e2ca092e2f92f06fce0")
add_versions("v1.62.1", "f672a3a3b370f2853869745110dabfb6c13af93e17ffad4676a0b95b5ec204af")
add_versions("v1.68.2", "2a17adb0d23768413ca85990dbf800a600863d272fcc37a9f67f3b5e34ae9174")

add_patches("1.51.3", path.join(os.scriptdir(), "patches", "1.51.3", "disable-download-archive.patch"), "90fdd6e4a51cbc9756d1fcdd0f65e665d4b78cfd91fdbeb0228cc4e9c4ba1b73")
add_patches("1.51.3", path.join(os.scriptdir(), "patches", "1.51.3", "static-linking-in-linux.patch"), "176474919883f93be0c5056098eccad408038663c6c7361f2e049cdf7247a19c")

add_patches("1.68.2", path.join(os.scriptdir(), "patches", "1.68.2", "fix-nan-on-win11.patch"), "ebb7cb2772528edd9de306820a4f811f4e8150fa4daa4471431315bfa30a2617")
add_deps("cmake")
if is_plat("linux") then
add_deps("autoconf", "libtool", "pkg-config")
Expand Down Expand Up @@ -53,6 +54,9 @@ package("grpc")
"-DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
if package:is_cross() then
package:add("deps", "protoc")
star-hengxing marked this conversation as resolved.
Show resolved Hide resolved
end
import("package.tools.cmake").install(package, configs, {packagedeps = {"abseil", "protobuf-cpp"}})
end)

Expand Down
Loading