Skip to content

[vcpkg-tool] Post build lint: Check for missing optional dependencies  #27590

@Thomas1664

Description

@Thomas1664

Is your feature request related to a problem? Please describe.

Many ports have optional dependencies on packages that are either provided by vcpkg or a system package manager. This is the case if upstream uses find_package() without REQUIRED and reacts differently if the package is found. Dependencies are either unexpectedly 'picked up' or not found [this is especially relevant for ports that use the unofficial:: namespace]. This leads to unreproducible builds or - even worse - to build failures.

In orther to mitigate this, we have to explicitly control dependencies via CMAKE_DISABLE_FIND_PACKAGE_ and CMAKE_REQUIRE_FIND_PACKAGE_. Unfortunately, we almost never notice such behavior because the package is either not available in our CI or always installed before the port that depends on it.

Proposed solution

Add a post build check that searches for Could NOT find <package name> (missing ... in config-<triplet>-out.log.

Metadata

Metadata

Assignees

Labels

category:vcpkg-featureThe issue is a new capability of the tool that doesn’t already exist and we haven’t committed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions