Skip to content

Commit 95fe7d2

Browse files
build(pixi): package plotjuggler_sdk as a conda package + prefix.dev publish (#126)
* build(pixi): add SDK dev environment + tasks (configure/build/test/pack) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(pj_base): silence GCC 14 -Wstringop-overflow false-positive in protobuf_wire Add body.reserve(64) in Writer::message() so GCC 14's optimizer sees a non-zero initial capacity; without it the mid-end inliner concludes the local body vector has size 0 and emits a spurious -Wstringop-overflow on the appendVarint push_back path. GCC 15 does not emit the warning. The reserve() is a capacity hint only — behavior is identical. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * build(pixi): commit pixi.lock for reproducible solves Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: clarify pack output-dir rationale + reserve() comment (review feedback) * build(conda): add rattler-build recipe for plotjuggler_sdk Packages the SDK as a conda artifact via rattler-build. The recipe drives cmake -DPJ_INSTALL_SDK=ON, suppresses fmt/fast_float run_exports (both are BUILD_INTERFACE-only in the installed targets), and validates the output with four file-existence tests (Config.cmake, ConfigVersion.cmake, PjPluginManifest.cmake, libpj_base.a). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(conda): correct license to Apache-2.0 (recipe wrongly said MIT AND Apache-2.0) * test(conda): build example consumer in package test + pin nlohmann_json run range Exercises find_package(plotjuggler_sdk) + plugin link + pj_emit_plugin_manifest on every build (all platforms), not just file-existence. Run-deps nlohmann_json >=3.12,<4. * ci(conda): tag-gated build + publish to prefix.dev (linux-64) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ci(conda): guard recipe.yaml version too + document workflow_dispatch (review feedback) * ci(conda): guard CMakeLists PJ_PACKAGE_VERSION + pin rattler-build to CI's 0.66.2 Final integration review: the SDK version is hardcoded in three places (conanfile.py, recipe.yaml, CMakeLists.txt PJ_PACKAGE_VERSION); the publish guard now checks all three against the tag. Align the dev pack tool to the exact rattler-build the CI uses. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e775917 commit 95fe7d2

6 files changed

Lines changed: 2338 additions & 0 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: conda-release
2+
3+
# Build + publish the SDK conda package to the prefix.dev "plotjuggler" channel
4+
# on tag push. Requires repo secret PREFIX_API_KEY = a prefix.dev token with
5+
# write access to the "plotjuggler" channel.
6+
on:
7+
push:
8+
tags:
9+
- "v*"
10+
# Manual dispatch builds the current conanfile.py/recipe.yaml version (no tag
11+
# guard); idempotent via `rattler-build upload --skip-existing`.
12+
workflow_dispatch: {}
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
build-and-upload:
19+
name: ${{ matrix.os }}
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ubuntu-22.04] # extend to macos-15-intel, windows-2022 in a later task
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Verify tag matches all version sources
30+
if: startsWith(github.ref, 'refs/tags/v')
31+
shell: bash
32+
run: |
33+
tag="${GITHUB_REF_NAME#v}"
34+
# The SDK version is hardcoded in three places that must agree with the tag:
35+
# conanfile.py version = "..." (Conan package + the tag guard)
36+
# recipe.yaml context.version "..." (embedded in the published .conda)
37+
# CMakeLists.txt PJ_PACKAGE_VERSION "..." (baked into ConfigVersion.cmake,
38+
# matched by find_package(... <ver>))
39+
conan_ver="$(grep -E '^\s*version\s*=' conanfile.py | head -1 | sed -E 's/.*"(.*)".*/\1/')"
40+
recipe_ver="$(grep -E '^[[:space:]]+version:[[:space:]]*"' recipe.yaml | head -1 | sed -E 's/.*"(.*)".*/\1/')"
41+
cmake_ver="$(grep -E 'set\(PJ_PACKAGE_VERSION' CMakeLists.txt | head -1 | sed -E 's/.*"(.*)".*/\1/')"
42+
echo "tag=$tag conanfile.py=$conan_ver recipe.yaml=$recipe_ver CMakeLists.txt=$cmake_ver"
43+
fail=0
44+
for pair in "conanfile.py:$conan_ver" "recipe.yaml:$recipe_ver" "CMakeLists.txt:$cmake_ver"; do
45+
if [ "$tag" != "${pair#*:}" ]; then
46+
echo "::error::Tag v$tag does not match ${pair%%:*} version (${pair#*:})"
47+
fail=1
48+
fi
49+
done
50+
[ "$fail" -eq 0 ]
51+
52+
- name: Install rattler-build
53+
uses: prefix-dev/rattler-build-action@v0.2.38
54+
with:
55+
setup-only: true
56+
rattler-build-version: v0.66.2
57+
58+
- name: Build conda package
59+
shell: bash
60+
run: |
61+
rattler-build build \
62+
--recipe recipe.yaml \
63+
--channel conda-forge \
64+
--output-dir "${{ runner.temp }}/conda-output"
65+
66+
- name: Upload to prefix.dev (plotjuggler)
67+
shell: bash
68+
env:
69+
PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }}
70+
run: |
71+
find "${{ runner.temp }}/conda-output" -name '*.conda' -print0 \
72+
| xargs -0 rattler-build upload prefix --channel plotjuggler --skip-existing

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ pj_media/testdata/
99
/.vscode/*
1010
/CMakeUserPresets.json
1111
/aqtinstall.log
12+
/.pixi/
13+
/output/
14+
/build-test/

0 commit comments

Comments
 (0)