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

[async-mqtt] Add new port #31902

Merged
merged 5 commits into from
Jun 15, 2023
Merged

[async-mqtt] Add new port #31902

merged 5 commits into from
Jun 15, 2023

Conversation

redboltz
Copy link
Contributor

@redboltz redboltz commented Jun 9, 2023

If this PR adds a new port, please uncomment and fill out this checklist:

  • Changes comply with the maintainer guide
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.

END OF NEW PORT CHECKLIST (delete this line)

@redboltz
Copy link
Contributor Author

redboltz commented Jun 9, 2023

@microsoft-github-policy-service agree

@redboltz redboltz force-pushed the add_async_mqtt branch 3 times, most recently from 3c8f86f to 02110f9 Compare June 9, 2023 05:50
@FrankXie05 FrankXie05 self-assigned this Jun 9, 2023
@FrankXie05 FrankXie05 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Jun 9, 2023
@redboltz redboltz marked this pull request as ready for review June 9, 2023 06:16

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

Just need function vcpkg_install_copyright.

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO redboltz/async_mqtt
REF 1.0.1
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
REF 1.0.1
REF "${VERSION}"

We can use the new function.


vcpkg_cmake_install()

vcpkg_cmake_config_fixup(PACKAGE_NAME async_mqtt_iface CONFIG_PATH lib/cmake/async_mqtt_iface)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
vcpkg_cmake_config_fixup(PACKAGE_NAME async_mqtt_iface CONFIG_PATH lib/cmake/async_mqtt_iface)
vcpkg_cmake_config_fixup(PACKAGE_NAME async_mqtt_iface CONFIG_PATH "lib/cmake/async_mqtt_iface")


vcpkg_cmake_config_fixup(PACKAGE_NAME async_mqtt_iface CONFIG_PATH lib/cmake/async_mqtt_iface)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this port a header-only or only dynamic.?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This portis a header-only.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should these two lines be removed if the port is a header-only library?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, keep two lines. We don't need empty folders.

Copy link
Contributor

Choose a reason for hiding this comment

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

"${CURRENT_PACKAGES_DIR}/debug" is no longer needed, with VCPKG_BUILD_TYPE set to release.

@FrankXie05
Copy link
Contributor

Note: I will be converting your PR to draft status. When you respond, please revert to "ready for review".
That way, I can be aware that you've responded since you can't modify the tags.

@FrankXie05 FrankXie05 marked this pull request as draft June 9, 2023 06:46
@FrankXie05 FrankXie05 changed the title [async-mqtt] Add async-mqtt. [async-mqtt] Add new port Jun 9, 2023
@@ -0,0 +1,27 @@
vcpkg_from_github(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
vcpkg_from_github(
#header-only library
vcpkg_from_github(

Copy link
Contributor

Choose a reason for hiding this comment

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

Rather:

set(VCPKG_BUILD_TYPE release) # header-only

and there is no need to remove any debug dirs...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked over this comment. I just reflected it.


vcpkg_cmake_config_fixup(PACKAGE_NAME async_mqtt_iface CONFIG_PATH lib/cmake/async_mqtt_iface)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib")
Copy link
Contributor

Choose a reason for hiding this comment

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

No, keep two lines. We don't need empty folders.

Comment on lines 12 to 16
-DASYNC_MQTT_BUILD_TOOLS=OFF
-DASYNC_MQTT_BUILD_EXAMPLES=OFF
-DASYNC_MQTT_BUILD_UNIT_TESTS=OFF
-DASYNC_MQTT_BUILD_SYSTEM_TESTS=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON
Copy link
Contributor

Choose a reason for hiding this comment

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

Please indent the actual options:

    OPTIONS
        -DASYNC_MQTT_BUILD_TOOLS=OFF
        -DASYNC_MQTT_BUILD_EXAMPLES=OFF
        -DASYNC_MQTT_BUILD_UNIT_TESTS=OFF
        -DASYNC_MQTT_BUILD_SYSTEM_TESTS=OFF
        -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON

Add header-only on the top of file.
Use ${VERSION} instead of the literal.
Fix indent.
Add double qoute to path
Remove copyright install.
@redboltz redboltz marked this pull request as ready for review June 9, 2023 10:03
@redboltz
Copy link
Contributor Author

redboltz commented Jun 9, 2023

I think that all changes request is reflected.

@redboltz
Copy link
Contributor Author

redboltz commented Jun 9, 2023

#31902 (comment) is fixed too.
So now ready to 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.

Just from looking at it in GH, only one nit-pick left.

The port is submitted from the owner, and it is not yet a project with many GH stars, so vcpkg maintainers must decide if they want the port under this name or under redboltz-async-mqtt. (There is at least a JS project under the same name. https://github.com/search?q=async-mqtt&type=repositories)


vcpkg_cmake_config_fixup(PACKAGE_NAME async_mqtt_iface CONFIG_PATH lib/cmake/async_mqtt_iface)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib")
Copy link
Contributor

Choose a reason for hiding this comment

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

"${CURRENT_PACKAGES_DIR}/debug" is no longer needed, with VCPKG_BUILD_TYPE set to release.

@redboltz
Copy link
Contributor Author

redboltz commented Jun 10, 2023

Just from looking at it in GH, only one nit-pick left.

The port is submitted from the owner, and it is not yet a project with many GH stars, so vcpkg maintainers must decide if they want the port under this name or under redboltz-async-mqtt. (There is at least a JS project under the same name. https://github.com/search?q=async-mqtt&type=repositories)

Thank you for the comment. I fixed that removing debug directory.
Let me explain some background. I am the author both
https://github.com/redboltz/async_mqtt (3 starred) and
https://github.com/redboltz/mqtt_cpp (376 starred) .
mqtt_cpp has been registered in vcpkg. Some contributor did it.
async_mqtt is successor project of mqtt_cpp. It coveres all asynchronous functionality of mqtt_cpp, but using more elegant way.

After I released async_mqtt, vcpkg support is requested by user redboltz/async_mqtt#16
So I createed this PR. I accept async-mqtt, redboltz-async-mqtt, or perhaps async-mqtt-cpp.
(The name of https://github.com/redboltz/async_mqtt is not changed.)

FrankXie05
FrankXie05 previously approved these changes Jun 13, 2023
@FrankXie05
Copy link
Contributor

FrankXie05 commented Jun 14, 2023

@redboltz
It seems that when generating the cmake configuration file, a parenthesis is missing.

async_mqtt_ifaceConfig.cmake:

set(Boost_USE_MULTITHREADED ON)
include(CMakeFindDependencyMacro)
find_dependency((Threads)
find_dependency((Boost 1.81.0 COMPONENTS )
...
...
CMake Error at E:/usage-test/vcpkg/installed/x64-windows/share/async_mqtt_iface/async_mqtt_ifaceConfig.cmake:3:
  Parse error.  Function missing ending ")".  End of file reached.

https://github.com/redboltz/async_mqtt/blob/3d773f4971ea9ff98e61314f29991eda2ecf4926/cmake/Config.cmake.in#L3

@dg0yt
Copy link
Contributor

dg0yt commented Jun 14, 2023

find_dependency((Boost 1.81.0 COMPONENTS )

There is a double (.

@FrankXie05
Copy link
Contributor

find_dependency((Threads)

@FrankXie05
Copy link
Contributor

Note: I will be converting your PR to draft status. When you respond, please revert to "ready for review".
That way, I can be aware that you've responded since you can't modify the tags.

@redboltz
Copy link
Contributor Author

I fixed async_mqtt cmake config issue and then released it as 1.0.2.
Then I updated this PR.

@redboltz
Copy link
Contributor Author

All checks have passed, now ready for review.

@redboltz redboltz marked this pull request as ready for review June 14, 2023 11:32
@FrankXie05
Copy link
Contributor

The usage has been tested successfully locally.

async-mqtt provides CMake targets:

    # this is heuristically generated, and may not be correct
    find_package(async_mqtt_iface CONFIG REQUIRED)
    target_link_libraries(main PRIVATE async_mqtt_iface::async_mqtt_iface)

@FrankXie05 FrankXie05 added the info:reviewed Pull Request changes follow basic guidelines label Jun 15, 2023
@vicroms vicroms merged commit 019fc6b into microsoft:master Jun 15, 2023
@redboltz redboltz deleted the add_async_mqtt branch June 15, 2023 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants