Skip to content

Commit

Permalink
Add patch for com_google_protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
avdv committed Jun 26, 2024
1 parent 467e2e7 commit 5cd6270
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
27 changes: 27 additions & 0 deletions haskell/private/com_google_protobuf-protoc-dbghlp.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/build_defs/cpp_opts.bzl b/build_defs/cpp_opts.bzl
index f667a4088..da463ca45 100644
--- a/build_defs/cpp_opts.bzl
+++ b/build_defs/cpp_opts.bzl
@@ -44,6 +44,9 @@ LINK_OPTS = select({
"-lm",
"-framework CoreFoundation",
],
+ "@platforms//os:windows": [
+ "-ldbghelp",
+ ],
"//conditions:default": [
"-lpthread",
"-lm",
diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc
index 60900d215..10c41b441 100644
--- a/src/google/protobuf/port_def.inc
+++ b/src/google/protobuf/port_def.inc
@@ -673,7 +673,7 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
#error PROTOBUF_DESCRIPTOR_WEAK_MESSAGES_ALLOWED was previously defined
#endif
#if defined(__GNUC__) && defined(__clang__) && !defined(__APPLE__) && \
- !defined(_MSC_VER)
+ !defined(_MSC_VER) && !defined(_WIN32)
#define PROTOBUF_DESCRIPTOR_WEAK_MESSAGES_ALLOWED
#endif

5 changes: 5 additions & 0 deletions haskell/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ def rules_haskell_dependencies():
urls = [
"https://github.com/protocolbuffers/protobuf/archive/refs/tags/v27.0.tar.gz",
],
patches = [
# see https://github.com/protocolbuffers/protobuf/issues/16844
"@rules_haskell//haskell:private/com_google_protobuf-protoc-dbghlp.diff",
],
patch_args = ["-p1"],
)
maybe(
http_archive,
Expand Down

0 comments on commit 5cd6270

Please sign in to comment.