Skip to content

fix(vcpkg-ports): Add snake_case find_package() wrappers for PascalCase systems #554

Description

@kcenon

What

Add snake_case find_package() wrapper config files for 4 systems whose upstream CMake installs use PascalCase package names. Without these wrappers, consumers calling find_package(container_system CONFIG) cannot find the package — only find_package(ContainerSystem CONFIG) works.

  • Current: Portfiles use PascalCase PACKAGE_NAME (LoggerSystem, ContainerSystem, DatabaseSystem, NetworkSystem) without snake_case wrappers
  • Expected: Both find_package(container_system) and find_package(ContainerSystem) resolve correctly
  • Scope: vcpkg-ports/ overlay portfiles + kcenon/vcpkg-registry portfiles

Affected Systems

System Portfile PACKAGE_NAME Missing find_package()
logger_system LoggerSystem find_package(logger_system CONFIG)
container_system ContainerSystem find_package(container_system CONFIG)
database_system DatabaseSystem find_package(database_system CONFIG)
network_system NetworkSystem find_package(network_system CONFIG)

Why

  • Consumer integration test (integration_tests/vcpkg_consumer/CMakeLists.txt) uses snake_case find_package() calls (lines 29, 40, 60, 74)
  • These 4 calls silently fail because no snake_case config files exist
  • CI passes because these packages are marked optional — creating a false positive
  • Any external consumer following the documented find_package() convention will hit the same failure

Related: upstream migration tracked in kcenon/container_system#424, kcenon/database_system#455, kcenon/network_system#843

Where

Overlay ports (this repo):

  • vcpkg-ports/kcenon-logger-system/portfile.cmake
  • vcpkg-ports/kcenon-container-system/portfile.cmake
  • vcpkg-ports/kcenon-database-system/portfile.cmake
  • vcpkg-ports/kcenon-network-system/portfile.cmake

Registry (kcenon/vcpkg-registry):

  • ports/kcenon-logger-system/portfile.cmake
  • ports/kcenon-container-system/portfile.cmake
  • ports/kcenon-database-system/portfile.cmake
  • ports/kcenon-network-system/portfile.cmake

How

Technical Approach

Append wrapper file creation to each portfile after vcpkg_cmake_config_fixup():

# Create snake_case wrapper for find_package(container_system CONFIG)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/container_system-config.cmake"
    "include(\"\${CMAKE_CURRENT_LIST_DIR}/ContainerSystemConfig.cmake\")\n"
)
if(EXISTS "${CURRENT_PACKAGES_DIR}/share/${PORT}/ContainerSystemConfigVersion.cmake")
    file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/container_system-config-version.cmake"
        "include(\"\${CMAKE_CURRENT_LIST_DIR}/ContainerSystemConfigVersion.cmake\")\n"
    )
endif()

Acceptance Criteria

  • find_package(logger_system CONFIG) works after vcpkg install
  • find_package(container_system CONFIG) works after vcpkg install
  • find_package(database_system CONFIG) works after vcpkg install
  • find_package(network_system CONFIG) works after vcpkg install
  • PascalCase find_package() still works (backward compatible)
  • Wrappers added to both overlay ports and vcpkg-registry ports
  • validate-vcpkg-chain CI passes with all 8 ports found

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/highHigh priority - Critical for productionsize/MMedium - 1-3 days of worktype/fixBug fixes and corrections

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions