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
26 changes: 25 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
;;
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 <eduardo@calyptia.com>")
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 "/")

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
15 changes: 15 additions & 0 deletions tests/installed_consumer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
40 changes: 40 additions & 0 deletions tests/installed_consumer/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include <stdint.h>
#include <string.h>

#include <cfl/cfl.h>

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;
}
Loading