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

[cinatra, cmdline] Add new ports #38712

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

EmployeeNo427
Copy link

  • 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.

@MonicaLiu0311 MonicaLiu0311 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label May 14, 2024
@EmployeeNo427 EmployeeNo427 marked this pull request as ready for review May 14, 2024 10:53
@Cheney-W
Copy link
Contributor

This port has the following issues:

  1. Its dependencies are not being used at all, as there is no related code in the source's CMakeLists.txt.
  2. The headers provided by the source contain many calls to headers in the same or lower-level directories. If these calls are to use files from those dependencies, the current file structure does not match.
  3. You have used some deprecated functions, and vcpkg's policy is not to build examples.

@Cheney-W Cheney-W marked this pull request as draft May 15, 2024 10:53
@EmployeeNo427
Copy link
Author

@Cheney-W Thank you very much for your feedback! I have updated cinatra/portfile.cmake and cinatra/vcpkg.json to include dependencies as part of the cinatra installation. This should address issues 1 and 2. However, I am uncertain about issue 3 and the optimal approach for implementing it. Could you please provide guidance on this?

ports/cinatra/vcpkg.json Outdated Show resolved Hide resolved
ports/cinatra/vcpkg.json Outdated Show resolved Hide resolved
scripts/ci.baseline.txt Outdated Show resolved Hide resolved
EmployeeNo427 and others added 6 commits May 16, 2024 03:48
Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
@EmployeeNo427
Copy link
Author

@Cheney-W Thank you very much for the detailed feedback! I have applied all the suggestions.

@Cheney-W
Copy link
Contributor

0.9.1 is declared with ce7e7fba41dc0718831bc3ce20644051f46a6878, but the local port has a different SHA 91af211a6a62396620de86d320f075490e0ea302.
Please update the port's version fields and then run:
vcpkg x-add-version cinatra
git add versions
git commit -m "Update version database"
to add the new version.
To attempt to resolve all errors at once, run:
vcpkg x-add-version --all

@EmployeeNo427
Copy link
Author

EmployeeNo427 commented May 17, 2024

0.9.1 is declared with ce7e7fba41dc0718831bc3ce20644051f46a6878, but the local port has a different SHA 91af211a6a62396620de86d320f075490e0ea302. Please update the port's version fields and then run: vcpkg x-add-version cinatra git add versions git commit -m "Update version database" to add the new version. To attempt to resolve all errors at once, run: vcpkg x-add-version --all

@Cheney-W Thanks! For clarification, I need to manually change "\vcpkg\versions\c-\cinatra.json" from:

{
  "versions": [
    {
      "git-tree": "f14ed90b0ac73f6a970d7688329dfbabe7b08a58",
      "version-date": "2024-05-15",
      "port-version": 0
    },
    {
      "git-tree": "ce7e7fba41dc0718831bc3ce20644051f46a6878",
      "version": "0.9.1",
      "port-version": 0
    }
  ]
}

to:

{
  "versions": [
    {
      "git-tree": "f14ed90b0ac73f6a970d7688329dfbabe7b08a58",
      "version-date": "2024-05-15",
      "port-version": 0
    },
    {
      "git-tree": "91af211a6a62396620de86d320f075490e0ea302",
      "version": "0.9.1",
      "port-version": 0
    }
  ]
}

And then run the commands?

@Cheney-W
Copy link
Contributor

There should be only one record in the \vcpkg\versions\c-\cinatra.json file.
When you do any change in the cinatra port and submit a commit, you should run below commands:

.\vcpkg x-add-version cinatra --overwrite-version
git add .
git commit --amend --no-edit
git push

Also, I noticed that cinatra_press_tool.exe is stored in ${CURRENT_PACKAGES_DIR}/include, so you won't find it under ${CURRENT_PACKAGES_DIR}/bin.

@EmployeeNo427 EmployeeNo427 marked this pull request as ready for review May 17, 2024 11:52
Comment on lines 27 to 28
file(COPY "${CURRENT_PACKAGES_DIR}/include/cinatra_press_tool.exe"
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/cinatra")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the include/cinatra_press_tool.exe when it is copied to tools/cinatra.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, use vcpkg_copy_tools with proper arguments.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks!

EmployeeNo427 and others added 2 commits May 20, 2024 05:49
vcpkg_cmake_install()

# Copy the entire include directory
file(COPY ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR})
Copy link
Contributor

Choose a reason for hiding this comment

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

The current header file storage structure may cause conflicts with header files from other ports. Therefore, I suggest moving all the contents under the include directory to ${CURRENT_PACKAGES_DIR}/include/cinatra instead of ${CURRENT_PACKAGES_DIR}/include/.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you very much!

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.

vcpkg has asio, boost-asio, and async-simple. Shouldn't this port use the corresponding vcpkg ports instead of vendored copies?

@EmployeeNo427
Copy link
Author

vcpkg has asio, boost-asio, and async-simple. Shouldn't this port use the corresponding vcpkg ports instead of vendored copies?

Thank you for the suggestion! I initially tried to incorporate the vcpkg ports for dependencies, but it seems to require reconfiguring the library.

#38712 (comment)

@dg0yt
Copy link
Contributor

dg0yt commented May 21, 2024

I initially tried to incorporate the vcpkg ports for dependencies, but it seems to require reconfiguring the library.

This might be a necessary task for integrating it into vcpkg, so that downstream apps don't end up with different definitions of the same functions.

vcpkg_copy_tools(
TOOL_NAMES cinatra_press_tool
SEARCH_DIRS "${CURRENT_PACKAGES_DIR}/include/cinatra"
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/cinatra"
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
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/cinatra"

This is the default.

Copy link
Contributor

Choose a reason for hiding this comment

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

The AUTO_CLEAN of vcpkg_copy_tools can only delete the tool under ${CURRENT_PACKAGES_DIR}/bin, so ${CURRENT_PACKAGES_DIR}/include/cinatra_press_tool.exe still needs to be deleted manually here.

Copy link
Contributor

Choose a reason for hiding this comment

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

What a ...

ports/cinatra/portfile.cmake Outdated Show resolved Hide resolved
@dg0yt
Copy link
Contributor

dg0yt commented May 21, 2024

What does cinatra_press_tool do?
It is unexpected for a "header-only" port to install tools, and it is unexpected that it installs to include.

@EmployeeNo427 EmployeeNo427 marked this pull request as draft May 21, 2024 07:33
@EmployeeNo427

This comment was marked as duplicate.

@EmployeeNo427
Copy link
Author

@Cheney-W and @dg0yt

Thank you for your feedback and suggestions! I have reverted to using a combination of vcpkg_copy_tools and manually removing cinatra_press_tool.exe from the include directory to handle the tool. However, from looking at the GitHub checks, it is still referring to the bin folder for some reason and encountering build errors.

Additionally, I noticed there are ongoing discussions about the proper handling and integration of dependencies. Could you please provide guidance on the following points?

  1. Is the current approach of using vcpkg_copy_tools combined with the manual removal of cinatra_press_tool.exe acceptable, or is there a better method you would recommend?
  2. What is the best way to handle the integration of dependencies to ensure compatibility and avoid issues with downstream applications? Previously, I updated cinatra/portfile.cmake and cinatra/vcpkg.json to include dependencies as part of the cinatra installation instead of through vcpkg, due to how cinatra itself is structured, as @Cheney-W mentioned:
    Its dependencies are not being used at all, as there is no related code in the source's CMakeLists.txt.
    The headers provided by the source contain many calls to headers in the same or lower-level directories. If these calls are to use files from those dependencies, the current file structure does not match.
    

Again, thank you very much for your assistance on these matters!

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!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants