From 570bc6d66ad6e18c956f2e52ce848d3f5d08c5ab Mon Sep 17 00:00:00 2001 From: Joe Rivera Date: Mon, 20 Jul 2026 17:14:50 -0500 Subject: [PATCH 1/2] ci: draft recipe-first build workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Draft of the recipe-first CI path: build libcvc from its in-tree cvcpkg recipe (recipes/libcvc) instead of apt + cvc-requirements.yaml + hand-written cmake. The same `cvcpkg build libcvc --recipes-dir recipes` a developer runs locally is what CI runs, with cvcpkg as the sole source of third-party deps on every platform. Includes a find_package(cvc CONFIG) smoke test that writes and reads back a .rawiv (exercising the #111 write path end to end). Gated on workflow_dispatch (not PRs) until the closure is published to the cvcpkg catalog — libxml2 and the ImageMagick delegates need published bundles per platform (or --fallback-to-source), and Windows needs bundles published at all. Publishing is blocked on the cvcpkg token rotation. Once unblocked, flip the trigger to pull_request/push and retire the matching ci.yml jobs. --- .github/workflows/ci-recipe.yml | 115 ++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/workflows/ci-recipe.yml diff --git a/.github/workflows/ci-recipe.yml b/.github/workflows/ci-recipe.yml new file mode 100644 index 00000000..9d7ce06a --- /dev/null +++ b/.github/workflows/ci-recipe.yml @@ -0,0 +1,115 @@ +name: CI (recipe-first) [DRAFT] + +# ───────────────────────────────────────────────────────────────────────── +# DRAFT recipe-first build path. +# +# This is the intended replacement for the apt + cvc-requirements.yaml + +# hand-written `cmake` steps in ci.yml. Instead it builds libcvc from its +# in-tree cvcpkg recipe (recipes/libcvc/), which declares the full +# third-party closure — so the same recipe a developer runs locally +# +# cvcpkg build libcvc --recipes-dir recipes --prefix /tmp/libcvc +# +# is exactly what CI runs. No apt/brew library installs; cvcpkg is the sole +# source of third-party deps on every platform. +# +# ── Why this is still a draft (workflow_dispatch only, not on PRs) ── +# It cannot go green until the closure is *published* to the cvcpkg catalog: +# * libxml2 (new — transfix/libcvc-deps#335) and the ImageMagick delegates +# the libcvc recipe now pulls in (libjpeg-turbo/libpng/libwebp/freetype) +# need published bundles for each platform tuple, otherwise cvcpkg errors +# with "no bundles found in catalog" (unless run with +# --fallback-to-source, which source-builds the whole stack — very slow). +# * Windows has no published dep bundles at all yet. +# Publishing is currently blocked on the cvcpkg token rotation. Once that is +# resolved and the bundles are published, flip the `on:` trigger to +# pull_request/push and retire the corresponding jobs in ci.yml. +# ───────────────────────────────────────────────────────────────────────── + +on: + workflow_dispatch: + inputs: + fallback_to_source: + description: "Build any unpublished deps from source (slow)" + type: boolean + default: false + +jobs: + build-recipe: + name: recipe / ${{ matrix.os }} / ${{ matrix.build_type }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + build_type: [Release, Debug] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + # The cvcpkg CLI itself (same pin used by publish-cvcpkg.yml). + - name: Install cvcpkg + shell: bash + run: pip install 'git+https://github.com/transfix/libcvc-deps@master' + + # Build libcvc and its declared closure from the in-tree recipe. + # cvcpkg fetches prebuilt dep bundles from the catalog and compiles only + # libcvc; with --fallback-to-source it also source-builds any dep that + # has no published bundle for this platform. + - name: Build libcvc from its recipe + shell: bash + run: | + set -euo pipefail + config=$(echo "${{ matrix.build_type }}" | tr '[:upper:]' '[:lower:]') + extra="" + if [ "${{ inputs.fallback_to_source }}" = "true" ]; then + extra="--fallback-to-source" + fi + cvcpkg build libcvc \ + --recipes-dir recipes \ + --prefix "${{ runner.temp }}/libcvc" \ + --config "$config" \ + $extra + + # Prove the installed SDK is consumable: find_package(cvc CONFIG) must + # resolve and a trivial program must link against cvc::cvc. + - name: Smoke-test the installed SDK + shell: bash + run: | + set -euo pipefail + prefix="${{ runner.temp }}/libcvc" + work="${{ runner.temp }}/consumer" + mkdir -p "$work" + cat > "$work/main.cpp" <<'CPP' + #include + #include + #include + int main() { + cvc::app app; // registers volume handlers + cvc::dimension dim(4, 4, 4); + cvc::bounding_box box(0, 0, 0, 1, 1, 1); + std::vector buf(4 * 4 * 4, 1.0f); + cvc::volume v(app, reinterpret_cast(buf.data()), dim, + cvc::Float, box); + v.write("smoke.rawiv"); // exercises the write path (#111) + cvc::volume r(app); + r.read("smoke.rawiv"); + return (r.XDim() == 4) ? 0 : 1; + } + CPP + cat > "$work/CMakeLists.txt" <<'CMK' + cmake_minimum_required(VERSION 3.16) + project(cvc_smoke LANGUAGES CXX) + set(CMAKE_CXX_STANDARD 20) + find_package(cvc CONFIG REQUIRED) + add_executable(smoke main.cpp) + target_link_libraries(smoke PRIVATE cvc::cvc) + CMK + cmake -S "$work" -B "$work/build" -DCMAKE_PREFIX_PATH="$prefix" + cmake --build "$work/build" + ( cd "$work/build" && ./smoke ) From b6561baec1254059e229d8fe48da03fd08d9f8f1 Mon Sep 17 00:00:00 2001 From: Joe Rivera Date: Mon, 20 Jul 2026 17:19:20 -0500 Subject: [PATCH 2/2] ci(draft): point recipe-first workflow at canonical cvcpkg/recipes dir --- .github/workflows/ci-recipe.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-recipe.yml b/.github/workflows/ci-recipe.yml index 9d7ce06a..4cb3857b 100644 --- a/.github/workflows/ci-recipe.yml +++ b/.github/workflows/ci-recipe.yml @@ -5,10 +5,10 @@ name: CI (recipe-first) [DRAFT] # # This is the intended replacement for the apt + cvc-requirements.yaml + # hand-written `cmake` steps in ci.yml. Instead it builds libcvc from its -# in-tree cvcpkg recipe (recipes/libcvc/), which declares the full +# in-tree cvcpkg recipe (cvcpkg/recipes/libcvc/), which declares the full # third-party closure — so the same recipe a developer runs locally # -# cvcpkg build libcvc --recipes-dir recipes --prefix /tmp/libcvc +# cvcpkg build libcvc --recipes-dir cvcpkg/recipes --prefix /tmp/libcvc # # is exactly what CI runs. No apt/brew library installs; cvcpkg is the sole # source of third-party deps on every platform. @@ -71,7 +71,7 @@ jobs: extra="--fallback-to-source" fi cvcpkg build libcvc \ - --recipes-dir recipes \ + --recipes-dir cvcpkg/recipes \ --prefix "${{ runner.temp }}/libcvc" \ --config "$config" \ $extra