From 78bc558adec01b6f4cdb01246e9234a530ab4231 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Tue, 24 May 2022 11:11:32 -0500 Subject: [PATCH 1/8] boringssl: Add a patch to disable another warning breaking build for VS2022. Filed upstream as https://bugs.chromium.org/p/boringssl/issues/detail?id=495 --- ...le-C4191-warning-to-fix-VS2022-build.patch | 25 +++++++++++++++++++ ports/boringssl/portfile.cmake | 1 + ports/boringssl/vcpkg.json | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 ports/boringssl/0003-Disable-C4191-warning-to-fix-VS2022-build.patch diff --git a/ports/boringssl/0003-Disable-C4191-warning-to-fix-VS2022-build.patch b/ports/boringssl/0003-Disable-C4191-warning-to-fix-VS2022-build.patch new file mode 100644 index 00000000000000..06af455f72cf63 --- /dev/null +++ b/ports/boringssl/0003-Disable-C4191-warning-to-fix-VS2022-build.patch @@ -0,0 +1,25 @@ +From 02b661f9d056dc4a91dc317bc8f0e92e784c7345 Mon Sep 17 00:00:00 2001 +From: Ryan Pavlik +Date: Tue, 24 May 2022 11:03:08 -0500 +Subject: [PATCH] Disable C4191 warning to fix VS2022 build. + +Works around https://bugs.chromium.org/p/boringssl/issues/detail?id=495 for now. +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 83ff477..398e97f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -229,6 +229,7 @@ elseif(MSVC) + "C5027" # move assignment operator was implicitly defined as deleted + "C5045" # Compiler will insert Spectre mitigation for memory load if + # /Qspectre switch specified ++ "C4191" # Unsafe cast (we use it as a type-erased type) - see https://bugs.chromium.org/p/boringssl/issues/detail?id=495 + ) + set(MSVC_LEVEL4_WARNINGS_LIST + # See https://connect.microsoft.com/VisualStudio/feedback/details/1217660/warning-c4265-when-using-functional-header +-- +2.36.0.windows.1 + diff --git a/ports/boringssl/portfile.cmake b/ports/boringssl/portfile.cmake index e604c6a34a4ed9..28fc9489fcc025 100644 --- a/ports/boringssl/portfile.cmake +++ b/ports/boringssl/portfile.cmake @@ -28,6 +28,7 @@ vcpkg_from_github( PATCHES 0001-vcpkg.patch 0002-disable-waring-4065.patch + 0003-Disable-C4191-warning-to-fix-VS2022-build.patch ) vcpkg_configure_cmake( diff --git a/ports/boringssl/vcpkg.json b/ports/boringssl/vcpkg.json index d8d9f7ac2d8fb8..f5c22bcbd8472d 100644 --- a/ports/boringssl/vcpkg.json +++ b/ports/boringssl/vcpkg.json @@ -1,7 +1,7 @@ { "name": "boringssl", "version-date": "2021-06-23", - "port-version": 1, + "port-version": 2, "description": "BoringSSl is a fork of OpenSSL developed by Google", "homepage": "https://boringssl.googlesource.com/boringssl", "supports": "!uwp", From 520512a564ac847734e2c2c73de200f49fded057 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Tue, 24 May 2022 11:21:24 -0500 Subject: [PATCH 2/8] Update versions --- versions/b-/boringssl.json | 5 +++++ versions/baseline.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/b-/boringssl.json b/versions/b-/boringssl.json index 5700899dcb9552..1df8722bbdfa94 100644 --- a/versions/b-/boringssl.json +++ b/versions/b-/boringssl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "46299a1e13b7c7527089948769af84adfab81960", + "version-date": "2021-06-23", + "port-version": 2 + }, { "git-tree": "ca35c06a32c83f385f840831a435c69231a7852a", "version-date": "2021-06-23", diff --git a/versions/baseline.json b/versions/baseline.json index a82b85b07970da..60b5f23cb4a88e 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1126,7 +1126,7 @@ }, "boringssl": { "baseline": "2021-06-23", - "port-version": 1 + "port-version": 2 }, "botan": { "baseline": "2.19.1", From fa9fb3741f34355bf8cd23afd382e3bed2926014 Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Mon, 30 May 2022 00:21:21 -0700 Subject: [PATCH 3/8] format portfile.cmake --- ports/boringssl/portfile.cmake | 9 ++++----- ports/boringssl/vcpkg.json | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ports/boringssl/portfile.cmake b/ports/boringssl/portfile.cmake index 28fc9489fcc025..9d81a3d672da8a 100644 --- a/ports/boringssl/portfile.cmake +++ b/ports/boringssl/portfile.cmake @@ -31,9 +31,8 @@ vcpkg_from_github( 0003-Disable-C4191-warning-to-fix-VS2022-build.patch ) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${FEATURE_OPTIONS} OPTIONS_DEBUG @@ -41,10 +40,10 @@ vcpkg_configure_cmake( -DINSTALL_TOOLS=OFF ) -vcpkg_install_cmake() +vcpkg_cmake_install() if(IS_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/boringssl) vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/boringssl") endif() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/boringssl/vcpkg.json b/ports/boringssl/vcpkg.json index f5c22bcbd8472d..9d0affcbbaaa9c 100644 --- a/ports/boringssl/vcpkg.json +++ b/ports/boringssl/vcpkg.json @@ -5,6 +5,12 @@ "description": "BoringSSl is a fork of OpenSSL developed by Google", "homepage": "https://boringssl.googlesource.com/boringssl", "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ], "features": { "tools": { "description": "Build bssl executable" From 31ef08b9377d4b6d3b8536abc76d9686b3e75e63 Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Mon, 30 May 2022 00:35:02 -0700 Subject: [PATCH 4/8] x-add-version --- versions/b-/boringssl.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/b-/boringssl.json b/versions/b-/boringssl.json index 1df8722bbdfa94..bababd85de6b29 100644 --- a/versions/b-/boringssl.json +++ b/versions/b-/boringssl.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "46299a1e13b7c7527089948769af84adfab81960", + "git-tree": "adcf221b8e394dcf3acc3543d9cbe33ee42ffac5", "version-date": "2021-06-23", "port-version": 2 }, From 3902fa484ebe9f9c76c0ecca403f8b4b6966f14e Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Tue, 31 May 2022 23:18:07 -0700 Subject: [PATCH 5/8] Update patch, remove -WX and -Werror --- .../boringssl/0002-disable-waring-4065.patch | 15 ----------- ports/boringssl/0002-disable-waring.patch | 24 ++++++++++++++++++ ...le-C4191-warning-to-fix-VS2022-build.patch | 25 ------------------- ports/boringssl/portfile.cmake | 3 +-- 4 files changed, 25 insertions(+), 42 deletions(-) delete mode 100644 ports/boringssl/0002-disable-waring-4065.patch create mode 100644 ports/boringssl/0002-disable-waring.patch delete mode 100644 ports/boringssl/0003-Disable-C4191-warning-to-fix-VS2022-build.patch diff --git a/ports/boringssl/0002-disable-waring-4065.patch b/ports/boringssl/0002-disable-waring-4065.patch deleted file mode 100644 index 88ffffaf0bdaea..00000000000000 --- a/ports/boringssl/0002-disable-waring-4065.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/decrepit/CMakeLists.txt b/decrepit/CMakeLists.txt -index ef95a6b..0b52c05 100644 ---- a/decrepit/CMakeLists.txt -+++ b/decrepit/CMakeLists.txt -@@ -40,6 +40,10 @@ add_executable( - - add_dependencies(decrepit_test global_target) - -+if(MSVC) -+ target_compile_options(decrepit PRIVATE /wd4065) -+endif() -+ - target_link_libraries(decrepit_test test_support_lib boringssl_gtest decrepit - crypto) - if(WIN32) diff --git a/ports/boringssl/0002-disable-waring.patch b/ports/boringssl/0002-disable-waring.patch new file mode 100644 index 00000000000000..c037b273acf2d0 --- /dev/null +++ b/ports/boringssl/0002-disable-waring.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 83ff477..3008c2a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -117,7 +117,7 @@ endif() + if(CMAKE_COMPILER_IS_GNUCXX OR CLANG) + # Note clang-cl is odd and sets both CLANG and MSVC. We base our configuration + # primarily on our normal Clang one. +- set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla") ++ set(C_CXX_FLAGS "-Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla") + if(MSVC) + # clang-cl sets different default warnings than clang. It also treats -Wall + # as -Weverything, to match MSVC. Instead -W3 is the alias for -Wall. +@@ -238,8 +238,8 @@ elseif(MSVC) + ${MSVC_DISABLED_WARNINGS_LIST}) + string(REPLACE "C" " -w4" MSVC_LEVEL4_WARNINGS_STR + ${MSVC_LEVEL4_WARNINGS_LIST}) +- set(CMAKE_C_FLAGS "-utf-8 -Wall -WX ${MSVC_DISABLED_WARNINGS_STR} ${MSVC_LEVEL4_WARNINGS_STR}") +- set(CMAKE_CXX_FLAGS "-utf-8 -Wall -WX ${MSVC_DISABLED_WARNINGS_STR} ${MSVC_LEVEL4_WARNINGS_STR}") ++ set(CMAKE_C_FLAGS "-utf-8 -Wall ${MSVC_DISABLED_WARNINGS_STR} ${MSVC_LEVEL4_WARNINGS_STR}") ++ set(CMAKE_CXX_FLAGS "-utf-8 -Wall ${MSVC_DISABLED_WARNINGS_STR} ${MSVC_LEVEL4_WARNINGS_STR}") + endif() + + if(WIN32) diff --git a/ports/boringssl/0003-Disable-C4191-warning-to-fix-VS2022-build.patch b/ports/boringssl/0003-Disable-C4191-warning-to-fix-VS2022-build.patch deleted file mode 100644 index 06af455f72cf63..00000000000000 --- a/ports/boringssl/0003-Disable-C4191-warning-to-fix-VS2022-build.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 02b661f9d056dc4a91dc317bc8f0e92e784c7345 Mon Sep 17 00:00:00 2001 -From: Ryan Pavlik -Date: Tue, 24 May 2022 11:03:08 -0500 -Subject: [PATCH] Disable C4191 warning to fix VS2022 build. - -Works around https://bugs.chromium.org/p/boringssl/issues/detail?id=495 for now. ---- - CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 83ff477..398e97f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -229,6 +229,7 @@ elseif(MSVC) - "C5027" # move assignment operator was implicitly defined as deleted - "C5045" # Compiler will insert Spectre mitigation for memory load if - # /Qspectre switch specified -+ "C4191" # Unsafe cast (we use it as a type-erased type) - see https://bugs.chromium.org/p/boringssl/issues/detail?id=495 - ) - set(MSVC_LEVEL4_WARNINGS_LIST - # See https://connect.microsoft.com/VisualStudio/feedback/details/1217660/warning-c4265-when-using-functional-header --- -2.36.0.windows.1 - diff --git a/ports/boringssl/portfile.cmake b/ports/boringssl/portfile.cmake index 9d81a3d672da8a..f7d044d3f9cfbb 100644 --- a/ports/boringssl/portfile.cmake +++ b/ports/boringssl/portfile.cmake @@ -27,8 +27,7 @@ vcpkg_from_github( HEAD_REF master PATCHES 0001-vcpkg.patch - 0002-disable-waring-4065.patch - 0003-Disable-C4191-warning-to-fix-VS2022-build.patch + 0002-disable-waring.patch ) vcpkg_cmake_configure( From e2d4dd391e2b77ed4bdb4446b908547b2a4505af Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Tue, 31 May 2022 23:19:20 -0700 Subject: [PATCH 6/8] x-add-version --- versions/b-/boringssl.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/b-/boringssl.json b/versions/b-/boringssl.json index bababd85de6b29..0604a4f511e99b 100644 --- a/versions/b-/boringssl.json +++ b/versions/b-/boringssl.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "adcf221b8e394dcf3acc3543d9cbe33ee42ffac5", + "git-tree": "b0bbe0a8c1b0f9c0293182f3d5cc2ba19f99a745", "version-date": "2021-06-23", "port-version": 2 }, From 3c389dced29705c7d2e0c8db885ec6686761866b Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Tue, 31 May 2022 23:26:08 -0700 Subject: [PATCH 7/8] update patch's name --- .../{0002-disable-waring.patch => 0002-remove-WX-Werror.patch} | 0 ports/boringssl/portfile.cmake | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename ports/boringssl/{0002-disable-waring.patch => 0002-remove-WX-Werror.patch} (100%) diff --git a/ports/boringssl/0002-disable-waring.patch b/ports/boringssl/0002-remove-WX-Werror.patch similarity index 100% rename from ports/boringssl/0002-disable-waring.patch rename to ports/boringssl/0002-remove-WX-Werror.patch diff --git a/ports/boringssl/portfile.cmake b/ports/boringssl/portfile.cmake index f7d044d3f9cfbb..be9ed1ee86478b 100644 --- a/ports/boringssl/portfile.cmake +++ b/ports/boringssl/portfile.cmake @@ -27,7 +27,7 @@ vcpkg_from_github( HEAD_REF master PATCHES 0001-vcpkg.patch - 0002-disable-waring.patch + 0002-remove-WX-Werror.patch ) vcpkg_cmake_configure( From 2f3eff8b3aea44c8b1f31d8dd0c1439d4b45b8b3 Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Tue, 31 May 2022 23:26:33 -0700 Subject: [PATCH 8/8] x-add-version --- versions/b-/boringssl.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/b-/boringssl.json b/versions/b-/boringssl.json index 0604a4f511e99b..4f560eae8d2719 100644 --- a/versions/b-/boringssl.json +++ b/versions/b-/boringssl.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "b0bbe0a8c1b0f9c0293182f3d5cc2ba19f99a745", + "git-tree": "8d28c72d322cf2245e69075deef73c5edefee0b5", "version-date": "2021-06-23", "port-version": 2 },