Skip to content
Merged
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
16 changes: 12 additions & 4 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ cmake --build --preset=test --parallel 2
ctest --preset=test --output-on-failure --no-tests=error
```

CTest registers `std_test` and `example`, not individual doctest cases.
CTest registers `std_test`, `std_in_source_tests`, and `example`, not individual
doctest cases. The generated in-source runner has no cases until private tests
are added to production translation units.
Run a single doctest case directly after building:

```sh
Expand Down Expand Up @@ -59,8 +61,9 @@ cmake --build --preset=docs
```

The generated site is `build/docs/html/index.html`. CI tests Ubuntu GCC,
Ubuntu Clang, macOS, and Windows, runs clang-tidy, and checks installed
package artifacts. The docs CI job runs on published releases.
Ubuntu Clang, macOS, and Windows and runs clang-tidy using source builds only.
Do not add or run installation, installed-consumer, or package-artifact tests.
The docs CI job runs on published releases.

## Architecture

Expand Down Expand Up @@ -111,11 +114,16 @@ package artifacts. The docs CI job runs on published releases.

## Tests and documentation

`tests/std_test.cpp` owns the doctest main. Its `evaluate<R>` helper destroys
`tests/std_test.cpp` owns the public-contract doctest main. Its `evaluate<R>` helper destroys
the parser before executing the emitted program, so expression tests also
exercise callback lifetime. The scalar case table covers both ordinary and
receiver syntax; separate cases cover closures, overload coexistence,
rejected signatures, floating-point edge cases, and tuple structure.
Keep these public-interface tests external. Private tests, if added, belong in
their owning `.cpp` under `#if CPP_LIBRARY_TESTING()` after including
`<cpp-library/testing.hpp>`; guard doctest and test-only helpers there too.
Use the toolkit's thread, static-test-support, generated-runner, and 120-second
timeout defaults. Standalone tests must not receive the private `src` include root.

`examples/example.cpp` is compiled and run by CTest and included directly
in the Doxygen tutorial. Keep that example consistent with the tutorial.
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,6 @@ jobs:
- name: Test
run: ctest --preset=test

- name: Build and Install
run: |
cmake --preset=default
cmake --build --preset=default
cmake --install build/default --prefix "${{ runner.temp }}/install"
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
if: ${{ matrix.cc }}

- name: Build and Install
run: |
cmake --preset=default
cmake --build --preset=default
cmake --install build/default --prefix "${{ runner.temp }}/install"
if: ${{ !matrix.cc }}

- name: Check installed package artifacts
run: |
cmake "-DPACKAGE_TEST_PREFIX=${{ runner.temp }}/install" -P build/default/cpp-library-test-package.cmake

clang-tidy:
runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion .scout/memory/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
## Knowledge

- [[knowledge/initialize-shared-installation-defaults-before-cel-dependencies.md|Initialize shared installation defaults before CEL dependencies]] (pattern, 0.80) `cel-install` `cpp_library_setup` `cpmaddpackage` `installation-defaults` `fresh-cmake-cache`
- [[knowledge/keep-ci-generation-and-package-checks-owned-by-cpp-library.md|Keep CI generation and package checks owned by cpp-library]] (decision, 1.00) `cpp-library` `generated-ci` `packaging` `cpm`
- [[knowledge/keep-ci-generation-and-package-checks-owned-by-cpp-library.md|Keep source-only CI generation owned by cpp-library]] (decision, 1.00) `cpp-library` `generated-ci` `packaging` `cpm`
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ Keep cel-std's cpp_library_setup call before the cel-parser CPMAddPackage call;

CEL packages share the CEL_INSTALL cache option. cpp-library initializes it from PROJECT_IS_TOP_LEVEL only on its first declaration. If a nested parser/runtime package declares it first, a fresh build can cache OFF and cel-std installs nothing. Initializing the root through cpp_library_setup first gives the intended top-level default while preserving an explicit CEL_INSTALL=OFF. Do not restore a library-specific predeclaration of the shared option.

When changing dependency/setup order, verify Release installation with a fresh CMake cache and no explicit CEL_INSTALL value, then verify the explicit OFF case. A previously configured cache retaining ON can hide this regression; use the generated package-artifact check to detect a missing installation.
When changing dependency/setup order, inspect a fresh source-build CMake cache to confirm CEL_INSTALL's default and explicit OFF handling. Do not exercise installation or package-artifact tests; the user requires source-only validation.

Aliases / also known as: CEL_INSTALL, cpp_library_setup, CPMAddPackage, installation defaults, fresh CMake cache
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Keep CI generation and package checks owned by cpp-library"
title: "Keep source-only CI generation owned by cpp-library"
entity_type: decision
confidence: 1.00
created: 2026-11-19T22:20:43Z
Expand All @@ -8,17 +8,17 @@ last_reinforced: 2026-11-19T22:20:43Z
access_count: 1
sources:
- ".github/workflows/ci.yml:1-4"
- ".github/workflows/ci.yml:78-80"
- "CMakeLists.txt:4"
- "User input: \"the CI yaml is intended to come from cpp-library without modification or it will be overridden. And the shorthand for for CPMAddPackage() is intended.\""
tags: ["cpp-library", "generated-ci", "packaging", "cpm"]
tier: knowledge
source: user
---

# Keep CI generation and package checks owned by cpp-library
# Keep source-only CI generation owned by cpp-library

Treat .github/workflows/ci.yml as generated output: fix its template or shared packaging checks in stlab/cpp-library and regenerate, rather than hand-editing the client workflow. Preserve intended CPMAddPackage shorthand; do not expand dependency declarations merely to change installation eligibility.
Treat .github/workflows/ci.yml as generated output: fix its template or shared source-build checks in stlab/cpp-library and regenerate, rather than hand-editing the client workflow. Preserve intended CPMAddPackage shorthand; do not expand dependency declarations merely to change installation eligibility.

Use cpp-library's generated package-artifact check for packaging validation. Do not add or run project-specific installed-package consumption tests beyond cpp-library's provided checks (user-wide rule).
cpp-library 6.2.0 generates source-only CI. Do not add or run installation, installed-consumer, or package-artifact tests, including any inherited toolkit checks. Retain the opt-in install preset without exercising it (user-wide rule).

A successful documentation build does not prove Pages publication. Diagnose build, artifact upload, and deployment separately; published-release docs behavior belongs to the upstream workflow template. Distinguish generated find_dependency metadata from physically installing dependency packages.
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
"$gcc",
"$msCompile"
],
"detail": "Release build for installation with CPM_USE_LOCAL_PACKAGES enabled for testing installed packages Requires the CMake Tools extension (ms-vscode.cmake-tools) — without it, this task fails to start.",
"detail": "Release build for installation, preferring locally installed dependencies before fetching. Requires the CMake Tools extension (ms-vscode.cmake-tools) — without it, this task fails to start.",
"windows": {
"options": {
"shell": {
Expand Down
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.24)

include(cmake/CPM.cmake)
CPMAddPackage("gh:stlab/cpp-library@6.1.0")
CPMAddPackage("gh:stlab/cpp-library@6.2.0")
include("${cpp-library_SOURCE_DIR}/cpp-library.cmake")
cpp_library_enable_dependency_tracking()

Expand All @@ -23,5 +23,15 @@ cpp_library_setup(
DOCS_OPTIONS
"USE_MDFILE_AS_MAINPAGE = ${CMAKE_CURRENT_SOURCE_DIR}/README.md"
)
CPMAddPackage("gh:stlab/cel-parser@1.1.1")
CPMAddPackage("gh:stlab/cel-parser@1.1.2")
target_link_libraries(std PUBLIC cel::parser)

# Standalone tests use public headers, not the toolkit's private source include root.
get_property(directory_targets DIRECTORY PROPERTY BUILDSYSTEM_TARGETS)
foreach(directory_target IN LISTS directory_targets)
get_target_property(include_directories "${directory_target}" INCLUDE_DIRECTORIES)
if(include_directories)
list(REMOVE_ITEM include_directories "${CMAKE_CURRENT_SOURCE_DIR}/src")
set_property(TARGET "${directory_target}" PROPERTY INCLUDE_DIRECTORIES "${include_directories}")
endif()
endforeach()
8 changes: 7 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"binaryDir": "${sourceDir}/build/default",
"generator": "Ninja",
"cacheVariables": {
"CEL_INSTALL": "OFF",
"CMAKE_BUILD_TYPE": "Release",
"BUILD_TESTING": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
Expand All @@ -22,6 +23,7 @@
"binaryDir": "${sourceDir}/build/test",
"generator": "Ninja",
"cacheVariables": {
"CEL_INSTALL": "OFF",
"CMAKE_BUILD_TYPE": "Debug",
"BUILD_TESTING": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
Expand All @@ -36,6 +38,7 @@
"binaryDir": "${sourceDir}/build/docs",
"generator": "Ninja",
"cacheVariables": {
"CEL_INSTALL": "OFF",
"CMAKE_BUILD_TYPE": "Release",
"BUILD_TESTING": "OFF",
"BUILD_DOCS": "ON",
Expand All @@ -51,6 +54,7 @@
"binaryDir": "${sourceDir}/build/clang-tidy",
"generator": "Ninja",
"cacheVariables": {
"CEL_INSTALL": "OFF",
"CMAKE_BUILD_TYPE": "Debug",
"BUILD_TESTING": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
Expand All @@ -66,6 +70,7 @@
"binaryDir": "${sourceDir}/build/init",
"generator": "Ninja",
"cacheVariables": {
"CEL_INSTALL": "OFF",
"CMAKE_BUILD_TYPE": "Release",
"BUILD_TESTING": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
Expand All @@ -77,10 +82,11 @@
{
"name": "install",
"displayName": "Install Configuration",
"description": "Release build for installation with CPM_USE_LOCAL_PACKAGES enabled for testing installed packages",
"description": "Release build for installation, preferring locally installed dependencies before fetching",
"binaryDir": "${sourceDir}/build/install",
"generator": "Ninja",
"cacheVariables": {
"CEL_INSTALL": "ON",
"CMAKE_BUILD_TYPE": "Release",
"BUILD_TESTING": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fails.

## Consume an installed package

Install `cel-runtime` 1.1.2 and `cel-parser` 1.1.1 separately before installing
Install `cel-runtime` 1.1.3 and `cel-parser` 1.1.2 separately before installing
`cel-std`. From the `cel-std` source directory, run:

```sh
Expand Down
Loading