Skip to content

Commit

Permalink
improve C++17 patch for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Feb 15, 2023
1 parent 40a5071 commit b04fada
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions recipe/patches/0001-windows-ssl-lib-names.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 5c1b4e9324448cb808cfc0cce73c7f910f4e0c6a Mon Sep 17 00:00:00 2001
From c93b763c131d48239b428a3e5442f73fa43b7e43 Mon Sep 17 00:00:00 2001
From: Jonathan Helmus <jjhelmus@gmail.com>
Date: Mon, 17 Feb 2020 15:45:06 -0600
Subject: [PATCH 1/6] windows ssl lib names
Expand All @@ -11,7 +11,7 @@ Co-Authored-By: Marius van Niekerk <marius.v.niekerk@gmail.com>
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/setup.py b/setup.py
index 3a50c975d8..7dc5bb6723 100644
index 8da207b713..24cc524fce 100644
--- a/setup.py
+++ b/setup.py
@@ -328,10 +328,10 @@ if "win32" in sys.platform:
Expand Down
6 changes: 3 additions & 3 deletions recipe/patches/0002-fix-win-setup-cmds.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 902b7346f5c8376edeba9c347821f0895d9f3f90 Mon Sep 17 00:00:00 2001
From bbea353b185de79d7fc61b182a39b5861855e9e0 Mon Sep 17 00:00:00 2001
From: Mike Sarahan <msarahan@gmail.com>
Date: Tue, 18 Feb 2020 13:53:05 -0600
Subject: [PATCH 2/6] fix win setup cmds
Expand All @@ -13,7 +13,7 @@ Co-Authored-By: H. Vetinari <h.vetinari@gmx.com>
2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/setup.py b/setup.py
index 7dc5bb6723..f5aa42ffe1 100644
index 24cc524fce..2f7169e448 100644
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,6 @@ from distutils.unixccompiler import UnixCCompiler
Expand Down Expand Up @@ -54,7 +54,7 @@ index 7dc5bb6723..f5aa42ffe1 100644
EXTRA_ENV_LINK_ARGS += (
' -static-libgcc -static-libstdc++ -mcrtdll={msvcr}'
diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py
index d93b6c7039..024512624a 100644
index 58ab57be47..8e296646e5 100644
--- a/src/python/grpcio/commands.py
+++ b/src/python/grpcio/commands.py
@@ -226,6 +226,8 @@ class BuildExt(build_ext.build_ext):
Expand Down
4 changes: 2 additions & 2 deletions recipe/patches/0003-Link-against-grpc.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 09d6862015f1564d04bf9143c1f922f0fb8cb63d Mon Sep 17 00:00:00 2001
From 5a635995236a1b517117d4d5fe54120be89e6a5c Mon Sep 17 00:00:00 2001
From: Marius van Niekerk <marius.v.niekerk@gmail.com>
Date: Mon, 13 Jun 2022 17:13:07 -0400
Subject: [PATCH 3/6] Link against grpc
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 3/6] Link against grpc
1 file changed, 10 insertions(+)

diff --git a/setup.py b/setup.py
index f5aa42ffe1..63847a7781 100644
index 2f7169e448..090d3b8af8 100644
--- a/setup.py
+++ b/setup.py
@@ -170,6 +170,8 @@ BUILD_WITH_SYSTEM_ABSL = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_ABSL', False)
Expand Down
2 changes: 1 addition & 1 deletion recipe/patches/0004-force-protoc-executable.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From fbcdbf86f4b90d078d024392559bac2984d7e4eb Mon Sep 17 00:00:00 2001
From 9c8f848a9d7ba8b64e67aba53b6d57ca60661bd4 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <uwe.korn@quantco.com>
Date: Fri, 11 Sep 2020 14:20:04 +0200
Subject: [PATCH 4/6] force protoc executable
Expand Down
12 changes: 7 additions & 5 deletions recipe/patches/0005-switch-to-C-17-for-grpcio.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From fcd36cc0e41cb14f263f6840ba300134a3340abf Mon Sep 17 00:00:00 2001
From bb666d0929708284406be702afae1d04e7e680dc Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Sat, 3 Sep 2022 19:23:15 +0200
Subject: [PATCH 5/6] switch to C++17 for grpcio

---
setup.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
setup.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/setup.py b/setup.py
index 63847a7781..0e535e259a 100644
index 090d3b8af8..0c31ff5a80 100644
--- a/setup.py
+++ b/setup.py
@@ -210,7 +210,7 @@ def check_linker_need_libatomic():
Expand All @@ -29,15 +29,17 @@ index 63847a7781..0e535e259a 100644
stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
@@ -238,7 +238,7 @@ def check_linker_need_libatomic():
@@ -238,8 +238,9 @@ def check_linker_need_libatomic():
EXTRA_ENV_COMPILE_ARGS = os.environ.get('GRPC_PYTHON_CFLAGS', None)
EXTRA_ENV_LINK_ARGS = os.environ.get('GRPC_PYTHON_LDFLAGS', None)
if EXTRA_ENV_COMPILE_ARGS is None:
- EXTRA_ENV_COMPILE_ARGS = ' -std=c++14'
+ EXTRA_ENV_COMPILE_ARGS = ' -std=c++17'
if 'win32' in sys.platform:
+ EXTRA_ENV_COMPILE_ARGS = ' /std:c++17'
if sys.version_info < (3, 5):
EXTRA_ENV_COMPILE_ARGS += ' -D_hypot=hypot'
# We use define flags here and don't directly add to DEFINE_MACROS below to
--
2.38.1.windows.1

6 changes: 3 additions & 3 deletions recipe/patches/0006-fix-abseil-setup.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 3fe072b196fec268a6d1e4f1ae3bd59efd0d4bb3 Mon Sep 17 00:00:00 2001
From b7696f775183da4c5ed4d98ffbbbdf8790a81abc Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Sun, 4 Sep 2022 14:34:52 +0200
Subject: [PATCH 6/6] fix abseil setup
Expand All @@ -8,10 +8,10 @@ Subject: [PATCH 6/6] fix abseil setup
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/setup.py b/setup.py
index 0e535e259a..fee180d4ef 100644
index 0c31ff5a80..11e20846bd 100644
--- a/setup.py
+++ b/setup.py
@@ -340,13 +340,16 @@ if BUILD_WITH_SYSTEM_CARES:
@@ -341,13 +341,16 @@ if BUILD_WITH_SYSTEM_CARES:
if BUILD_WITH_SYSTEM_RE2:
EXTENSION_LIBRARIES += ('re2',)
if BUILD_WITH_SYSTEM_ABSL:
Expand Down

0 comments on commit b04fada

Please sign in to comment.