From 12547a9e6ee9ca7842a9f66534d635157b6d06cd Mon Sep 17 00:00:00 2001 From: Andrei Date: Thu, 16 Jul 2026 14:58:20 +0200 Subject: [PATCH 1/4] vcpkg registry: hsm-collector port (0.6.2) + baseline; align port/conan version --- ports/hsm-collector/copyright | 3 ++ ports/hsm-collector/portfile.cmake | 44 ++++++++++++++++++++++ ports/hsm-collector/vcpkg.json | 29 ++++++++++++++ src/native/collector/conanfile.py | 2 +- src/native/collector/vcpkg-port/vcpkg.json | 2 +- versions/baseline.json | 8 ++++ 6 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 ports/hsm-collector/copyright create mode 100644 ports/hsm-collector/portfile.cmake create mode 100644 ports/hsm-collector/vcpkg.json create mode 100644 versions/baseline.json diff --git a/ports/hsm-collector/copyright b/ports/hsm-collector/copyright new file mode 100644 index 000000000..68b5aa8ec --- /dev/null +++ b/ports/hsm-collector/copyright @@ -0,0 +1,3 @@ +Native HSM DataCollector (hsm-collector). + +Source: https://github.com/SoftFx/Hierarchical-Sensor-Monitoring (src/native/collector) diff --git a/ports/hsm-collector/portfile.cmake b/ports/hsm-collector/portfile.cmake new file mode 100644 index 000000000..8bbf3258e --- /dev/null +++ b/ports/hsm-collector/portfile.cmake @@ -0,0 +1,44 @@ +# Registry port for the native HSM collector (hsm-collector). +# +# Unlike the in-repo OVERLAY port (src/native/collector/vcpkg-port), which builds from the adjacent +# source tree so CI can verify the current branch, this port fetches a tagged source tarball. That +# makes this repository usable as a vcpkg registry: a consumer references it and runs +# `vcpkg install hsm-collector` with no checkout of the HSM sources. +# +# To publish a new version: push a `collector-v` tag, update REF + SHA512 below and the +# version in vcpkg.json, then run `vcpkg x-add-version hsm-collector` to refresh versions/. +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO SoftFx/Hierarchical-Sensor-Monitoring + REF collector-v0.6.2 + SHA512 6835207a04cb013fd370c6745e0faafe98a531ab356c896d2ec484a67eb1e978dad206fbfe1d5cf9232ade325a789c9ff3245d978bc97dac13f888bf4ca8e1b4 + HEAD_REF master +) + +# The collector lives in a subdirectory of the repository tarball. +set(SOURCE_PATH "${SOURCE_PATH}/src/native/collector") + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + http HSM_COLLECTOR_HTTP +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DHSM_COLLECTOR_BUILD_TESTS=OFF + -DHSM_COLLECTOR_BUILD_EXAMPLES=OFF + -DHSM_COLLECTOR_INSTALL=ON + ${FEATURE_OPTIONS} +) + +vcpkg_cmake_install() + +# The project installs its package config to lib/cmake/hsm_collector; relocate it to the +# vcpkg-canonical share/hsm_collector and fix up the absolute paths. +vcpkg_cmake_config_fixup(PACKAGE_NAME hsm_collector CONFIG_PATH lib/cmake/hsm_collector) + +# Header-only wrapper + static C core: no debug headers, and the static core has no DLLs/tools. +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${CMAKE_CURRENT_LIST_DIR}/copyright") diff --git a/ports/hsm-collector/vcpkg.json b/ports/hsm-collector/vcpkg.json new file mode 100644 index 000000000..6a45aca98 --- /dev/null +++ b/ports/hsm-collector/vcpkg.json @@ -0,0 +1,29 @@ +{ + "name": "hsm-collector", + "version": "0.6.2", + "description": "Native C++ HSM DataCollector — stable C ABI core + header-only RAII C++ wrapper.", + "homepage": "https://github.com/SoftFx/Hierarchical-Sensor-Monitoring", + "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "http": { + "description": "libcurl HTTP transport (Schannel on Windows, OpenSSL elsewhere)", + "dependencies": [ + { + "name": "curl", + "default-features": false, + "features": ["ssl"] + } + ] + } + } +} diff --git a/src/native/collector/conanfile.py b/src/native/collector/conanfile.py index e0ecb3b14..88cec9f65 100644 --- a/src/native/collector/conanfile.py +++ b/src/native/collector/conanfile.py @@ -18,7 +18,7 @@ class HsmCollectorConan(ConanFile): """ name = "hsm-collector" - version = "0.4.0" + version = "0.6.2" license = "See repository (SoftFx/Hierarchical-Sensor-Monitoring)" url = "https://github.com/SoftFx/Hierarchical-Sensor-Monitoring" description = "Native C++ HSM DataCollector — stable C ABI core + header-only RAII C++ wrapper." diff --git a/src/native/collector/vcpkg-port/vcpkg.json b/src/native/collector/vcpkg-port/vcpkg.json index d5d8fdef6..6a45aca98 100644 --- a/src/native/collector/vcpkg-port/vcpkg.json +++ b/src/native/collector/vcpkg-port/vcpkg.json @@ -1,6 +1,6 @@ { "name": "hsm-collector", - "version": "0.4.0", + "version": "0.6.2", "description": "Native C++ HSM DataCollector — stable C ABI core + header-only RAII C++ wrapper.", "homepage": "https://github.com/SoftFx/Hierarchical-Sensor-Monitoring", "supports": "!uwp", diff --git a/versions/baseline.json b/versions/baseline.json new file mode 100644 index 000000000..58ec710b1 --- /dev/null +++ b/versions/baseline.json @@ -0,0 +1,8 @@ +{ + "default": { + "hsm-collector": { + "baseline": "0.6.2", + "port-version": 0 + } + } +} From 1f6117320db5a04d5e7c7a66e72ef346e998bff4 Mon Sep 17 00:00:00 2001 From: Andrei Date: Thu, 16 Jul 2026 15:00:51 +0200 Subject: [PATCH 2/4] vcpkg registry: version DB entry (0.6.2) + validation workflow --- .github/workflows/hsm-collector-registry.yml | 58 ++++++++++++++++++++ versions/h-/hsm-collector.json | 8 +++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/hsm-collector-registry.yml create mode 100644 versions/h-/hsm-collector.json diff --git a/.github/workflows/hsm-collector-registry.yml b/.github/workflows/hsm-collector-registry.yml new file mode 100644 index 000000000..d7f1560cf --- /dev/null +++ b/.github/workflows/hsm-collector-registry.yml @@ -0,0 +1,58 @@ +name: hsm-collector vcpkg registry + +# Validates that this repository works as a vcpkg registry for `hsm-collector`: +# 1. the version database (versions/) is internally consistent with the ports (ports/), and +# 2. the registry port installs (fetching the tagged source) and a consumer links against it. +# Windows-only: the aggregator target is Windows/MSVC, and the version-DB check is platform-agnostic. + +on: + push: + paths: + - 'ports/hsm-collector/**' + - 'versions/**' + - '.github/workflows/hsm-collector-registry.yml' + pull_request: + paths: + - 'ports/hsm-collector/**' + - 'versions/**' + - 'src/native/collector/**' + - '.github/workflows/hsm-collector-registry.yml' + workflow_dispatch: + +jobs: + registry-consume: + runs-on: windows-latest + env: + VCPKG_DISABLE_METRICS: '1' + steps: + - uses: actions/checkout@v4 + + - name: Set up vcpkg + uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: 6f29f12e82a8293156836ad81cc9bf5af41fe836 + + - name: Verify the version database matches the ports + shell: bash + run: | + "$VCPKG_ROOT/vcpkg" x-verify-versions --verbose \ + --x-builtin-ports-root=ports \ + --x-builtin-registry-versions-dir=versions + + - name: Install hsm-collector from the registry port (fetches the tagged source) + shell: bash + # run-vcpkg defaults the binary cache to a GHA backend that needs tokens not reliably present + # here; override to "clear" so the port builds from source (same fix as the other consume lanes). + env: + VCPKG_BINARY_SOURCES: clear + run: | + "$VCPKG_ROOT/vcpkg" install hsm-collector --overlay-ports=ports --triplet x64-windows + + - name: Build a consumer against the installed package + shell: bash + run: | + cmake -S src/native/collector/examples/console/standalone -B build/registry-consume \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" \ + -DVCPKG_TARGET_TRIPLET=x64-windows + cmake --build build/registry-consume --config Release --parallel diff --git a/versions/h-/hsm-collector.json b/versions/h-/hsm-collector.json new file mode 100644 index 000000000..08dbde090 --- /dev/null +++ b/versions/h-/hsm-collector.json @@ -0,0 +1,8 @@ +{ + "versions": [ + { + "version": "0.6.2", + "git-tree": "bbc02d7505419f4a24e6c584d4a1d9643db4b6d9" + } + ] +} From 76262a6f65c84e4708527eb1d6ab8e787e0eec43 Mon Sep 17 00:00:00 2001 From: Andrei Date: Thu, 16 Jul 2026 15:03:52 +0200 Subject: [PATCH 3/4] registry CI: use x-ci-verify-versions; run consume test first --- .github/workflows/hsm-collector-registry.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/hsm-collector-registry.yml b/.github/workflows/hsm-collector-registry.yml index d7f1560cf..9a5312dba 100644 --- a/.github/workflows/hsm-collector-registry.yml +++ b/.github/workflows/hsm-collector-registry.yml @@ -32,13 +32,6 @@ jobs: with: vcpkgGitCommitId: 6f29f12e82a8293156836ad81cc9bf5af41fe836 - - name: Verify the version database matches the ports - shell: bash - run: | - "$VCPKG_ROOT/vcpkg" x-verify-versions --verbose \ - --x-builtin-ports-root=ports \ - --x-builtin-registry-versions-dir=versions - - name: Install hsm-collector from the registry port (fetches the tagged source) shell: bash # run-vcpkg defaults the binary cache to a GHA backend that needs tokens not reliably present @@ -56,3 +49,10 @@ jobs: -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" \ -DVCPKG_TARGET_TRIPLET=x64-windows cmake --build build/registry-consume --config Release --parallel + + - name: Verify the version database matches the ports + shell: bash + run: | + "$VCPKG_ROOT/vcpkg" x-ci-verify-versions --verbose \ + --x-builtin-ports-root=ports \ + --x-builtin-registry-versions-dir=versions From 7104ab964b54d24af2c6026013c32e9d245c3cfc Mon Sep 17 00:00:00 2001 From: Andrei Date: Thu, 16 Jul 2026 15:07:00 +0200 Subject: [PATCH 4/4] registry CI: replace whole-registry verify with precise git-tree check --- .github/workflows/hsm-collector-registry.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/hsm-collector-registry.yml b/.github/workflows/hsm-collector-registry.yml index 9a5312dba..ce5267613 100644 --- a/.github/workflows/hsm-collector-registry.yml +++ b/.github/workflows/hsm-collector-registry.yml @@ -50,9 +50,19 @@ jobs: -DVCPKG_TARGET_TRIPLET=x64-windows cmake --build build/registry-consume --config Release --parallel - - name: Verify the version database matches the ports + - name: Verify the version database git-tree matches the port shell: bash + # This is a supplementary registry (it provides only hsm-collector; upstream deps like + # vcpkg-cmake/curl come from the default registry), so vcpkg's whole-registry x-ci-verify-versions + # isn't applicable. Assert the one invariant that matters: versions/h-/hsm-collector.json records + # the exact git-tree of ports/hsm-collector, so git-registry consumers resolve the right port. run: | - "$VCPKG_ROOT/vcpkg" x-ci-verify-versions --verbose \ - --x-builtin-ports-root=ports \ - --x-builtin-registry-versions-dir=versions + recorded=$(grep -oiE '[0-9a-f]{40}' versions/h-/hsm-collector.json | head -1) + actual=$(git rev-parse "HEAD:ports/hsm-collector") + echo "recorded git-tree: $recorded" + echo "actual git-tree: $actual" + if [ "$recorded" != "$actual" ]; then + echo "::error::versions/h-/hsm-collector.json git-tree is stale. Run 'vcpkg x-add-version hsm-collector' (or update it to $actual)." + exit 1 + fi + echo "version database git-tree is consistent."