From 78030b65d91f5f27ede49967e8516d0eb2949b8d Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 30 Dec 2024 20:21:27 +0100 Subject: [PATCH] [msh3,msquic,vcpkg-ci-msh3] Update, add test port (#42788) --- ports/msh3/dependencies_fix.patch | 76 +++++++++++++----- ports/msh3/portfile.cmake | 10 +-- ports/msh3/vcpkg.json | 5 +- ports/msh3/width-exceeds-type.diff | 32 ++++++++ ports/msquic/all_headers.patch | 13 ---- ports/msquic/exports-for-msh3.diff | 56 ++++++++++++++ ports/msquic/fix-install.patch | 44 ++++------- ports/msquic/portfile.cmake | 77 ++++++++++++++----- ports/msquic/uwp-link-libs.diff | 47 +++++++++++ ports/msquic/vcpkg.json | 5 +- .../test_ports/vcpkg-ci-msh3/portfile.cmake | 10 +++ .../vcpkg-ci-msh3/project/CMakeLists.txt | 22 ++++++ .../test_ports/vcpkg-ci-msh3/project/main.c | 8 ++ scripts/test_ports/vcpkg-ci-msh3/vcpkg.json | 12 +++ versions/baseline.json | 8 +- versions/m-/msh3.json | 5 ++ versions/m-/msquic.json | 5 ++ 17 files changed, 337 insertions(+), 98 deletions(-) create mode 100644 ports/msh3/width-exceeds-type.diff delete mode 100644 ports/msquic/all_headers.patch create mode 100644 ports/msquic/exports-for-msh3.diff create mode 100644 ports/msquic/uwp-link-libs.diff create mode 100644 scripts/test_ports/vcpkg-ci-msh3/portfile.cmake create mode 100644 scripts/test_ports/vcpkg-ci-msh3/project/CMakeLists.txt create mode 100644 scripts/test_ports/vcpkg-ci-msh3/project/main.c create mode 100644 scripts/test_ports/vcpkg-ci-msh3/vcpkg.json diff --git a/ports/msh3/dependencies_fix.patch b/ports/msh3/dependencies_fix.patch index db8eb244b8b051..4cde5fad7bcb54 100644 --- a/ports/msh3/dependencies_fix.patch +++ b/ports/msh3/dependencies_fix.patch @@ -1,45 +1,56 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4bd7155..b7adecc 100644 +index d8a81ab..edf5651 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -72,7 +72,7 @@ target_include_directories(msh3_headers INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +@@ -28,9 +28,6 @@ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + if (WIN32) +- # Statically link the OS included part of the runtime. +- set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +- set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib") + set(QUIC_COMMON_DEFINES WIN32_LEAN_AND_MEAN SECURITY_WIN32) + # TODO - Get these to work on Linux + list(APPEND MSH3_COMMON_DEFINES VER_BUILD_ID=${MSH3_VER_BUILD_ID}) +@@ -66,7 +63,8 @@ target_include_directories(msh3_headers INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) option(LSQPACK_TESTS "Build tests" OFF) option(LSQPACK_BIN "Build binaries" OFF) -add_subdirectory(ls-qpack) +find_package(ls-qpack CONFIG REQUIRED) ++add_library(ls-qpack ALIAS ls-qpack::ls-qpack) # Configure and build msquic dependency. if (WIN32) -@@ -83,8 +83,9 @@ endif() +@@ -76,9 +74,11 @@ else() + endif() set(QUIC_BUILD_SHARED ON CACHE BOOL "Builds MsQuic as a dynamic library") set(QUIC_ENABLE_LOGGING ON CACHE BOOL "Enable MsQuic logging") - set(CMAKE_BUILD_TYPE "Release") +-set(CMAKE_BUILD_TYPE "Release") -add_subdirectory(msquic) -target_compile_features(inc INTERFACE cxx_std_20) +find_package(msquic CONFIG REQUIRED) -+ -+target_compile_features(msh3_headers INTERFACE cxx_std_20) ++# polyfill ++add_library(inc ALIAS msquic) ++add_library(platform ALIAS msquic) ++add_library(warnings ALIAS msquic) # Build msh3 library (and cmd line tool). add_subdirectory(lib) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt -index ab7fc24..c488486 100644 +index 4d7aeb7..6da8e1a 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt -@@ -7,10 +7,7 @@ else() +@@ -7,6 +7,8 @@ else() set(SOURCES msh3.cpp) endif() add_library(msh3 SHARED ${SOURCES}) --target_link_libraries(msh3 PRIVATE inc warnings msquic ls-qpack msh3_headers) --if (NOT BUILD_SHARED_LIBS) -- target_link_libraries(msh3 PRIVATE base_link) --endif() -+target_link_libraries(msh3 PRIVATE msquic ls-qpack::ls-qpack msh3_headers) - if (MSH3_SERVER_SUPPORT) - target_link_libraries(msh3 PRIVATE platform) # For selfsign APIs - endif() -@@ -26,7 +23,11 @@ elseif (CX_PLATFORM STREQUAL "darwin") ++target_compile_features(msh3 PRIVATE cxx_std_20) ++target_include_directories(msh3 PUBLIC $) + target_link_libraries(msh3 PRIVATE inc warnings msquic ls-qpack msh3_headers) + if (NOT BUILD_SHARED_LIBS) + target_link_libraries(msh3 PRIVATE base_link) +@@ -24,12 +26,16 @@ elseif (CX_PLATFORM STREQUAL "darwin") PROPERTIES LINK_FLAGS "-exported_symbols_list \"${CMAKE_CURRENT_SOURCE_DIR}/darwin/exports.txt\"") endif() @@ -50,10 +61,35 @@ index ab7fc24..c488486 100644 + LIBRARY DESTINATION lib +) install(FILES ../msh3.h DESTINATION include) - configure_file(msh3-config.cmake.in ${CMAKE_BINARY_DIR}/msh3-config.cmake) +-configure_file(msh3-config.cmake.in ${CMAKE_BINARY_DIR}/msh3-config.cmake) ++configure_file(msh3-config.cmake.in ${CMAKE_BINARY_DIR}/msh3-config.cmake @ONLY) install(FILES ${CMAKE_BINARY_DIR}/msh3-config.cmake DESTINATION share/msh3) + install(EXPORT msh3 DESTINATION share/msh3) +-configure_file(libmsh3.pc.in ${CMAKE_BINARY_DIR}/libmsh3.pc) +-if(NOT WIN32) ++configure_file(libmsh3.pc.in ${CMAKE_BINARY_DIR}/libmsh3.pc @ONLY) ++if(1) + install(FILES ${CMAKE_BINARY_DIR}/libmsh3.pc DESTINATION lib/pkgconfig) + endif() +diff --git a/lib/libmsh3.pc.in b/lib/libmsh3.pc.in +index f156204..aad76ab 100644 +--- a/lib/libmsh3.pc.in ++++ b/lib/libmsh3.pc.in +@@ -4,10 +4,10 @@ + prefix=/usr/local + exec_prefix=${prefix} + libdir=${exec_prefix}/lib +-includedir=${exec_prefix}/include ++includedir=${prefix}/include + + Name: libmsh3 + Description: Minimal HTTP/3 client on top of MsQuic + Version: 0.1.0 + Libs: -L${libdir} -lmsh3 +-Cflags: -I${includedir}/libmsh3 ++Cflags: -I${includedir} diff --git a/lib/msh3-config.cmake.in b/lib/msh3-config.cmake.in -index b4a54bf..a6a0fd2 100644 +index b4a54bf..540d56d 100644 --- a/lib/msh3-config.cmake.in +++ b/lib/msh3-config.cmake.in @@ -1,4 +1,4 @@ @@ -61,4 +97,4 @@ index b4a54bf..a6a0fd2 100644 @FILENAME_DEP_REPLACE@ -include(${SELF_DIR}/msh3.cmake) -+include(${CMAKE_INSTALL_PREFIX}/share/msh3/msh3.cmake) ++include("${CMAKE_CURRENT_LIST_DIR}/msh3.cmake") diff --git a/ports/msh3/portfile.cmake b/ports/msh3/portfile.cmake index 80a4323e28596a..2696a98861bb86 100644 --- a/ports/msh3/portfile.cmake +++ b/ports/msh3/portfile.cmake @@ -1,20 +1,18 @@ -set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled) +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO nibanks/msh3 REF v${VERSION} - SHA512 e6ba4e8f4ce5cd3f586d61739148bf75dfddbe70f399b2e498e7d416c8d730a5f8c2c38f0eabe687049bb7525df44f5f511515ec578bc3832989f73961cdda72 + SHA512 dedd8be43e44b4bebbf601d76b1f3b0135501330ed128ca710de942ef7d9142a21f1c1eb9efecf57881e72d93d68c7c2c085bc35d402eac5eabc57e77773be6b HEAD_REF main PATCHES dependencies_fix.patch + width-exceeds-type.diff ) -vcpkg_find_acquire_program(PKGCONFIG) - vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" - OPTIONS - "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" ) vcpkg_cmake_install() diff --git a/ports/msh3/vcpkg.json b/ports/msh3/vcpkg.json index ee931458263acc..8e5dccd0150282 100644 --- a/ports/msh3/vcpkg.json +++ b/ports/msh3/vcpkg.json @@ -1,11 +1,10 @@ { "name": "msh3", - "version": "0.6.0", - "port-version": 1, + "version": "0.7.0", "description": "Minimal HTTP/3 library", "homepage": "https://github.com/nibanks/msh3", "license": "MIT", - "supports": "!uwp", + "supports": "!(static & staticcrt)", "dependencies": [ "ls-qpack", "msquic", diff --git a/ports/msh3/width-exceeds-type.diff b/ports/msh3/width-exceeds-type.diff new file mode 100644 index 00000000000000..fabd7900c4c5fd --- /dev/null +++ b/ports/msh3/width-exceeds-type.diff @@ -0,0 +1,32 @@ +diff --git a/msh3.h b/msh3.h +index ebbdc20..c31b1b9 100644 +--- a/msh3.h ++++ b/msh3.h +@@ -374,7 +374,11 @@ typedef struct MSH3_REQUEST_EVENT { + bool AppCloseInProgress : 1; + bool ConnectionShutdownByApp : 1; + bool ConnectionClosedRemotely : 1; +- bool RESERVED : 5; ++ bool RESERVED : 1; ++ bool RESERVED_2 : 1; ++ bool RESERVED_3 : 1; ++ bool RESERVED_4 : 1; ++ bool RESERVED_5 : 1; + uint64_t ConnectionErrorCode; + MSH3_STATUS ConnectionCloseStatus; + } SHUTDOWN_COMPLETE; +@@ -487,7 +491,13 @@ typedef struct MSH3_LISTENER_EVENT { + union { + struct { + bool AppCloseInProgress : 1; +- bool RESERVED : 7; ++ bool RESERVED : 1; ++ bool RESERVED_2 : 1; ++ bool RESERVED_3 : 1; ++ bool RESERVED_4 : 1; ++ bool RESERVED_5 : 1; ++ bool RESERVED_6 : 1; ++ bool RESERVED_7 : 1; + } SHUTDOWN_COMPLETE; + struct { + MSH3_CONNECTION* Connection; diff --git a/ports/msquic/all_headers.patch b/ports/msquic/all_headers.patch deleted file mode 100644 index fb231040899ae6..00000000000000 --- a/ports/msquic/all_headers.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt -index d0592a320..07df9daf7 100644 ---- a/src/bin/CMakeLists.txt -+++ b/src/bin/CMakeLists.txt -@@ -269,6 +269,8 @@ set(PUBLIC_HEADERS - ../inc/msquic_posix.h - ../inc/quic_sal_stub.h) - -+file(GLOB PUBLIC_HEADERS "../inc/*.h" "../inc/*.hpp") -+ - install(TARGETS msquic EXPORT msquic - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib diff --git a/ports/msquic/exports-for-msh3.diff b/ports/msquic/exports-for-msh3.diff new file mode 100644 index 00000000000000..2daf4bc08663cf --- /dev/null +++ b/ports/msquic/exports-for-msh3.diff @@ -0,0 +1,56 @@ +diff --git a/src/bin/darwin/exports.txt b/src/bin/darwin/exports.txt +index e90b06e..c221d2c 100644 +--- a/src/bin/darwin/exports.txt ++++ b/src/bin/darwin/exports.txt +@@ -1,2 +1,6 @@ + _MsQuicOpenVersion + _MsQuicClose ++_CxPlatGetSelfSignedCert ++_CxPlatFreeSelfSignedCert ++_CxPlatLogAssert ++_quic_bugcheck +diff --git a/src/bin/linux/exports.txt b/src/bin/linux/exports.txt +index e11806a..424c443 100644 +--- a/src/bin/linux/exports.txt ++++ b/src/bin/linux/exports.txt +@@ -1,5 +1,9 @@ + msquic + { + global: MsQuicOpenVersion; MsQuicClose; ++ CxPlatGetSelfSignedCert; ++ CxPlatFreeSelfSignedCert; ++ CxPlatLogAssert; ++ quic_bugcheck; + local: *; + }; +diff --git a/src/bin/linux/init.c b/src/bin/linux/init.c +index 29bfa14..61bbc48 100644 +--- a/src/bin/linux/init.c ++++ b/src/bin/linux/init.c +@@ -9,8 +9,15 @@ Abstract: + + --*/ + ++#define QUIC_TEST_APIS 1 + #include "quic_platform.h" + ++void MsQuickChainLoadPlatformSymbolsNoOp() ++{ ++ QUIC_CREDENTIAL_CONFIG* SelfSignedCertParams = (QUIC_CREDENTIAL_CONFIG*)CxPlatGetSelfSignedCert(CXPLAT_SELF_SIGN_CERT_USER, FALSE, NULL); ++ CxPlatFreeSelfSignedCert(SelfSignedCertParams); ++} ++ + void + MsQuicLibraryLoad( + void +diff --git a/src/bin/winuser/msquic.def.in b/src/bin/winuser/msquic.def.in +index afaed5d..fa7d19a 100644 +--- a/src/bin/winuser/msquic.def.in ++++ b/src/bin/winuser/msquic.def.in +@@ -3,3 +3,6 @@ LIBRARY @QUIC_LIBRARY_NAME@ + EXPORTS + MsQuicOpenVersion + MsQuicClose ++ CxPlatGetSelfSignedCert ++ CxPlatFreeSelfSignedCert ++ CxPlatLogAssert diff --git a/ports/msquic/fix-install.patch b/ports/msquic/fix-install.patch index 5b462577402073..9ffb36f53223d6 100644 --- a/ports/msquic/fix-install.patch +++ b/ports/msquic/fix-install.patch @@ -1,38 +1,24 @@ diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt -index 2376823..d0592a3 100644 +index 18048e3..4fcd161 100644 --- a/src/bin/CMakeLists.txt +++ b/src/bin/CMakeLists.txt -@@ -253,14 +253,14 @@ endif() +@@ -11,6 +11,7 @@ endif() + if(BUILD_SHARED_LIBS) - target_include_directories(msquic PUBLIC - $ -- $) -+ $) - else() - target_include_directories(msquic_static INTERFACE - $ -- $) -+ $) - target_include_directories(msquic INTERFACE - $ -- $) -+ $) + add_library(msquic SHARED ${SOURCES}) ++ target_include_directories(msquic PUBLIC $) + target_link_libraries(msquic PRIVATE core msquic_platform inc warnings logging base_link main_binary_link_args) + set_target_properties(msquic PROPERTIES OUTPUT_NAME ${QUIC_LIBRARY_NAME}) + if (NOT WIN32) +@@ -261,7 +262,10 @@ if(WIN32) endif() - set(PUBLIC_HEADERS -@@ -269,11 +269,10 @@ set(PUBLIC_HEADERS - ../inc/msquic_posix.h - ../inc/quic_sal_stub.h) - --if(BUILD_SHARED_LIBS) -- install(TARGETS msquic EXPORT msquic DESTINATION lib) --else() -- install(FILES ${QUIC_STATIC_LIBRARY} DESTINATION lib) --endif() -+install(TARGETS msquic EXPORT msquic + if(BUILD_SHARED_LIBS) +- install(TARGETS msquic msquic_platform inc logging_inc warnings main_binary_link_args ${OTHER_TARGETS} EXPORT msquic DESTINATION lib) ++ install(TARGETS msquic EXPORT msquic + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) - install(FILES ${PUBLIC_HEADERS} DESTINATION include) - - configure_file(msquic-config.cmake.in ${CMAKE_BINARY_DIR}/msquic-config.cmake) + else() + install(FILES ${QUIC_STATIC_LIBRARY} DESTINATION lib) + endif() diff --git a/ports/msquic/portfile.cmake b/ports/msquic/portfile.cmake index c356c2f537ffa3..a7525f14e2eb19 100644 --- a/ports/msquic/portfile.cmake +++ b/ports/msquic/portfile.cmake @@ -1,22 +1,22 @@ +# Upstream supports static linkage, but the port doesn't: +# - There is a vendored fork of OpenSSL, needed for QUIC. +# - Exported config needs fixes. vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH QUIC_SOURCE_PATH REPO microsoft/msquic REF "v${VERSION}" - SHA512 51afee7e28a7d6ae1b5491edd635e0c88a92a00bacedeaac632a0f19762e9940c9b819a9d33072d3553c004acd4ec0cdf645301f712b408498053de065b2b1cf + SHA512 c6e4b5f5d9b7e92469a6733a99eaf677909a5b2287869f0bbcc61fbcda6db4a6e920b327ede43fc9b1b0a3d09518c568dc1f38ad5fbb3ace14c1c031012b9968 HEAD_REF master PATCHES fix-install.patch # Adjust install path of build outputs fix-uwp-crt.patch # https://github.com/microsoft/msquic/pull/4373 fix-comparing-system-processor-with-win32.patch # https://github.com/microsoft/msquic/pull/4374 - all_headers.patch + uwp-link-libs.diff + exports-for-msh3.diff ) -# This avoids a link error on x86-windows: -# LINK : fatal error LNK1268: inconsistent option 'NODEFAULTLIB:libucrt.lib' specified with /USEPROFILE but not with /GENPROFILE -file(REMOVE "${QUIC_SOURCE_PATH}/src/bin/winuser/pgo_x86/msquic.pgd") - vcpkg_from_github( OUT_SOURCE_PATH OPENSSL_SOURCE_PATH REPO quictls/openssl @@ -24,9 +24,10 @@ vcpkg_from_github( SHA512 230f48a4ef20bfd492b512bd53816a7129d70849afc1426e9ce813273c01884d5474552ecaede05231ca354403f25e2325c972c9c7950ae66dae310800bd19e7 HEAD_REF openssl-3.1.7+quic ) - -file(REMOVE_RECURSE "${QUIC_SOURCE_PATH}/submodules/openssl3") -file(RENAME "${OPENSSL_SOURCE_PATH}" "${QUIC_SOURCE_PATH}/submodules/openssl3") +if(NOT EXISTS "${QUIC_SOURCE_PATH}/submodules/openssl3/Configure") + file(REMOVE_RECURSE "${QUIC_SOURCE_PATH}/submodules/openssl3") + file(RENAME "${OPENSSL_SOURCE_PATH}" "${QUIC_SOURCE_PATH}/submodules/openssl3") +endif() vcpkg_from_github( OUT_SOURCE_PATH XDP_WINDOWS @@ -35,26 +36,33 @@ vcpkg_from_github( SHA512 1b26487fa79c8796d4b0d5e09f4fc9acb003d8e079189ec57a36ff03c9c2620829106fdbc4780e298872826f3a97f034d40e04d00a77ded97122874d13bfb145 HEAD_REF main ) - -file(REMOVE_RECURSE "${QUIC_SOURCE_PATH}/submodules/xdp-for-windows") -file(RENAME "${XDP_WINDOWS}" "${QUIC_SOURCE_PATH}/submodules/xdp-for-windows") +if(NOT EXISTS "${QUIC_SOURCE_PATH}/submodules/xdp-for-windows/published/external") + # headers only + file(REMOVE_RECURSE "${QUIC_SOURCE_PATH}/submodules/xdp-for-windows") + file(COPY "${XDP_WINDOWS}/published/external" DESTINATION "${QUIC_SOURCE_PATH}/submodules/xdp-for-windows/published") +endif() vcpkg_find_acquire_program(PERL) get_filename_component(PERL_EXE_PATH "${PERL}" DIRECTORY) vcpkg_add_to_path("${PERL_EXE_PATH}") -if(NOT VCPKG_HOST_IS_WINDOWS) +if(VCPKG_HOST_IS_WINDOWS) + vcpkg_find_acquire_program(JOM) + cmake_path(GET JOM PARENT_PATH jom_dir) + vcpkg_add_to_path("${jom_dir}") +else() find_program(MAKE make) - get_filename_component(MAKE_EXE_PATH "${MAKE}" DIRECTORY) - vcpkg_add_to_path(PREPEND "${MAKE_EXE_PATH}") + cmake_path(GET MAKE PARENT_PATH make_dir) + vcpkg_add_to_path("${make_dir}") endif() if(VCPKG_TARGET_IS_WINDOWS) vcpkg_find_acquire_program(NASM) - get_filename_component(NASM_EXE_PATH "${NASM}" DIRECTORY) - vcpkg_add_to_path(PREPEND "${NASM_EXE_PATH}") + cmake_path(GET NASM PARENT_PATH nasm_dir) + vcpkg_add_to_path("${nasm_dir}") endif() +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" QUIC_BUILD_SHARED) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_CRT) vcpkg_cmake_configure( @@ -65,6 +73,7 @@ vcpkg_cmake_configure( -DQUIC_USE_SYSTEM_LIBCRYPTO=OFF -DQUIC_BUILD_PERF=OFF -DQUIC_BUILD_TEST=OFF + "-DQUIC_BUILD_SHARED=${QUIC_BUILD_SHARED}" "-DQUIC_STATIC_LINK_CRT=${STATIC_CRT}" "-DQUIC_STATIC_LINK_PARTIAL_CRT=${STATIC_CRT}" "-DQUIC_UWP_BUILD=${VCPKG_TARGET_IS_UWP}" @@ -73,7 +82,35 @@ vcpkg_cmake_configure( vcpkg_cmake_install() vcpkg_cmake_config_fixup() vcpkg_copy_pdbs() -vcpkg_install_copyright(FILE_LIST "${QUIC_SOURCE_PATH}/LICENSE") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" - "${CURRENT_PACKAGES_DIR}/debug/include" + +set(platform "") +if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS) + set(platform "CX_PLATFORM_DARWIN") +elseif(NOT VCPKG_TARGET_IS_WINDOWS) + set(platform "CX_PLATFORM_LINUX") +endif() +if(platform) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/quic_platform.h" + "#elif ${platform}" + "#elif 1 +#ifndef ${platform} +#define ${platform} +#endif") +elseif(VCPKG_TARGET_IS_UWP) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/quic_platform.h" + "#elif _WIN32" + "#elif 1 +#ifndef QUIC_UWP_BUILD +#define QUIC_UWP_BUILD +#endif +#ifndef QUIC_RESTRICTED_BUILD +#define QUIC_RESTRICTED_BUILD +#endif") +endif() + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" ) + +vcpkg_install_copyright(FILE_LIST "${QUIC_SOURCE_PATH}/LICENSE" "${QUIC_SOURCE_PATH}/THIRD-PARTY-NOTICES") diff --git a/ports/msquic/uwp-link-libs.diff b/ports/msquic/uwp-link-libs.diff new file mode 100644 index 00000000000000..3dc68923ea58cc --- /dev/null +++ b/ports/msquic/uwp-link-libs.diff @@ -0,0 +1,47 @@ +diff --git a/src/inc/CMakeLists.txt b/src/inc/CMakeLists.txt +index 48edebd..0a59ee6 100644 +--- a/src/inc/CMakeLists.txt ++++ b/src/inc/CMakeLists.txt +@@ -40,7 +40,7 @@ endif() + + if(WIN32) + if(QUIC_UWP_BUILD) +- target_link_libraries(base_link INTERFACE OneCore ws2_32 ntdll) ++ target_link_libraries(base_link INTERFACE OneCoreUap ws2_32 ntdll) + elseif(QUIC_GAMECORE_BUILD) + target_link_libraries(base_link INTERFACE ntdll advapi32) + if(NOT QUIC_EXTERNAL_TOOLCHAIN) +diff --git a/src/platform/CMakeLists.txt b/src/platform/CMakeLists.txt +index 4a573ae..6fb5887 100644 +--- a/src/platform/CMakeLists.txt ++++ b/src/platform/CMakeLists.txt +@@ -60,7 +60,9 @@ if("${CX_PLATFORM}" STREQUAL "windows") + msquic_platform + PUBLIC + wbemuuid) ++ if(NOT QUIC_UWP_BUILD) + target_link_libraries(msquic_platform PUBLIC winmm) ++ endif() + elseif(QUIC_LINUX_XDP_ENABLED) + find_library(NL_LIB nl-3) + find_library(NL_ROUTE_LIB nl-route-3) +diff --git a/submodules/CMakeLists.txt b/submodules/CMakeLists.txt +index 4bf8117..4468b19 100644 +--- a/submodules/CMakeLists.txt ++++ b/submodules/CMakeLists.txt +@@ -59,13 +59,13 @@ if (WIN32) + if (QUIC_UWP_BUILD) + # Translate target architecture into corresponding OpenSSL build flag + if (${SYSTEM_PROCESSOR} STREQUAL "arm64") +- set(QUIC_OPENSSL_WIN_ARCH "VC-WIN64-ARM") ++ set(QUIC_OPENSSL_WIN_ARCH "VC-WIN64-ARM-UWP") + elseif (${SYSTEM_PROCESSOR} STREQUAL "arm") + set(QUIC_OPENSSL_WIN_ARCH "VC-WIN32-ARM") + elseif (${SYSTEM_PROCESSOR} STREQUAL "x86") + set(QUIC_OPENSSL_WIN_ARCH "VC-WIN32-ONECORE") + elseif (${SYSTEM_PROCESSOR} STREQUAL "x64" OR ${SYSTEM_PROCESSOR} STREQUAL "amd64") +- set(QUIC_OPENSSL_WIN_ARCH "VC-WIN64A-ONECORE") ++ set(QUIC_OPENSSL_WIN_ARCH "VC-WIN64A-UWP") + else() + message(FATAL_ERROR "Unknown Generator Platform ${SYSTEM_PROCESSOR}") + endif() diff --git a/ports/msquic/vcpkg.json b/ports/msquic/vcpkg.json index 999620c8a1806f..e9f3e4dc7419a3 100644 --- a/ports/msquic/vcpkg.json +++ b/ports/msquic/vcpkg.json @@ -1,11 +1,10 @@ { "name": "msquic", - "version": "2.4.5", - "port-version": 1, + "version": "2.4.7", "description": "Cross-platform, C implementation of the IETF QUIC protocol", "homepage": "https://github.com/microsoft/msquic", "license": "MIT", - "supports": "!((static & staticcrt) | uwp)", + "supports": "!mingw & !(static & staticcrt)", "dependencies": [ { "name": "vcpkg-cmake", diff --git a/scripts/test_ports/vcpkg-ci-msh3/portfile.cmake b/scripts/test_ports/vcpkg-ci-msh3/portfile.cmake new file mode 100644 index 00000000000000..dd2570612035c8 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-msh3/portfile.cmake @@ -0,0 +1,10 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_find_acquire_program(PKGCONFIG) + +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_PORT_DIR}/project" + OPTIONS + "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" +) +vcpkg_cmake_build() diff --git a/scripts/test_ports/vcpkg-ci-msh3/project/CMakeLists.txt b/scripts/test_ports/vcpkg-ci-msh3/project/CMakeLists.txt new file mode 100644 index 00000000000000..1455618b347637 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-msh3/project/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.10) +project(msh3-test C) + +block() + set(CMAKE_DISABLE_FIND_PACKAGE_PkgConfig 1) + + find_package(msh3 CONFIG REQUIRED) + if(NOT TARGET msh3) + message(SEND_ERROR "No target 'msh3'") + endif() + + add_executable(msh3_cmake main.c) + target_link_libraries(msh3_cmake msh3) +endblock() + +block() + find_package(PkgConfig REQUIRED) + pkg_check_modules(libmsh3 IMPORTED_TARGET REQUIRED libmsh3) + + add_executable(msh3_pkgconfig main.c) + target_link_libraries(msh3_pkgconfig PkgConfig::libmsh3) +endblock() diff --git a/scripts/test_ports/vcpkg-ci-msh3/project/main.c b/scripts/test_ports/vcpkg-ci-msh3/project/main.c new file mode 100644 index 00000000000000..e55b40d053a5ae --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-msh3/project/main.c @@ -0,0 +1,8 @@ +#include + +int main() +{ + MSH3_API* api = MsH3ApiOpen(); + if (api) + MsH3ApiClose(api); +} diff --git a/scripts/test_ports/vcpkg-ci-msh3/vcpkg.json b/scripts/test_ports/vcpkg-ci-msh3/vcpkg.json new file mode 100644 index 00000000000000..b3058cfff71c55 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-msh3/vcpkg.json @@ -0,0 +1,12 @@ +{ + "name": "vcpkg-ci-msh3", + "version-string": "ci", + "description": "Validates msh3", + "dependencies": [ + "msh3", + { + "name": "vcpkg-cmake", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 3da5c1c3b768fe..22fef4f9628afc 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6165,8 +6165,8 @@ "port-version": 4 }, "msh3": { - "baseline": "0.6.0", - "port-version": 1 + "baseline": "0.7.0", + "port-version": 0 }, "msinttypes": { "baseline": "2018-02-25", @@ -6181,8 +6181,8 @@ "port-version": 4 }, "msquic": { - "baseline": "2.4.5", - "port-version": 1 + "baseline": "2.4.7", + "port-version": 0 }, "mstch": { "baseline": "1.0.2", diff --git a/versions/m-/msh3.json b/versions/m-/msh3.json index 0516d453196926..77377bd19405ac 100644 --- a/versions/m-/msh3.json +++ b/versions/m-/msh3.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "32112fdb5245ab8574dd65f981fa79ee6e6ed5d7", + "version": "0.7.0", + "port-version": 0 + }, { "git-tree": "6c26630aa357e123fe98a2dd4359b52681333a81", "version": "0.6.0", diff --git a/versions/m-/msquic.json b/versions/m-/msquic.json index ef95549f4c9594..b24d0ef0f7256f 100644 --- a/versions/m-/msquic.json +++ b/versions/m-/msquic.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "04855f9144f78f05b623916dc4d7310fdf8b5d29", + "version": "2.4.7", + "port-version": 0 + }, { "git-tree": "7e20d48f6fdc1052f7339eeff9ea9ab1074a726c", "version": "2.4.5",