Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions .github/workflows/ci-installed-consumer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: CI Installed Consumer

# Verifies that an external CMake project can:
# 1. find_package(siderust_cpp REQUIRED)
# 2. include <siderust/siderust.hpp>
# 3. link against siderust::siderust_cpp
# 4. run a binary that calls into the FFI at runtime
#
# This catches packaging regressions that unit tests in-tree cannot:
# - missing imported targets in siderust_cppConfig.cmake
# - missing shared libraries in the install prefix
# - broken transitive find_dependency(qtty_cpp / tempoch_cpp)

on:
workflow_call:

jobs:
installed-consumer:
name: Installed-package consumer
runs-on: ubuntu-22.04
env:
CARGO_TERM_COLOR: always
CMAKE_BUILD_PARALLEL_LEVEL: 2
steps:
- name: Checkout (with submodules)
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 1

- name: Install system dependencies
shell: bash
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
cmake \
ninja-build \
pkg-config \
libssl-dev

- name: Set up Rust (stable)
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

- name: Cache cargo + build artifacts
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
siderust/target
siderust/siderust-ffi/target
tempoch-cpp/tempoch/target
tempoch-cpp/tempoch/tempoch-ffi/target
tempoch-cpp/qtty-cpp/qtty/target
tempoch-cpp/qtty-cpp/qtty/qtty-ffi/target
key: ${{ runner.os }}-cargo-installed-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Configure & install qtty-cpp (standalone)
shell: bash
run: |
set -euo pipefail
cmake -S tempoch-cpp/qtty-cpp -B build-qtty -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DQTTY_BUILD_DOCS=OFF
cmake --build build-qtty -j
cmake --install build-qtty --prefix "$GITHUB_WORKSPACE/stage"

- name: Configure & install tempoch-cpp (standalone, uses staged qtty-cpp)
shell: bash
run: |
set -euo pipefail
cmake -S tempoch-cpp -B build-tempoch -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DTEMPOCH_BUILD_DOCS=OFF \
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/stage"
cmake --build build-tempoch -j
cmake --install build-tempoch --prefix "$GITHUB_WORKSPACE/stage"

- name: Configure siderust-cpp against staged qtty/tempoch
shell: bash
run: |
set -euo pipefail
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DSIDERUST_BUILD_DOCS=OFF \
-DSIDERUST_CPP_BUILD_TESTS=OFF \
-DSIDERUST_CPP_BUILD_EXAMPLES=OFF \
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/stage"

- name: Build siderust_ffi (cdylib)
shell: bash
run: cmake --build build --target build_siderust_ffi -j

- name: Install siderust-cpp to staging prefix
shell: bash
run: cmake --install build --prefix "$GITHUB_WORKSPACE/stage"

- name: Configure external consumer against staged install
shell: bash
run: |
set -euo pipefail
cmake \
-S tests/installed-consumer \
-B build-consumer \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/stage"

- name: Build external consumer
shell: bash
run: cmake --build build-consumer --target smoke

- name: Run consumer smoke binary
shell: bash
run: |
set -euo pipefail
LD_LIBRARY_PATH="$GITHUB_WORKSPACE/stage/lib:${LD_LIBRARY_PATH:-}" \
./build-consumer/smoke
4 changes: 2 additions & 2 deletions .github/workflows/ci-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ jobs:
mkdir -p build/staging/lib
cp siderust/target/release/libsiderust_ffi.so \
tempoch-cpp/tempoch/tempoch-ffi/target/release/libtempoch_ffi.so \
tempoch-cpp/qtty-cpp/qtty/qtty-ffi/target/release/libqtty_ffi.so \
build/staging/lib/ || true
tempoch-cpp/qtty-cpp/qtty/target/release/libqtty_ffi.so \
build/staging/lib/

- name: Generate packages (CPack)
shell: bash
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ jobs:
needs: build-test-docs
uses: ./.github/workflows/ci-package.yml

release:
installed-consumer:
needs: package
uses: ./.github/workflows/ci-installed-consumer.yml

release:
needs: [package, installed-consumer]
if: startsWith(github.ref, 'refs/tags/v')
uses: ./.github/workflows/ci-release.yml
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ _deps/
coverage/

# Package manager
vcpkg_installed/
vcpkg_installed/stage/
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "tempoch-cpp"]
path = tempoch-cpp
url = git@github.com:Siderust/tempoch-cpp.git
url = https://github.com/Siderust/tempoch-cpp.git
[submodule "siderust"]
path = siderust
url = git@github.com:Siderust/siderust.git
url = https://github.com/Siderust/siderust.git
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,74 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- `tests/installed-consumer/` fixture and `.github/workflows/ci-installed-consumer.yml`
workflow exercising the full installed-package consumer path:
configure → build → install to a staging prefix → external CMake
project does `find_package(siderust_cpp REQUIRED)`, includes
`<siderust/siderust.hpp>`, links `siderust::siderust_cpp`, and runs a
runtime smoke binary against the bundled `libsiderust_ffi.so`.
- Top-level guards `PROJECT_IS_TOP_LEVEL` and explicit options
`SIDERUST_CPP_BUILD_TESTS`, `SIDERUST_CPP_BUILD_EXAMPLES`,
`SIDERUST_CPP_INSTALL`, `SIDERUST_CPP_ENABLE_PACKAGING` so siderust-cpp
is safe to consume via `add_subdirectory(...)` without dragging in
GoogleTest, examples, install rules, or CPack.
- `siderust::siderust_cpp` ALIAS target so build-tree consumers can use
the same namespaced target name as installed consumers.
- Pointer to a Phase-B work plan and public-API coverage matrix for the
upcoming dynamics-and-pod expansion (see plan.md in the session
workspace).

### Changed

- `.gitmodules` now uses HTTPS URLs (`https://github.com/Siderust/...`)
for both the `siderust` and `tempoch-cpp` submodules so public clones
and CI jobs without SSH credentials succeed.
- `cmake/siderust_cppConfig.cmake.in` rewritten:
- calls `find_dependency(qtty_cpp)` and `find_dependency(tempoch_cpp)`,
- defines `siderust::siderust_ffi` as a SHARED IMPORTED target that
points at the bundled `libsiderust_ffi.so` in the install prefix,
so consumers linking `siderust::siderust_cpp` resolve FFI symbols
transitively without manually setting `LD_LIBRARY_PATH` paths,
- includes the exported `siderust_cppTargets.cmake`,
- exposes `siderust_cpp_INCLUDE_DIRS` / `siderust_cpp_LIBRARIES`
legacy variables for non-target-based consumers.
- Top-level `CMakeLists.txt`:
- bumped minimum CMake to 3.21 (for `PROJECT_IS_TOP_LEVEL`),
- uses `GNUInstallDirs` (`CMAKE_INSTALL_INCLUDEDIR` /
`CMAKE_INSTALL_LIBDIR`) instead of hard-coded `include/` `lib/`,
- install/packaging/tests/examples are all gated on the new options.
- CPack DEB/RPM dependencies updated to the real upstream versions
pulled in by the current `siderust` submodule:
`qtty-cpp >= 0.8`, `tempoch-cpp >= 0.6` (was 0.4.2 / 0.3.1).
- `Dockerfile.prod` rust-builder stage now:
- sets `CARGO_TARGET_DIR=/src/tempoch-cpp/tempoch/tempoch-ffi/target`
when building `tempoch-ffi` so the artifact lands at the path the
cpp-builder stage expects,
- builds `qtty-ffi` with `cargo build -p qtty-ffi` from the qtty
workspace root so the artifact lands in
`/src/tempoch-cpp/qtty-cpp/qtty/target/release/` (not the previously
incorrect `qtty-ffi/target/release/` per-crate path that does not
exist for workspace members),
- source paths in the COPY blocks now match what the rust-builder
stage actually produces.

### Removed

- `include/siderust/constops.hpp`, `include/siderust/constops.h`, and
`tests/test_constops.cpp`. The constops Rust crate does not exist in
this workspace or in `siderust-ffi`, so the header declared symbols
that no library exported. Any consumer that included `constops.hpp`
would fail to link. The stub is gone; per the user-stated policy, no
deprecated/legacy code remains.
- `|| true` masking on the `cp` of Rust shared libraries to
`build/staging/lib/` in `.github/workflows/ci-package.yml`. Missing
shared libraries are now a hard CI failure rather than a silently
broken package.

## [0.5.0] - 2026-05-18

### Removed
Expand Down
Loading
Loading