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

Conversation

talregev
Copy link
Contributor

@talregev talregev commented Dec 5, 2024

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download.
  • The "supports" clause reflects platforms that may be fixed by this new version.
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

@talregev talregev changed the title [msquic, msh3] update msquic to 3.4.7, update msh3 to 0.7.0 [Help needed][msquic, msh3] update msquic to 3.4.7, update msh3 to 0.7.0 Dec 5, 2024
@talregev
Copy link
Contributor Author

talregev commented Dec 5, 2024

msquic port installation complain about absolute paths that I don't know where it coming from:

-- Performing post-build validation
C:\src\vcpkg\ports\msquic\portfile.cmake: warning: There should be no absolute paths, such as the following, in an installed package. To suppress this message, add set(VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK enabled)
note: C:\src\vcpkg\packages
note: C:\src\vcpkg\installed
note: C:\src\vcpkg\buildtrees
note: C:\src\vcpkg\downloads
C:\src\vcpkg\packages\msquic_x64-windows\share\msquic\msquic.cmake: note: absolute paths found here
C:\src\vcpkg\ports\msquic\portfile.cmake: warning: Found 1 post-build check problem(s). These are usually caused by bugs in portfile.cmake or the upstream build system. Please correct these before submitting this port to the curated registry.
Elapsed time to handle msquic:x64-windows: 6.4 min

@BillyONeal
Copy link
Member

set_target_properties(OpenSSLQuic PROPERTIES
INTERFACE_LINK_LIBRARIES "$<$<NOT:$CONFIG:DEBUG>:$<$CONFIG:Debug:D:/vcpkg/buildtrees/msquic/x64-windows-rel/_deps/opensslquic-build/openssl3/debug/lib/libssl.lib>>;$<$CONFIG:DEBUG:$<$CONFIG:Debug:D:/vcpkg/buildtrees/msquic/x64-windows-dbg/_deps/opensslquic-build/openssl3/debug/lib/libssl.lib>>;$<$<NOT:$CONFIG:DEBUG>:$<$CONFIG:Debug:D:/vcpkg/buildtrees/msquic/x64-windows-rel/_deps/opensslquic-build/openssl3/debug/lib/libcrypto.lib>>;$<$CONFIG:DEBUG:$<$CONFIG:Debug:D:/vcpkg/buildtrees/msquic/x64-windows-dbg/_deps/opensslquic-build/openssl3/debug/lib/libcrypto.lib>>;$<$<NOT:$CONFIG:DEBUG>:$<$<NOT:$CONFIG:Debug>:D:/vcpkg/buildtrees/msquic/x64-windows-rel/_deps/opensslquic-build/openssl3/release/lib/libssl.lib>>;$<$CONFIG:DEBUG:$<$<NOT:$CONFIG:Debug>:D:/vcpkg/buildtrees/msquic/x64-windows-dbg/_deps/opensslquic-build/openssl3/release/lib/libssl.lib>>;$<$<NOT:$CONFIG:DEBUG>:$<$<NOT:$CONFIG:Debug>:D:/vcpkg/buildtrees/msquic/x64-windows-rel/_deps/opensslquic-build/openssl3/release/lib/libcrypto.lib>>;$<$CONFIG:DEBUG:$<$<NOT:$CONFIG:Debug>:D:/vcpkg/buildtrees/msquic/x64-windows-dbg/_deps/opensslquic-build/openssl3/release/lib/libcrypto.lib>>"
)

It looks like they're somehow vendoring a different OpenSSL despite FETCHCONTENT_FULLY_DISCONNECTED=ON?

if(QUIC_TLS STREQUAL "openssl" OR  QUIC_TLS STREQUAL "openssl3")
    add_library(OpenSSL INTERFACE)

    include(FetchContent)

    FetchContent_Declare(
        OpenSSLQuic
        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/submodules
        CMAKE_ARGS "-DQUIC_USE_SYSTEM_LIBCRYPTO=${QUIC_USE_SYSTEM_LIBCRYPTO}"
    )
    FetchContent_MakeAvailable(OpenSSLQuic)

    target_link_libraries(OpenSSL
        INTERFACE
        OpenSSLQuic::OpenSSLQuic
    )
endif()

@talregev
Copy link
Contributor Author

talregev commented Dec 5, 2024

msquic using quictls from the beginning of this port.
I understand now what happen:
I create a PR in upstream that will export the msquic_platform that needed for mhs v0.7.0.
for export msquic_platform is also needed to export OpenSSLQuic target.
When it export it, it export with absolute path:
Not sure what to do.

# Create imported target OpenSSLQuic
add_library(OpenSSLQuic INTERFACE IMPORTED)

set_target_properties(OpenSSLQuic PROPERTIES
  INTERFACE_LINK_LIBRARIES "\$<\$<NOT:\$<CONFIG:DEBUG>>:\$<\$<CONFIG:Debug>:C:/src/vcpkg/buildtrees/msquic/x64-windows-rel/_deps/opensslquic-build/openssl3/debug/lib/libssl.lib>>;\$<\$<CONFIG:DEBUG>:\$<\$<CONFIG:Debug>:C:/src/vcpkg/buildtrees/msquic/x64-windows-dbg/_deps/opensslquic-build/openssl3/debug/lib/libssl.lib>>;\$<\$<NOT:\$<CONFIG:DEBUG>>:\$<\$<CONFIG:Debug>:C:/src/vcpkg/buildtrees/msquic/x64-windows-rel/_deps/opensslquic-build/openssl3/debug/lib/libcrypto.lib>>;\$<\$<CONFIG:DEBUG>:\$<\$<CONFIG:Debug>:C:/src/vcpkg/buildtrees/msquic/x64-windows-dbg/_deps/opensslquic-build/openssl3/debug/lib/libcrypto.lib>>;\$<\$<NOT:\$<CONFIG:DEBUG>>:\$<\$<NOT:\$<CONFIG:Debug>>:C:/src/vcpkg/buildtrees/msquic/x64-windows-rel/_deps/opensslquic-build/openssl3/release/lib/libssl.lib>>;\$<\$<CONFIG:DEBUG>:\$<\$<NOT:\$<CONFIG:Debug>>:C:/src/vcpkg/buildtrees/msquic/x64-windows-dbg/_deps/opensslquic-build/openssl3/release/lib/libssl.lib>>;\$<\$<NOT:\$<CONFIG:DEBUG>>:\$<\$<NOT:\$<CONFIG:Debug>>:C:/src/vcpkg/buildtrees/msquic/x64-windows-rel/_deps/opensslquic-build/openssl3/release/lib/libcrypto.lib>>;\$<\$<CONFIG:DEBUG>:\$<\$<NOT:\$<CONFIG:Debug>>:C:/src/vcpkg/buildtrees/msquic/x64-windows-dbg/_deps/opensslquic-build/openssl3/release/lib/libcrypto.lib>>"
)

@talregev
Copy link
Contributor Author

talregev commented Dec 5, 2024

@dg0yt do you have an idea how to solve it?
Thank you for your help.

@WangWeiLin-MV WangWeiLin-MV added the category:port-update The issue is with a library, which is requesting update new revision label Dec 6, 2024
@BillyONeal
Copy link
Member

When it export it, it export with absolute path:

I believe the problem is that it is being fetchcontent'd; vcpkg_cmake_config_fixup doesn't know how to fix it up when it's being consumed from buildtrees rather than installed.

@talregev talregev changed the title [Help needed][msquic, msh3] update msquic to 3.4.7, update msh3 to 0.7.0 [msquic, msh3] update msquic to 3.4.7, update msh3 to 0.7.0 Dec 10, 2024
@talregev talregev force-pushed the TalR/msquic_msh3 branch 9 times, most recently from 5f16404 to ef95015 Compare December 11, 2024 06:34
@talregev
Copy link
Contributor Author

@BillyONeal @WangWeiLin-MV
The PR is ready for review.

@dg0yt dg0yt mentioned this pull request Dec 11, 2024
ports/msh3/dependencies_fix.patch Outdated Show resolved Hide resolved
ports/msh3/dependencies_fix.patch Outdated Show resolved Hide resolved
@talregev talregev force-pushed the TalR/msquic_msh3 branch 4 times, most recently from d971fbd to ccba8d5 Compare December 11, 2024 12:53
@talregev
Copy link
Contributor Author

@WangWeiLin-MV I answered @dg0yt review comments. This PR is ready for review.

Copy link
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

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

The introduction of the misquic:: CMake namespace is merged upstream, but it is not yet part of a release and thus should not be yet accepted in the vcpkg registry.

AFAIU upstream was unaware of this change breaking downstream projects (e.g. requiring patching in port msh3 here.), and vcpkg should be concerned for the same reason.

I suggested a solution but it is not yet integrated.
microsoft/msquic#4701 (comment)

@talregev
Copy link
Contributor Author

I will remove the namespace from this PR, and next version we can add it back.

@talregev talregev force-pushed the TalR/msquic_msh3 branch 2 times, most recently from 1d81177 to 65575fa Compare December 12, 2024 08:10
@talregev
Copy link
Contributor Author

@WangWeiLin-MV The PR is ready for review.

@talregev
Copy link
Contributor Author

requiring patching in port msh3

The change of namespace not effect msh3 repo, because msh3 use msquic as internal lib, and have access to internal targets.
The msh3 here must have to be patch, because we use the msquic as external, and not because of the namespace.

Copy link
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

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

The serious concerns are resolved.
Thanks.

@talregev
Copy link
Contributor Author

@MonicaLiu0311 Can you review my PR?

Copy link
Contributor

@WangWeiLin-MV WangWeiLin-MV left a comment

Choose a reason for hiding this comment

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

The port usage tests fail with error C1083: Cannot open include file: 'msquic.h': No such file or directory

cmake_minimum_required(VERSION 3.25.1)
project(Proj LANGUAGES CXX)

add_executable(main c.cpp)
target_compile_features(main PRIVATE cxx_std_23)

find_package(msquic CONFIG REQUIRED)
target_link_libraries(main PRIVATE msquic)

@talregev
Copy link
Contributor Author

talregev commented Dec 16, 2024

The port usage tests fail with error C1083: Cannot open include file: 'msquic.h': No such file or directory

cmake_minimum_required(VERSION 3.25.1)
project(Proj LANGUAGES CXX)

add_executable(main c.cpp)
target_compile_features(main PRIVATE cxx_std_23)

find_package(msquic CONFIG REQUIRED)
target_link_libraries(main PRIVATE msquic)

I guess you test msquic.
I am not sure why? It compile with msh3.
What os do you do the test?
It should export all the headers. and on msquic ci, I see it copy the headers on the test.

@dg0yt Can you take a look too?

@talregev
Copy link
Contributor Author

I don't have the knowledge to solve it.

@talregev talregev requested a review from dg0yt December 16, 2024 08:37
@dg0yt
Copy link
Contributor

dg0yt commented Dec 16, 2024

Did upstream merge the $<INSTALL_INTERFACE:include> lines which are removed from the patch now? IIUC upstream CMake modifications were authored by @talregev.

Put the usage in a test port, and you catch breaking changes early, and you save time.

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.

@talregev
Copy link
Contributor Author

@WangWeiLin-MV I added a new patch that export the include to relative folder. Can you test it again?

@WangWeiLin-MV
Copy link
Contributor

Test failed on configure steps.

  Targets Defined: msquic, msquic_platform, inc, logging_inc, warnings,
  main_binary_link_args, OpenSSL, OpenSSLQuic

  Targets not yet defined: MsQuicEtw_Header

Please test the case above.

- Update msquic to 3.4.7
- Update msh3 to 0.7.0
@talregev
Copy link
Contributor Author

Test failed on configure steps.

  Targets Defined: msquic, msquic_platform, inc, logging_inc, warnings,
  main_binary_link_args, OpenSSL, OpenSSLQuic

  Targets not yet defined: MsQuicEtw_Header

Please test the case above.

I don't have the cpp file.
Also I change again. Can you test again?

Copy link
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

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

The point is that the interface include dir must be attached to msquic directly (like in the original patch).
All the other targets in msquic are linked as PRIVATE at msquic build-time, i.e. they are LINK_ONLY transitive dependencies for static library linkage, but they do not forward interface include directories to the user who is linking to msquic.

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. 🙏🏻

@talregev
Copy link
Contributor Author

Test failed on configure steps.

  Targets Defined: msquic, msquic_platform, inc, logging_inc, warnings,
  main_binary_link_args, OpenSSL, OpenSSLQuic

  Targets not yet defined: MsQuicEtw_Header

Please test the case above.

@WangWeiLin-MV Can you verify if the new change is working for your test? Thank you.

@jimwang118
Copy link
Contributor

Usage test passed with x64-windows triplet.

@jimwang118 jimwang118 added info:reviewed Pull Request changes follow basic guidelines and removed info:reviewed Pull Request changes follow basic guidelines labels Dec 17, 2024
@jimwang118
Copy link
Contributor

Usage test passed with x64-windows triplet.

The usage test failed under Linux with the following error.

CMake Error at /mnt/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package):
  Could not find a package configuration file provided by "msquic" with any
  of the following names:

    msquicConfig.cmake
    msquic-config.cmake

  Add the installation prefix of "msquic" to CMAKE_PREFIX_PATH or set
  "msquic_DIR" to a directory containing one of the above files.  If "msquic"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:14 (find_package)

@jimwang118 jimwang118 marked this pull request as draft December 17, 2024 08:27
@talregev talregev closed this Dec 17, 2024
@talregev
Copy link
Contributor Author

Usage test passed with x64-windows triplet.

The usage test failed under Linux with the following error.

CMake Error at /mnt/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package):
  Could not find a package configuration file provided by "msquic" with any
  of the following names:

    msquicConfig.cmake
    msquic-config.cmake

  Add the installation prefix of "msquic" to CMAKE_PREFIX_PATH or set
  "msquic_DIR" to a directory containing one of the above files.  If "msquic"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:14 (find_package)

Thank you for your time and effort for review. I don't have the knowledge to solve this issue.
I open a vcpkg issue to update msquic:
#42755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-update The issue is with a library, which is requesting update new revision
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants