From 9fa51d0bc95b3a4a6a952e60424418110e057088 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Mon, 24 Apr 2023 07:40:35 -0700 Subject: [PATCH] Enable Windows CI PiperOrigin-RevId: 526638532 --- .github/workflows/bazel_tests.yml | 3 +-- bazel/workspace_deps.bzl | 4 ++-- upbc/upbdev.c | 7 +++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bazel_tests.yml b/.github/workflows/bazel_tests.yml index 90364f6603..76cdf27c56 100644 --- a/.github/workflows/bazel_tests.yml +++ b/.github/workflows/bazel_tests.yml @@ -28,8 +28,7 @@ jobs: - { NAME: "UBSAN", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "--config=ubsan -c dbg -- -benchmarks:benchmark -python/... -lua/...", install: "libunwind-dev" } - { NAME: "32-bit", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "--copt=-m32 --linkopt=-m32 -- -... benchmarks:benchmark ", install: "g++-multilib" } - { NAME: "macOS", BAZEL: bazel, CC: clang, os: macos-11 } - # TODO(b/277357519): fix the Windows test. - # - { NAME: "Windows", BAZEL: bazel, os: windows-2019, startup-flags: "--output_user_root=C:/tmp", flags: "--config=cpp17_msvc", targets: "upb/... upbc/... python/... protos/... protos_generator/..." } + - { NAME: "Windows", BAZEL: bazel, os: windows-2019, startup-flags: "--output_user_root=C:/tmp", flags: "--config=cpp17_msvc", targets: "upb/... upbc/... python/... protos/... protos_generator/..." } # We support two Bazel versions back per https://opensource.google/documentation/policies/cplusplus-support - { NAME: "Bazel 4.1.0", BAZEL: bazel-4.1.0-linux-x86_64, CC: clang, os: ubuntu-20-large } - { NAME: "Bazel 5.3.0", BAZEL: bazel-5.3.0-linux-x86_64, CC: clang, os: ubuntu-20-large } diff --git a/bazel/workspace_deps.bzl b/bazel/workspace_deps.bzl index 88e616445b..8897f272b9 100644 --- a/bazel/workspace_deps.bzl +++ b/bazel/workspace_deps.bzl @@ -23,8 +23,8 @@ def upb_deps(): _github_archive, name = "com_google_protobuf", repo = "https://github.com/protocolbuffers/protobuf", - commit = "13833b1df01b811c6b0a3a2c83864579d740050f", - sha256 = "b029d1a5f84b3f0f424f7524101e3104fae8c59bb3a6104b9cec451b14b3d3e8", + commit = "f71dc953c77f164523c23e7c2485ccc49ada3c2e", + sha256 = "e4ea58f01e8fa6ce920449d70a220be4d5f2e9a4f77123e3595c72bd60a34987", patches = ["@upb//bazel:protobuf.patch"], ) diff --git a/upbc/upbdev.c b/upbc/upbdev.c index c3a205a2c5..1ac30eab64 100644 --- a/upbc/upbdev.c +++ b/upbc/upbdev.c @@ -25,7 +25,14 @@ #include "upbc/upbdev.h" +#ifdef _WIN32 +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#else // _WIN32 #include +#endif // !_WIN32 #include "google/protobuf/compiler/plugin.upb.h" #include "google/protobuf/compiler/plugin.upbdefs.h"