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

[vcpkg-ci-msh3] New test port #42788

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
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
44 changes: 44 additions & 0 deletions ports/ls-qpack/cmake-config.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 86510b3..acca8be 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,10 +36,9 @@ if(LSQPACK_XXH)
target_sources(ls-qpack PRIVATE deps/xxhash/xxhash.c)
set(LSQPACK_DEPENDS "")
else()
- find_package(PkgConfig REQUIRED)
- pkg_check_modules(XXH REQUIRED IMPORTED_TARGET libxxhash)
- target_link_libraries(ls-qpack PUBLIC PkgConfig::XXH)
- set(LSQPACK_DEPENDS "libxxhash")
+ find_package(xxHash CONFIG REQUIRED)
+ target_link_libraries(ls-qpack PRIVATE xxHash::xxhash)
+ set(LSQPACK_DEPENDS "libxxhash")
endif()

if(WIN32)
@@ -125,10 +124,14 @@ endif()
include(GNUInstallDirs)
configure_file(lsqpack.pc.in lsqpack.pc @ONLY)

+configure_file(ls-qpack-config.cmake.in ls-qpack-config.cmake @ONLY)
install(TARGETS ls-qpack EXPORT ls-qpack-config
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ls-qpack-config.cmake"
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ls-qpack)
install(
EXPORT ls-qpack-config
+ FILE ls-qpack-targets.cmake
NAMESPACE ls-qpack::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ls-qpack
)
diff --git a/ls-qpack-config.cmake.in b/ls-qpack-config.cmake.in
new file mode 100644
index 0000000..533e076
--- /dev/null
+++ b/ls-qpack-config.cmake.in
@@ -0,0 +1,5 @@
+if(NOT "@BUILD_SHARED_LIBS@" AND NOT "@LSQPACK_XXH@")
+ include(CMakeFindDependencyMacro)
+ find_dependency(xxHash CONFIG)
+endif()
+include("${CMAKE_CURRENT_LIST_DIR}/ls-qpack-targets.cmake")
21 changes: 21 additions & 0 deletions ports/ls-qpack/emscripten.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bcb58e3..320144b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,7 +41,7 @@ else()
set(LSQPACK_DEPENDS "libxxhash")
endif()

-if(WIN32)
+if(WIN32 OR EMSCRIPTEN)
target_include_directories(ls-qpack PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/wincompat>
$<INSTALL_INTERFACE:include>
@@ -149,6 +149,6 @@ if(LSQPACK_BIN)
DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

-if(WIN32)
+if(WIN32 OR EMSCRIPTEN)
install(DIRECTORY wincompat/sys DESTINATION include)
endif()
13 changes: 13 additions & 0 deletions ports/ls-qpack/mingw.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1369bd1..bcb58e3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,7 +48,7 @@ if(WIN32)
)
endif()

-if(WIN32)
+if(MSVC)
target_compile_options(ls-qpack PRIVATE
/Wall
/wd4100 # unreffed parameter
34 changes: 34 additions & 0 deletions ports/ls-qpack/pkgconfig.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32eed1c..1369bd1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,6 +123,8 @@ endif()

include(GNUInstallDirs)
configure_file(lsqpack.pc.in lsqpack.pc @ONLY)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lsqpack.pc"
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

configure_file(ls-qpack-config.cmake.in ls-qpack-config.cmake @ONLY)
install(TARGETS ls-qpack EXPORT ls-qpack-config
@@ -149,7 +151,4 @@ endif()

if(WIN32)
install(DIRECTORY wincompat/sys DESTINATION include)
-else()
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lsqpack.pc"
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
diff --git a/lsqpack.pc.in b/lsqpack.pc.in
index 7eac772..7c65072 100644
--- a/lsqpack.pc.in
+++ b/lsqpack.pc.in
@@ -7,6 +7,6 @@ Name: @PROJECT_NAME@
Description: @CMAKE_PROJECT_DESCRIPTION@
URL: @CMAKE_PROJECT_HOMEPAGE_URL@
Version: @PROJECT_VERSION@
-Requires: @LSQPACK_DEPENDS@
+Requires.private: @LSQPACK_DEPENDS@
Cflags: -I"${includedir}"
-Libs: -L"${libdir}" -llsqpack
+Libs: -L"${libdir}" -lls-qpack
19 changes: 7 additions & 12 deletions ports/ls-qpack/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO litespeedtech/ls-qpack
REF "v${VERSION}"
SHA512 74d4b2ea96bf0de43009cc121c8e57caff83be53c613236b01dce4ac4c12505d0d9fec07d9152ca62166947a160de2ab3f7bf19fb203a60b44507516a927ecb8
SHA512 951056564be6f2a2562001ad1a83731df41a1c8b8d91bf44e138c962befe2af1919daf0d94b57b05b49bb83656334c00ed2c642d81075f1e0cece1a46b31006b
HEAD_REF master
PATCHES
cmake-config.diff
pkgconfig.diff
mingw.diff
emscripten.diff
)

vcpkg_find_acquire_program(PKGCONFIG)
file(REMOVE_RECURSE "${SOURCE_PATH}/deps")

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
-DLSQPACK_TESTS=OFF
-DLSQPACK_BIN=OFF
-DLSQPACK_XXH=OFF
Expand All @@ -31,12 +34,4 @@ file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/share"
)

file(READ "${CURRENT_PACKAGES_DIR}/share/ls-qpack/ls-qpack-config.cmake" cmake_config)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/ls-qpack/ls-qpack-config.cmake"
"include(CMakeFindDependencyMacro)
find_dependency(PkgConfig)
pkg_check_modules(XXH REQUIRED IMPORTED_TARGET libxxhash)
${cmake_config}
")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
3 changes: 1 addition & 2 deletions ports/ls-qpack/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "ls-qpack",
"version": "2.5.5",
"version": "2.6.0",
"description": "QPACK compression library for use with HTTP/3",
"homepage": "https://github.com/litespeedtech/ls-qpack",
"license": "MIT",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
Expand Down
73 changes: 55 additions & 18 deletions ports/msh3/dependencies_fix.patch
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
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$<$<CONFIG:Debug>: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,12 @@ 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)
+# polyfill
+add_library(inc ALIAS ls-qpack::ls-qpack)
+add_library(platform ALIAS ls-qpack::ls-qpack)
+add_library(warnings ALIAS ls-qpack::ls-qpack)

# Configure and build msquic dependency.
if (WIN32)
@@ -83,8 +83,9 @@ endif()
@@ -76,9 +78,9 @@ 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)
Expand All @@ -24,22 +40,18 @@ index 4bd7155..b7adecc 100644
# 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,7 @@ 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_include_directories(msh3 PUBLIC $<INSTALL_INTERFACE:include>)
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 +25,16 @@ elseif (CX_PLATFORM STREQUAL "darwin")
PROPERTIES LINK_FLAGS "-exported_symbols_list \"${CMAKE_CURRENT_SOURCE_DIR}/darwin/exports.txt\"")
endif()

Expand All @@ -50,15 +62,40 @@ 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 @@
include(CMakeFindDependencyMacro)
@FILENAME_DEP_REPLACE@

-include(${SELF_DIR}/msh3.cmake)
+include(${CMAKE_INSTALL_PREFIX}/share/msh3/msh3.cmake)
+include("${CMAKE_CURRENT_LIST_DIR}/msh3.cmake")
10 changes: 4 additions & 6 deletions ports/msh3/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
5 changes: 2 additions & 3 deletions ports/msh3/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
32 changes: 32 additions & 0 deletions ports/msh3/width-exceeds-type.diff
Original file line number Diff line number Diff line change
@@ -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;
13 changes: 0 additions & 13 deletions ports/msquic/all_headers.patch

This file was deleted.

Loading
Loading