Skip to content

[vcpkg tool] Add optional tracing of find_package#27982

Merged
JavierMatosD merged 3 commits intomicrosoft:masterfrom
dg0yt:trace-find-package-only
Dec 1, 2022
Merged

[vcpkg tool] Add optional tracing of find_package#27982
JavierMatosD merged 3 commits intomicrosoft:masterfrom
dg0yt:trace-find-package-only

Conversation

@dg0yt
Copy link
Contributor

@dg0yt dg0yt commented Nov 23, 2022

  • What does your PR fix?

    This is the less controversial part of [vcpkg] Controlling top-level find_package #27950: Tracing find_package.

    With complex projects such as gdal, it is really difficult to see all calls to find_package and to understand side effects of CMAKE_DISABLE_FIND_PACKAGE_<Pkg>. Output gives no indication of top-level calls vs. nesting (find_dependency), and there is no output at all if QUIET is used.

    This PR adds optional tracing output whenever find_package is called, indicating nested calls with indentation.
    It is off by default in order to not change behaviour in user projects, but it could be generally turned on in vcpkg_cmake_configure for maintainer convenience.

Example:

-- find_package(CryptoPP )
-- find_package(PROJ 9 CONFIG QUIET)
--   find_package(unofficial-sqlite3 CONFIG QUIET REQUIRED)
--     find_package(Threads QUIET REQUIRED)
--   find_package(TIFF QUIET REQUIRED)
--     find_package(LibLZMA REQUIRED QUIET)
--       find_package(Threads )
--     find_package(JPEG REQUIRED QUIET)
--     find_package(ZLIB REQUIRED QUIET)
--   find_package(CURL QUIET REQUIRED)
--     find_package(OpenSSL 3 QUIET REQUIRED)
--       find_package(PkgConfig QUIET)
--       find_package(Threads )
--       find_package(Threads REQUIRED)
--     find_package(ZLIB 1 QUIET REQUIRED)
-- find_package(ZSTD NAMES zstd)

github-actions[bot]
github-actions bot previously approved these changes Nov 23, 2022
@dg0yt dg0yt marked this pull request as ready for review November 23, 2022 19:30
@LilyWangLL LilyWangLL added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Nov 24, 2022
@LilyWangLL LilyWangLL changed the title Add optional tracing of find_package [vcpkg tool] Add optional tracing of find_package Nov 24, 2022
LilyWangLL
LilyWangLL previously approved these changes Nov 24, 2022
@LilyWangLL LilyWangLL added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Nov 24, 2022
@dg0yt dg0yt dismissed stale reviews from LilyWangLL and github-actions[bot] via 7defad4 November 24, 2022 04:02
@JavierMatosD JavierMatosD added requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. and removed info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. labels Nov 28, 2022
@JavierMatosD
Copy link
Contributor

Thank you, @dg0yt for the PR and for splitting the PR! It makes it much easier to review. :)

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

Labels

category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants