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

[nghttp3] Update to 1.4.0 #39955

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alagoutte
Copy link
Contributor

No description provided.

@Cheney-W Cheney-W added the category:port-update The issue is with a library, which is requesting update new revision label Jul 17, 2024
@Cheney-W
Copy link
Contributor

The failed triplets were due to the following reason:

/mnt/vss/_work/1/s/ports/nghttp3/portfile.cmake: warning: This port installs the following CMake files in places CMake files are not expected. CMake files should be installed in ${CURRENT_PACKAGES_DIR}/share/${PORT}. To suppress this message, add set(VCPKG_POLICY_SKIP_MISPLACED_CMAKE_FILES_CHECK enabled)
/mnt/vcpkg-ci/p/nghttp3_x64-linux: note: the files are relative to ${CURRENT_PACKAGES_DIR} here
note: lib/cmake/nghttp3/nghttp3Targets-release.cmake
note: lib/cmake/nghttp3/nghttp3ConfigVersion.cmake
note: lib/cmake/nghttp3/nghttp3Config.cmake
note: lib/cmake/nghttp3/nghttp3Targets.cmake
note: debug/lib/cmake/nghttp3/nghttp3Targets-debug.cmake
note: debug/lib/cmake/nghttp3/nghttp3ConfigVersion.cmake
note: debug/lib/cmake/nghttp3/nghttp3Config.cmake
note: debug/lib/cmake/nghttp3/nghttp3Targets.cmake
/mnt/vss/_work/1/s/ports/nghttp3/portfile.cmake: warning: This port creates ${CURRENT_PACKAGES_DIR}/lib/cmake and/or ${CURRENT_PACKAGES_DIR}/debug/lib/cmake, which should be merged and moved to ${CURRENT_PACKAGES_DIR}/share/${PORT}/cmake. Please use the helper function vcpkg_cmake_config_fixup() from the port vcpkg-cmake-config. To suppress this message, add set(VCPKG_POLICY_SKIP_LIB_CMAKE_MERGE_CHECK enabled)
/mnt/vss/_work/1/s/ports/nghttp3/portfile.cmake: warning: Found 2 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.
error: building nghttp3:x64-linux failed with: POST_BUILD_CHECKS_FAILEDSee https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.

It seems that the upstream has added an export target in the new version. You need to call the vcpkg_cmake_config_fixup function in portfile.cmake to solve this problem. At the same time, you need to add vcpkg-cmake-config as a dependency.

@Cheney-W Cheney-W marked this pull request as draft July 17, 2024 09:27
@alagoutte alagoutte marked this pull request as ready for review July 17, 2024 09:39
@alagoutte
Copy link
Contributor Author

The failed triplets were due to the following reason:

/mnt/vss/_work/1/s/ports/nghttp3/portfile.cmake: warning: This port installs the following CMake files in places CMake files are not expected. CMake files should be installed in ${CURRENT_PACKAGES_DIR}/share/${PORT}. To suppress this message, add set(VCPKG_POLICY_SKIP_MISPLACED_CMAKE_FILES_CHECK enabled)
/mnt/vcpkg-ci/p/nghttp3_x64-linux: note: the files are relative to ${CURRENT_PACKAGES_DIR} here
note: lib/cmake/nghttp3/nghttp3Targets-release.cmake
note: lib/cmake/nghttp3/nghttp3ConfigVersion.cmake
note: lib/cmake/nghttp3/nghttp3Config.cmake
note: lib/cmake/nghttp3/nghttp3Targets.cmake
note: debug/lib/cmake/nghttp3/nghttp3Targets-debug.cmake
note: debug/lib/cmake/nghttp3/nghttp3ConfigVersion.cmake
note: debug/lib/cmake/nghttp3/nghttp3Config.cmake
note: debug/lib/cmake/nghttp3/nghttp3Targets.cmake
/mnt/vss/_work/1/s/ports/nghttp3/portfile.cmake: warning: This port creates ${CURRENT_PACKAGES_DIR}/lib/cmake and/or ${CURRENT_PACKAGES_DIR}/debug/lib/cmake, which should be merged and moved to ${CURRENT_PACKAGES_DIR}/share/${PORT}/cmake. Please use the helper function vcpkg_cmake_config_fixup() from the port vcpkg-cmake-config. To suppress this message, add set(VCPKG_POLICY_SKIP_LIB_CMAKE_MERGE_CHECK enabled)
/mnt/vss/_work/1/s/ports/nghttp3/portfile.cmake: warning: Found 2 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.
error: building nghttp3:x64-linux failed with: POST_BUILD_CHECKS_FAILEDSee https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.

It seems that the upstream has added an export target in the new version. You need to call the vcpkg_cmake_config_fixup function in portfile.cmake to solve this problem. At the same time, you need to add vcpkg-cmake-config as a dependency.

Thanks, it will be better now !

@Cheney-W
Copy link
Contributor

I checked the config and target files under Linux and found that the exported targets lack the target_include_directories property, which can lead to usage bugs. This needs to be resolved upstream or by adding a patch in your PR to fix it.

@alagoutte
Copy link
Contributor Author

I checked the config and target files under Linux and found that the exported targets lack the target_include_directories property, which can lead to usage bugs. This needs to be resolved upstream or by adding a patch in your PR to fix it.

Do you have an example ?

@Cheney-W
Copy link
Contributor

Modify https://github.com/ngtcp2/nghttp3/blob/main/lib/CMakeLists.txt as below:

# Public shared library
if(ENABLE_SHARED_LIB)
  add_library(nghttp3 SHARED ${nghttp3_SOURCES})
  set_target_properties(nghttp3 PROPERTIES
    COMPILE_FLAGS "${WARNCFLAGS}"
    VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
    C_VISIBILITY_PRESET hidden
  )
  target_include_directories(nghttp3 INTERFACE $<INSTALL_INTERFACE:include>)  #new line

  install(TARGETS nghttp3
    EXPORT ${NGHTTP3_TARGETS_EXPORT_NAME} 
    ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
    LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()

if(ENABLE_STATIC_LIB)
  # Public static library
  add_library(nghttp3_static STATIC ${nghttp3_SOURCES})
  set_target_properties(nghttp3_static PROPERTIES
    COMPILE_FLAGS "${WARNCFLAGS}"
    VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
    ARCHIVE_OUTPUT_NAME nghttp3${STATIC_LIB_SUFFIX}
    )
  target_compile_definitions(nghttp3_static PUBLIC "-DNGHTTP3_STATICLIB")
  target_include_directories(nghttp3_static INTERFACE $<INSTALL_INTERFACE:include>)  #new line

  install(TARGETS nghttp3_static
    EXPORT ${NGHTTP3_TARGETS_EXPORT_NAME} 
    DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif()

@data-queue data-queue marked this pull request as draft July 24, 2024 02:08
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.

None yet

2 participants