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

Draft: Document rules for tool ports #46

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

Conversation

Neumann-A
Copy link
Contributor

No description provided.

@prmerger-automator
Copy link

@Neumann-A : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit bb78b08:

💡 Validation status: suggestions

File Status Preview URL Details
vcpkg/contributing/maintainer-guide.md 💡Suggestion View Details
vcpkg/maintainers/authoring-tool-ports.md ✅Succeeded View

vcpkg/contributing/maintainer-guide.md

  • Line 29, Column 41: [Suggestion: link-broken - See documentation] Link 'https://repology.org/' points to a page that doesn't exist. Check the path or URL and update the link.

For more details, please refer to the build report.

Note: Links can become broken if there are changes on the target sites.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

@prmerger-automator
Copy link

PRMerger Results

Issue Description
Added File(s) This PR contains added files. New files require human review.
File Change Percent This PR contains file(s) with more than 20% file change.

Tool ports are implemented in different ways depending on their expected usage.
1. If a tool is expected to be provided in binary form and not ment for the user to be used the port should be named `vcpkg-tool-<toolname>`. The port should work like `vcpkg_find_acquire_program` and only download/provide the tool if another port requests its usage. This is done via `vcpkg-port-config.cmake` which has to included all logic to find or provide the tool. The artifacts of the tool have to be put into `${DOWNLOADS}/tools/<tool_name>-<tool_version>`. (This means that the tool port is actually just a [script port](./authoring-script-ports.md))
2. If a tool is required to be build from source but is not to be used by the user the tools build artifacts should be stored into `${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}`. Furthermore a `vcpkg-port-config.cmake` needs to be installed setting a variable to path of the relevant tool.
3. If a tool is expected to be used outside of vcpkg and inside the users `CMakeLists.txt`. The tools build artifacts are installed to `${CURRENT_PACKAGES_DIR}/tools/${PORT}` and the port name should follow the normal vcpkg naming rules. A `vcpkg-port-config.cmake` is required to be installed like in case 2.
Copy link
Contributor

@autoantwort autoantwort Mar 13, 2023

Choose a reason for hiding this comment

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

Do you have an example and should tools features also install vcpkg-port-config.cmake files?

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 probably falls into case 3. I thought about dropping the vcpkg-port-config.cmake for that case unless it is expected to be referenced by a portfile directly. (or simply install an empty vcpkg-port-config.cmake).

Maybe it comes down to define a rule how to reference tool paths from portfiles in this case. Everything which is external to the port itself should be indirectly referenced via a vcpkg-port-config.cmake while a port referencing itself (e.g. code generators) is allowed to directly access it host build artifacts.

I can also imaging a vcpkg_find_program call which drops the acquire component but is aware of additional files being installed by ports.

@AugP
Copy link
Collaborator

AugP commented Sep 11, 2023

Billy O'Neal is working on something similar to this. Leaving this as draft for now; will update status once Billy has made progress with his proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants