Skip to content

Commit

Permalink
Correct Windows build defects noted with recent version updates (envo…
Browse files Browse the repository at this point in the history
…yproxy#10469)

- Pick up curl-7_69_1
- Patch curl to revert change to cmake_minimum_required
  - latest version of curl added a maximum version of cmake 3.16
- Pick up cares-1_16_0
- Toggle crosstool build to avoid possibly injecting wrongly assumed
  flags (/MD or -MD dynamic linkage override of our /MT static build)

Signed-off-by: Sunjay Bhatia <[email protected]>
Signed-off-by: William A Rowe Jr <[email protected]>
Co-authored-by: Sunjay Bhatia <[email protected]>
Co-authored-by: William A Rowe Jr <[email protected]>
  • Loading branch information
wrowe and sunjayBhatia authored Mar 23, 2020
1 parent 95bbc54 commit 0b48007
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
17 changes: 17 additions & 0 deletions bazel/foreign_cc/curl-revert-cmake-minreqver.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Curl 7.69.1 introduces a range-bound cmake revisions between 3.0 and 3.16
# but this causes the Win32 build to be broken (and is unwise as cmake
# has already released 3.17)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b13616fc7..8b6d77542 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,8 +38,7 @@
# To check:
# (From Daniel Stenberg) The cmake build selected to run gcc with -fPIC on my box while the plain configure script did not.
# (From Daniel Stenberg) The gcc command line use neither -g nor any -O options. As a developer, I also treasure our configure scripts's --enable-debug option that sets a long range of "picky" compiler options.
-cmake_minimum_required(VERSION 3.0...3.16 FATAL_ERROR)
-
+cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
include(Utilities)
include(Macros)
2 changes: 2 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,8 @@ def _com_github_curl():
build_file_content = BUILD_ALL_CONTENT + """
cc_library(name = "curl", visibility = ["//visibility:public"], deps = ["@envoy//bazel/foreign_cc:curl"])
""",
patches = ["@envoy//bazel/foreign_cc:curl-revert-cmake-minreqver.patch"],
patch_args = ["-p1"],
**location
)
native.bind(
Expand Down
6 changes: 3 additions & 3 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ REPOSITORY_LOCATIONS = dict(
urls = ["https://github.com/census-instrumentation/opencensus-cpp/archive/13b1a2f29f541b6b2c4cb8bc3f6fbf3589d44227.tar.gz"],
),
com_github_curl = dict(
sha256 = "1dd7604e418b0b9a9077f62f763f6684c1b092a7bc17e3f354b8ad5c964d7358",
strip_prefix = "curl-7.68.0",
urls = ["https://github.com/curl/curl/releases/download/curl-7_68_0/curl-7.68.0.tar.gz"],
sha256 = "01ae0c123dee45b01bbaef94c0bc00ed2aec89cb2ee0fd598e0d302a6b5e0a98",
strip_prefix = "curl-7.69.1",
urls = ["https://github.com/curl/curl/releases/download/curl-7_69_1/curl-7.69.1.tar.gz"],
),
com_googlesource_chromium_v8 = dict(
# This archive was created using https://storage.googleapis.com/envoyproxy-wee8/wee8-archive.sh
Expand Down
2 changes: 1 addition & 1 deletion ci/windows_ci_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ BAZEL_BUILD_OPTIONS="-c opt --config=msvc-cl --show_task_finish --verbose_failur

bazel ${BAZEL_STARTUP_OPTIONS} build ${BAZEL_BUILD_OPTIONS} //bazel/... --build_tag_filters=-skip_on_windows

bazel ${BAZEL_STARTUP_OPTIONS} build ${BAZEL_BUILD_OPTIONS} //source/exe:envoy-static
bazel ${BAZEL_STARTUP_OPTIONS} build ${BAZEL_BUILD_OPTIONS} //source/exe:envoy-static --build_tag_filters=-skip_on_windows

# bazel ${BAZEL_STARTUP_OPTIONS} test ${BAZEL_BUILD_OPTIONS} //test/... --test_tag_filters=-skip_on_windows --build_tests_only --test_summary=terse --test_output=errors
2 changes: 2 additions & 0 deletions windows/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ build --define absl=1

# Should not be required after upstream fix, see issue;
# https://github.com/bazelbuild/rules_foreign_cc/issues/301
build --copt="-DCARES_STATICLIB"
build --copt="-DNGHTTP2_STATICLIB"
build --copt="-DCURL_STATICLIB"

# Required to work around quiche build defect
# Unguarded gcc pragmas are not recognized by MSVC
Expand Down

0 comments on commit 0b48007

Please sign in to comment.