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

[msquic, msh3] update msquic to 3.4.7, update msh3 to 0.7.0 #42547

Closed
wants to merge 1 commit into from
Closed
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
24 changes: 13 additions & 11 deletions ports/msh3/dependencies_fix.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4bd7155..b7adecc 100644
index d8a81ab..ea7626e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,7 +72,7 @@ target_include_directories(msh3_headers INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
@@ -66,7 +66,7 @@ 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)
Expand All @@ -11,35 +11,37 @@ index 4bd7155..b7adecc 100644

# Configure and build msquic dependency.
if (WIN32)
@@ -83,8 +83,9 @@ endif()
@@ -77,8 +77,8 @@ 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")
-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)

# 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..4796fed 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -7,10 +7,7 @@ else()
@@ -7,11 +7,10 @@ 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
+target_link_libraries(msh3 PRIVATE msquic msquic_platform ls-qpack::ls-qpack msh3_headers)
+if(WIN32)
+ target_link_libraries(msh3 PRIVATE ncrypt crypt32)
endif()
@@ -26,7 +23,11 @@ elseif (CX_PLATFORM STREQUAL "darwin")
-target_link_libraries(msh3 PRIVATE platform) # For selfsign APIs

if(WIN32)
SET_TARGET_PROPERTIES(msh3
@@ -24,7 +23,11 @@ elseif (CX_PLATFORM STREQUAL "darwin")
PROPERTIES LINK_FLAGS "-exported_symbols_list \"${CMAKE_CURRENT_SOURCE_DIR}/darwin/exports.txt\"")
endif()

Expand Down
2 changes: 1 addition & 1 deletion ports/msh3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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
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": "!uwp & !osx & !(windows & x86)",
"dependencies": [
"ls-qpack",
"msquic",
Expand Down
13 changes: 0 additions & 13 deletions ports/msquic/all_headers.patch

This file was deleted.

40 changes: 17 additions & 23 deletions ports/msquic/fix-install.patch
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt
index 2376823..d0592a3 100644
index 18048e3b7..241c75511 100644
--- a/src/bin/CMakeLists.txt
+++ b/src/bin/CMakeLists.txt
@@ -253,14 +253,14 @@ endif()
if(BUILD_SHARED_LIBS)
target_include_directories(msquic PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../inc>
- $<INSTALL_INTERFACE:${include_dest}>)
+ $<INSTALL_INTERFACE:include>)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test case build pass when manual specify target_include_directories. Probably due to it missing the include path.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these lines is now on one other place:
https://github.com/microsoft/msquic/blob/main/src/inc/CMakeLists.txt#L14

I can patch upstream and wait for it release.

else()
target_include_directories(msquic_static INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../inc>
- $<INSTALL_INTERFACE:${include_dest}>)
+ $<INSTALL_INTERFACE:include>)
target_include_directories(msquic INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../inc>
- $<INSTALL_INTERFACE:${include_dest}>)
+ $<INSTALL_INTERFACE:include>)
@@ -260,20 +260,19 @@ if(WIN32)
list(APPEND OTHER_TARGETS MsQuicEtw_Header)
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)
- install(TARGETS msquic msquic_platform inc logging_inc warnings main_binary_link_args ${OTHER_TARGETS} EXPORT msquic DESTINATION lib)
-else()
- install(FILES ${QUIC_STATIC_LIBRARY} DESTINATION lib)
-endif()
+install(TARGETS msquic EXPORT msquic
+install(TARGETS msquic msquic_platform inc logging_inc warnings main_binary_link_args ${OTHER_TARGETS} 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)

install(FILES ${CMAKE_BINARY_DIR}/msquic-config.cmake DESTINATION share/msquic)

-if(BUILD_SHARED_LIBS)
- install(EXPORT msquic DESTINATION share/msquic)
-endif()
+install(
+ EXPORT msquic
+ DESTINATION share/msquic)

if (MSVC AND NOT QUIC_ENABLE_SANITIZERS AND BUILD_SHARED_LIBS)
target_compile_options(msquic PRIVATE /analyze)
8 changes: 6 additions & 2 deletions ports/msquic/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ 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
relative_export_include.patch
)

# This avoids a link error on x86-windows:
Expand Down Expand Up @@ -77,3 +77,7 @@ vcpkg_install_copyright(FILE_LIST "${QUIC_SOURCE_PATH}/LICENSE")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/debug/include"
)

file(READ ${CURRENT_PACKAGES_DIR}/share/msquic/msquic.cmake msquic_cmake)
string(REGEX REPLACE "set_target_properties[(]OpenSSLQuic PROPERTIES.+\"\n[)]" "" msquic_cmake "${msquic_cmake}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/msquic/msquic.cmake "${msquic_cmake}")
13 changes: 13 additions & 0 deletions ports/msquic/relative_export_include.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/inc/CMakeLists.txt b/src/inc/CMakeLists.txt
index 48edebd1e..55711f558 100644
--- a/src/inc/CMakeLists.txt
+++ b/src/inc/CMakeLists.txt
@@ -11,7 +11,7 @@ target_compile_options(inc INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${QUIC_CXX_FLAGS}
target_compile_definitions(inc INTERFACE ${QUIC_COMMON_DEFINES})
target_include_directories(inc INTERFACE
$<BUILD_INTERFACE:${QUIC_INCLUDE_DIR}>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
+ $<INSTALL_INTERFACE:include>)
Copy link
Contributor

@dg0yt dg0yt Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is neither necessary nor useful: inc is a private link lib of msquic.

Copy link
Contributor Author

@talregev talregev Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I remove the lines in the patch in the upstream, I change this line, because this is the source of the include folder.
microsoft/msquic#4575
This is my attempt to deal with the test fail here: #42547 (comment)
If this is not good change, as you say, please provide the solution.
I don't have enough knowledge to solve it.
If you don't have time to help (that is totally fine), I will close this PR and open an issue to update both msquic and msh3 and when you have time, please take a look on it and update it yourself.

Thank you for your comments and your help. I appreciate your knowledge. 🙏🏻


target_compile_features(inc INTERFACE cxx_std_17)
target_compile_features(inc INTERFACE c_std_11)
3 changes: 1 addition & 2 deletions ports/msquic/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"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",
Expand Down
8 changes: 4 additions & 4 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6153,8 +6153,8 @@
"port-version": 4
},
"msh3": {
"baseline": "0.6.0",
"port-version": 1
"baseline": "0.7.0",
"port-version": 0
},
"msinttypes": {
"baseline": "2018-02-25",
Expand All @@ -6169,8 +6169,8 @@
"port-version": 4
},
"msquic": {
"baseline": "2.4.5",
"port-version": 1
"baseline": "2.4.7",
"port-version": 0
},
"mstch": {
"baseline": "1.0.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/m-/msh3.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "a39bc79688aa9dba148e186050eafa5e357f769f",
"version": "0.7.0",
"port-version": 0
},
{
"git-tree": "6c26630aa357e123fe98a2dd4359b52681333a81",
"version": "0.6.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/m-/msquic.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "accc9fa1f3b842fe798cb1319fc42f5da027bbb7",
"version": "2.4.7",
"port-version": 0
},
{
"git-tree": "7e20d48f6fdc1052f7339eeff9ea9ab1074a726c",
"version": "2.4.5",
Expand Down