[docs] Add Authoring-script-ports.md#22396
Conversation
dg0yt
left a comment
There was a problem hiding this comment.
It seems that this PR lacks the addition of docs/maintainers/authoring-script-ports.md.
38b2866 to
755b733
Compare
strega-nil-ms
left a comment
There was a problem hiding this comment.
It'd also be good to talk about how to add docs to a script port; adding the port to docs/regenerate.ps1.
| @@ -0,0 +1,28 @@ | |||
| # Authoring Script Ports | |||
|
|
|||
| Ports can expose functions for other ports to consume during their build, for example the `vcpkg-cmake` helper port exposes the `vcpkg_cmake_configure()` helper function. Packaging common scripts into a shared helper port makes maintenance easier because all consumers can be updated from a single place. Because the scripts come from a port, they can be versioned and depended upon via all the same mechanisms as any other port. | |||
There was a problem hiding this comment.
Can you split this up into multiple lines? Having a single paragraph all on one line makes this difficult to review...
Also, s/, for example/: as an example,/
|
|
||
| Script ports are technically implemented via the `vcpkg-port-config.cmake` extension mechanism. Before invoking the `portfile.cmake` of a port, vcpkg will first import `share/<port>/vcpkg-port-config.cmake` from each direct dependency. If the direct dependency is a host dependency, the import will be performed in the host installed tree (e.g. `${HOST_INSTALLED_DIR}/share/${DEP}/vcpkg-port-config.cmake`). | ||
|
|
||
| Note that only direct dependencies are checked. This means that if a script relies on another script transitively, it must explicitly import the relevant config. |
There was a problem hiding this comment.
s/direct dependencies/the `vcpkg-port-config.cmake` of direct dependencies/s/are checked/are included in this way/s/relevant config/relevant `vcpkg-port-config.cmake`/
docs/users/host-dependencies.md
Outdated
| Some ports are host-only: script ports and tool ports are common examples. | ||
| In this case, you can use the `"native"` supports expression to describe this. | ||
| This supports expression is true when `TARGET_TRIPLET == HOST_TRIPLET`. | ||
| This supports expression is true when `TARGET_TRIPLET == HOST_TRIPLET` / `VCPKG_CROSSCOMPILING` is true. |
There was a problem hiding this comment.
| This supports expression is true when `TARGET_TRIPLET == HOST_TRIPLET` / `VCPKG_CROSSCOMPILING` is true. | |
| This supports expression is true when `VCPKG_CROSSCOMPILING` is false (when `TARGET_TRIPLET == HOST_TRIPLET`). |
Actually this concept is controversial. It breaks documentation fixes without CI rebuild. |
|
I have resolved the comments that were more-or-less directly applied but left open the ones where I chose to format at least part of the suggestion differently. |
|
|
||
| Ports should never provide a `vcpkg-port-config.cmake` file under a different | ||
| `share/` subdirectory than the current port (`${PORT}`). | ||
|
|
There was a problem hiding this comment.
You should probably add some information on docs; there's a list in docs/regenerate.ps1 that one should update when adding a new script port.
There was a problem hiding this comment.
I would prefer to merge this PR as-is; then that content can be easily added separately.
Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
* master: (221 commits) [vcpkg-tool] update to 2022-02-03 (microsoft#22924) [opencv4] Disable building cpufeatures since it conflict with libwebp (microsoft#22844) [rhasheq] New port (microsoft#22905) [sfml] Add arm64 patch to allow SFML to compile on apple silicon (microsoft#22937) [popsift] Fix missing Thrust include, already merged upstream. (microsoft#22929) [python3][python2] Use MKDIR_P to create directories to avoid race conditions (microsoft#22902) Added libe57format port (microsoft#22909) update polyhook2 (microsoft#22906) [botan] Fix debug info (microsoft#22911) [opentelemetry-cpp] update version to v1.2.0 (microsoft#22925) [docs] document VCPKG_INSTALLED_DIR variable (microsoft#22695) [c89stringutils] New port (microsoft#22904) [randomstr] New port (microsoft#22921) [docs] Add Authoring-script-ports.md (microsoft#22396) [vcpkg_fail_port_install] Deprecate function (microsoft#21489) [vcpkg-cmake-config] add missing TOOLS_PATH (microsoft#22863) Ace Build Windows - Missing files in include package (microsoft#22880) [opendnp3] Disable FetchContent in favor of predownloading (microsoft#22894) libraqm update to 0.9.0 (microsoft#22907) [google-cloud-cpp] update to latest release (v1.36.0) (microsoft#22897) ...
Add documentation covering
vcpkg-port-config.cmakeand how to author script ports