Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fbthrift, fizz, folly, mvfst] Fix dependency resolution. #23124

Merged
merged 8 commits into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions ports/fbthrift/add-missing-algorithm-include.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From f2151fa730058a1baf23ed3dc082c91df6351da1 Mon Sep 17 00:00:00 2001
From: "Zeyi (Rice) Fan" <[email protected]>
Date: Fri, 4 Feb 2022 15:17:53 -0800
Subject: [PATCH] fix build failure on Windows

Summary: Fix a build error on Windows where `std::mismatch` is not found.

Reviewed By: xavierd

Differential Revision: D34012963

fbshipit-source-id: 9f5aa21d03a92fdadf5bc83943a159a2f7872144
---
thrift/compiler/generate/build_templates.cc | 1 +
1 file changed, 1 insertion(+)

diff --git a/thrift/compiler/generate/build_templates.cc b/thrift/compiler/generate/build_templates.cc
index 56f13e8dde8..acd9dd30a75 100644
--- a/thrift/compiler/generate/build_templates.cc
+++ b/thrift/compiler/generate/build_templates.cc
@@ -14,6 +14,7 @@
* limitations under the License.
*/

+#include <algorithm>
#include <fstream>
#include <iostream>
#include <iterator>
8 changes: 5 additions & 3 deletions ports/fbthrift/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ vcpkg_from_github(
REF v2022.01.31.00
SHA512 159457398fdc0c89c34364b8a89068127c3519ce35af349776016e0ae37ae9508689853e0e371c2065fd715451f466e37c7e3799e054eca02cbc4717809150ab
HEAD_REF master
PATCHES
add-missing-algorithm-include.patch # https://github.com/facebook/fbthrift/commit/f2151fa730058a1baf23ed3dc082c91df6351da1
)

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBISON_EXECUTABLE=${BISON}
-DFLEX_EXECUTABLE=${FLEX}
"-DBISON_EXECUTABLE=${BISON}"
"-DFLEX_EXECUTABLE=${FLEX}"
)

vcpkg_cmake_install()
Expand Down
3 changes: 2 additions & 1 deletion ports/fbthrift/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "fbthrift",
"version-string": "2022.01.31.00",
"port-version": 1,
"description": "Facebook's branch of Apache Thrift, including a new C++ server.",
"homepage": "https://github.com/facebook/fbthrift",
"supports": "x64",
"supports": "x64 & static",
"dependencies": [
"boost-context",
"boost-filesystem",
Expand Down
30 changes: 30 additions & 0 deletions ports/fizz/0002-fix-libevent.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/fizz/CMakeLists.txt b/fizz/CMakeLists.txt
index 80c5051..9f2e3e6 100644
--- a/fizz/CMakeLists.txt
+++ b/fizz/CMakeLists.txt
@@ -92,10 +92,10 @@ endif()

find_package(ZLIB REQUIRED)

-find_package(Libevent CONFIG QUIET)
-if(TARGET event)
+find_package(Libevent CONFIG REQUIRED)
+if(TARGET libevent::core)
message(STATUS "Found libevent from package config")
- list(APPEND FIZZ_SHINY_DEPENDENCIES event)
+ list(APPEND FIZZ_SHINY_DEPENDENCIES libevent::core)
else()
find_package(Libevent MODULE REQUIRED)
list(APPEND FIZZ_LINK_LIBRARIES ${LIBEVENT_LIB})
diff --git a/fizz/cmake/fizz-config.cmake.in b/fizz/cmake/fizz-config.cmake.in
index b28750f..282c42d 100644
--- a/fizz/cmake/fizz-config.cmake.in
+++ b/fizz/cmake/fizz-config.cmake.in
@@ -29,6 +29,7 @@ include(CMakeFindDependencyMacro)
find_dependency(unofficial-sodium CONFIG REQUIRED)
find_dependency(folly CONFIG)
find_dependency(ZLIB)
+find_dependency(Libevent CONFIG)

if (NOT fizz_FIND_QUIETLY)
message(STATUS "Found fizz: ${PACKAGE_PREFIX_DIR}")
3 changes: 3 additions & 0 deletions ports/fizz/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
0001-fix-libsodium.patch
0002-fix-libevent.patch
)

# Prefer installed config files
file(REMOVE
${SOURCE_PATH}/fizz/cmake/FindGMock.cmake
${SOURCE_PATH}/fizz/cmake/FindGflags.cmake
${SOURCE_PATH}/fizz/cmake/FindGlog.cmake
${SOURCE_PATH}/fizz/cmake/FindLibevent.cmake
)

vcpkg_cmake_configure(
Expand Down
3 changes: 3 additions & 0 deletions ports/fizz/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "fizz",
"version-string": "2022.01.31.00",
"port-version": 1,
"description": "a TLS 1.3 implementation by Facebook",
"homepage": "https://github.com/facebookincubator/fizz",
"dependencies": [
"double-conversion",
"fmt",
"folly",
"libevent",
"libsodium",
"openssl",
{
Expand Down
6 changes: 3 additions & 3 deletions ports/folly/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ vcpkg_cmake_config_fixup()
# We substitute with generator expressions so that the right libraries are linked for debug and release.
set(FOLLY_TARGETS_CMAKE "${CURRENT_PACKAGES_DIR}/share/folly/folly-targets.cmake")
FILE(READ ${FOLLY_TARGETS_CMAKE} _contents)
string(REPLACE "\${_IMPORT_PREFIX}/lib/zlib.lib" "ZLIB::ZLIB" _contents "${_contents}")
STRING(REPLACE "\${_IMPORT_PREFIX}/lib/" "\${_IMPORT_PREFIX}/\$<\$<CONFIG:DEBUG>:debug/>lib/" _contents "${_contents}")
STRING(REPLACE "\${_IMPORT_PREFIX}/debug/lib/" "\${_IMPORT_PREFIX}/\$<\$<CONFIG:DEBUG>:debug/>lib/" _contents "${_contents}")
string(REPLACE "\${VCPKG_IMPORT_PREFIX}/lib/zlib.lib" "ZLIB::ZLIB" _contents "${_contents}")
STRING(REPLACE "\${VCPKG_IMPORT_PREFIX}/lib/" "\${VCPKG_IMPORT_PREFIX}/\$<\$<CONFIG:DEBUG>:debug/>lib/" _contents "${_contents}")
STRING(REPLACE "\${VCPKG_IMPORT_PREFIX}/debug/lib/" "\${VCPKG_IMPORT_PREFIX}/\$<\$<CONFIG:DEBUG>:debug/>lib/" _contents "${_contents}")
string(REPLACE "-vc140-mt.lib" "-vc140-mt\$<\$<CONFIG:DEBUG>:-gd>.lib" _contents "${_contents}")
FILE(WRITE ${FOLLY_TARGETS_CMAKE} "${_contents}")
FILE(READ "${CURRENT_PACKAGES_DIR}/share/folly/folly-config.cmake" _contents)
Expand Down
1 change: 1 addition & 0 deletions ports/folly/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "folly",
"version-string": "2022.01.31.00",
"port-version": 1,
"description": "An open-source C++ library developed and used at Facebook. The library is UNSTABLE on Windows",
"homepage": "https://github.com/facebook/folly",
"license": "Apache-2.0",
Expand Down
8 changes: 8 additions & 0 deletions ports/mvfst/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ vcpkg_cmake_configure(
-DBUILD_EXAMPLES=OFF
)

# Prefer installed config files
file(REMOVE
${SOURCE_PATH}/fizz/cmake/FindGMock.cmake
${SOURCE_PATH}/fizz/cmake/FindGflags.cmake
${SOURCE_PATH}/fizz/cmake/FindGlog.cmake
${SOURCE_PATH}/fizz/cmake/FindLibevent.cmake
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/mvfst)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
Expand Down
1 change: 1 addition & 0 deletions ports/mvfst/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "mvfst",
"version": "0.2",
"port-version": 1,
"description": "mvfst (Pronounced move fast) is a client and server implementation of IETF QUIC protocol in C++ by Facebook.",
"homepage": "https://github.com/facebookincubator/mvfst",
"supports": "!windows",
Expand Down
6 changes: 0 additions & 6 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1432,12 +1432,6 @@ usbmuxd:x64-windows-static-md=fail
workflow:x64-uwp=fail
workflow:arm-uwp=fail

# wangle triggers an internal compiler error
# https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/1269468
wangle:x64-windows=fail
wangle:x64-windows-static=fail
wangle:x64-windows-static-md=fail

# VS2019 version 16.9.4's project system changes where PDBs are placed in a way that breaks the
# upstream build script of this port.
# See https://developercommunity.visualstudio.com/t/Toolset-169-regression-vcxproj-producin/1356639
Expand Down
8 changes: 4 additions & 4 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2138,7 +2138,7 @@
},
"fbthrift": {
"baseline": "2022.01.31.00",
"port-version": 0
"port-version": 1
},
"fcl": {
"baseline": "0.7.0",
Expand Down Expand Up @@ -2174,7 +2174,7 @@
},
"fizz": {
"baseline": "2022.01.31.00",
"port-version": 0
"port-version": 1
},
"flann": {
"baseline": "2019-04-07",
Expand Down Expand Up @@ -2230,7 +2230,7 @@
},
"folly": {
"baseline": "2022.01.31.00",
"port-version": 0
"port-version": 1
},
"font-chef": {
"baseline": "1.1.0",
Expand Down Expand Up @@ -4634,7 +4634,7 @@
},
"mvfst": {
"baseline": "0.2",
"port-version": 0
"port-version": 1
},
"mygui": {
"baseline": "3.4.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/fbthrift.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "bf1148604c897c7727621feb13713eac7e782497",
"version-string": "2022.01.31.00",
"port-version": 1
},
{
"git-tree": "f92f736e3c525d5ac52b546eae1e0b9cf880b382",
"version-string": "2022.01.31.00",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/fizz.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "57fdd6342f89ccc3569b1a3416be67cd8dd7b59d",
"version-string": "2022.01.31.00",
"port-version": 1
},
{
"git-tree": "14651559e385107d92830b5464007f7b49a1ce4c",
"version-string": "2022.01.31.00",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/folly.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "10d3306d94114d0916a4691c131e233c08dc9090",
"version-string": "2022.01.31.00",
"port-version": 1
},
{
"git-tree": "b6f74d739ff2aef400ac83919bd9753eb1cc647f",
"version-string": "2022.01.31.00",
Expand Down
5 changes: 5 additions & 0 deletions versions/m-/mvfst.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "042a5236f46c787daf8334a8ca9c0cd3f71ab1b4",
"version": "0.2",
"port-version": 1
},
{
"git-tree": "72ff9157858363c60db8f1e0bd8de03546f7d0e4",
"version": "0.2",
Expand Down