build-and-test

Documents the Makefile, CMake, and CI build-and-test pipeline for the strata C++20 Python extension.

Updated Nov 20, 2025
One-click install
npx skills add https://github.com/PrimeLab-Foundation/strata --skill build-and-test-primelab-foundation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-and-test
Source: https://github.com/PrimeLab-Foundation/strata/tree/main/docs/build-and-test
Command: npx skills add https://github.com/PrimeLab-Foundation/strata --skill build-and-test-primelab-foundation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It gives an AI or developer the authoritative map of the strata project's build and test system — Makefile targets, test-gated installs, C++/Python test architecture, fuzzing, coverage, PGO builds, and CI workflows — so changes to build tooling do not silently break gates or reproduce known-broken patterns from the previous implementation. ## Core Features & Use Cases - Build pipeline reference: Documents setup.py's test-gated build, compiler flags, LTO/PGO knobs (including clang-cl and MSVC variants), and the single-source-of-truth core_sources.txt manifest. - Test architecture guide: Explains the single CMake/ctest registry, the tests/py vs tests/unit mirrored suites, the committed fuzz corpus, and the ASan/UBSan sanitized-bindings gate with its five failure-prone mechanics. - CI workflow inventory: Describes ci.yml, benchmark.yml, fuzz.yml, and pgo.yml, plus a do-not-reproduce list of broken tooling from the previous implementation. - Use Case: Before editing the Makefile, setup.py, CMakeLists.txt, scripts/, tests/, or .github/workflows/, load this Skill to learn which targets exist, which gates run where, and which historical mistakes to avoid. ## Quick Start Load the build-and-test skill before modifying the Makefile or CI workflows and ask which targets and gates your change must keep green.

Frequently Asked Questions about build-and-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run the C++ and Python tests for the strata project?

Run make test, which executes make test-cpp (ctest via scripts/cpp_tests.py) and make test-py (pytest over tests/py and tests/unit via scripts/py_tests.py). For a full compliance pass including coverage, run make gate.

How do I add a new C++ test suite to the CMake build?

Add one strata_add_cpp_test(target, source...) line to CMakeLists.txt, which is the single test registry. A glob over tests/cpp/test_*.cpp fails configure if any suite is left unregistered, so nothing can sit outside the registry.

Does the strata build support PGO and LTO optimization?

Yes. Set STRATA_ENABLE_LTO=1 for thin LTO and PGO_MODE=generate|use with STRATA_PGO_PROFILE for profile-guided optimization. scripts/pgo_build.sh drives the full instrument-train-rebuild flow, with clang-cl and MSVC variants on Windows.

Why does make fuzz fail on macOS with Apple clang?

Apple's clang ships no libFuzzer runtime, so the configure-time probe stops with an actionable message. Install Homebrew LLVM (brew install llvm); scripts/fuzz.sh selects it automatically on macOS.

Can I skip the test gates during pip install with SKIP_TESTS?

SKIP_TESTS=1 skips the test-gated build locally, but it is refused when the CI environment variable is set. The gates exist so every editable install runs the C++ suite before compiling and both Python suites after.

What are the limitations of the ASan sanitized Python test gate?

make test-py-asan requires a non-SIP-protected interpreter on macOS (Homebrew or python.org, not /usr/bin/python3) and a copy of the tracked tree rather than the working directory. The Linux CI half was written but unexercised at documentation time.