diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b43f1ed..50dabc6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -208,7 +208,7 @@ jobs: strategy: fail-fast: false matrix: - consumer: [cmetrics, ctraces, fluent-bit] + consumer: [cmetrics, cprofiles, ctraces, fluent-bit] steps: - name: Check out CFL uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 @@ -259,6 +259,9 @@ jobs: cmetrics) cmake -S consumer -B build -DCMT_TESTS=On ;; + cprofiles) + cmake -S consumer -B build -DCPROF_TESTS=On + ;; ctraces) cmake -S consumer -B build -DCTR_TESTS=On ;; @@ -279,6 +282,26 @@ jobs: if: matrix.consumer != 'fluent-bit' run: ctest --test-dir build --output-on-failure + build-installed-consumer: + name: Build an installed CFL consumer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - name: Build and install CFL + run: | + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="$PWD/install" + cmake --build build -j2 + cmake --install build + - name: Build and run the external consumer + run: | + cmake -S tests/installed_consumer -B consumer-build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH="$PWD/install" + cmake --build consumer-build -j2 + ./consumer-build/cfl-installed-consumer + build-analysis-tests: name: Build with various code analysis tools strategy: @@ -330,6 +353,7 @@ jobs: - build-unix-amd64 - build-c-dialects - build-downstream + - build-installed-consumer - build-analysis-tests name: Required checks complete runs-on: ubuntu-latest diff --git a/AGENTS.md b/AGENTS.md index 8fccc62..2035269 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -55,6 +55,18 @@ before closing changes that touch shared code or public APIs. - If a relevant test cannot be run, report the exact blocker in the final response. +## Downstream Impact Validation +- For every modified CFL function, inspect callers in CFL, Fluent Bit, + cmetrics, ctraces, and cprofiles before closing the change. +- Check for side effects from changes to signatures, return values, error + handling, ownership, object lifetime, allocation behavior, and mutation + semantics. +- Distinguish production callers from bundled CFL source and test copies when + reporting impact. +- Run relevant downstream builds or tests when a change can affect an existing + caller. If a downstream checkout or required test is unavailable, report the + exact validation gap. + ## Commit & Pull Request Guidelines - Follow observed local history style: `component: short imperative description` diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..8e72a65 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,31 @@ +# Changelog + +This file records the notable changes in each CFL release. + +## 1.0.0 - 2026-07-11 + +The first stable CFL release establishes the variant, container, utility, and +optional arena interfaces used by Fluent Bit and its companion telemetry +libraries. + +### Highlights + +- Added optional arena allocation for strings, variants, arrays, and key/value + lists, including reset, cache control, ownership validation, benchmarks, and + lifecycle documentation. +- Added case-sensitive and case-insensitive key/value lookup variants. +- Strengthened container ownership and cycle validation for mutable variant + graphs. +- Improved allocation failure handling and made dynamic-string formatting + preserve the original value when growth fails. +- Improved portability across GNU C99 and GNU C17, ARM64, Windows, macOS, and + supported Linux environments. +- Expanded sanitizer, Valgrind, installed-consumer, and downstream validation + for Fluent Bit, cmetrics, ctraces, and cprofiles. +- Installed the bundled xxHash archive with its headers so installed consumers + can use CFL's public hash interface. + +### Behavior changes + +- `cfl_array_remove_by_reference()` now returns `-1` when the supplied variant + is not present in the array. diff --git a/CMakeLists.txt b/CMakeLists.txt index 6038fcc..5484ff8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,9 +9,9 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # C Floppy Version -set(CFL_VERSION_MAJOR 0) -set(CFL_VERSION_MINOR 7) -set(CFL_VERSION_PATCH 1) +set(CFL_VERSION_MAJOR 1) +set(CFL_VERSION_MINOR 0) +set(CFL_VERSION_PATCH 0) set(CFL_VERSION_STR "${CFL_VERSION_MAJOR}.${CFL_VERSION_MINOR}.${CFL_VERSION_PATCH}") # Configuration options @@ -115,6 +115,7 @@ include_directories( # xxHash if(NOT TARGET xxhash) # Do something when target found + set(CFL_BUNDLED_XXHASH On) set(XXHASH_BUILD_ENABLE_INLINE_API OFF) set(XXHASH_BUILD_XXHSUM OFF) set(BUILD_SHARED_LIBS OFF) @@ -157,8 +158,8 @@ endif() set(CPACK_PACKAGE_VERSION ${CFL_VERSION_STR}) set(CPACK_PACKAGE_NAME "cfl") set(CPACK_PACKAGE_RELEASE 1) -set(CPACK_PACKAGE_CONTACT "Eduardo Silva ") -set(CPACK_PACKAGE_VENDOR "Calyptia") +set(CPACK_PACKAGE_CONTACT "CFL Authors") +set(CPACK_PACKAGE_VENDOR "Fluent Project") set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") set(CPACK_PACKAGING_INSTALL_PREFIX "/") diff --git a/README.md b/README.md index 6805bb4..d7c452d 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,8 @@ specific module headers they require. ## Documentation +- Release history: see [CHANGELOG.md](CHANGELOG.md) for notable changes in each + version. - Public API: the self-contained headers under [`include/cfl/`](include/cfl/) describe each supported interface. - Building and embedding: see the build and CMake examples above. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6e69868..86d3beb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -109,3 +109,9 @@ install(TARGETS cfl-static LIBRARY DESTINATION ${CFL_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CFL_INSTALL_LIBDIR} COMPONENT library) + +if(CFL_BUNDLED_XXHASH AND CFL_INSTALL_BUNDLED_XXHASH_HEADERS) + install(TARGETS xxhash + ARCHIVE DESTINATION ${CFL_INSTALL_LIBDIR} + COMPONENT library) +endif() diff --git a/tests/installed_consumer/CMakeLists.txt b/tests/installed_consumer/CMakeLists.txt new file mode 100644 index 0000000..2476828 --- /dev/null +++ b/tests/installed_consumer/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.20) +project(cfl_installed_consumer C) + +find_package(Threads REQUIRED) +find_path(CFL_INCLUDE_DIR NAMES cfl/cfl.h REQUIRED) +find_library(CFL_LIBRARY NAMES cfl REQUIRED) +find_library(XXHASH_LIBRARY NAMES xxhash REQUIRED) + +add_executable(cfl-installed-consumer main.c) +target_include_directories(cfl-installed-consumer PRIVATE ${CFL_INCLUDE_DIR}) +target_link_libraries(cfl-installed-consumer + PRIVATE + ${CFL_LIBRARY} + ${XXHASH_LIBRARY} + Threads::Threads) diff --git a/tests/installed_consumer/main.c b/tests/installed_consumer/main.c new file mode 100644 index 0000000..a65589a --- /dev/null +++ b/tests/installed_consumer/main.c @@ -0,0 +1,40 @@ +#include +#include + +#include + +int main(void) +{ + int result; + uint64_t hash; + struct cfl_array *array; + + result = cfl_init(); + if (result != 0) { + return 1; + } + + if (cfl_version() == NULL) { + return 1; + } + + array = cfl_array_create(1); + if (array == NULL) { + return 1; + } + + result = cfl_array_append_string(array, "installed"); + if (result != 0 || cfl_array_size(array) != 1) { + cfl_array_destroy(array); + return 1; + } + + hash = cfl_hash_64bits("installed", strlen("installed")); + cfl_array_destroy(array); + + if (hash == 0) { + return 1; + } + + return 0; +}