From 17c5303765599d7d80af4b4d7a6a2f376dc86b56 Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Tue, 15 Sep 2026 22:44:32 +0300 Subject: [PATCH 1/3] build(release): prepare v1.0.2 packaging and consumers Publish non-development documentation for matching release tags, correct relocatable pkg-config metadata, and cover pkg-config and clean archive consumers in CI. --- .github/workflows/ci.yml | 64 +++++++++++++++++++++++++ .github/workflows/publish.yaml | 15 +++++- CHANGELOG.md | 4 +- README-RU.md | 14 ++++++ README.md | 14 ++++++ cmake/log-it-cpp.pc.in | 5 +- docs/comparison-RU.md | 4 +- docs/comparison.md | 6 +-- docs/installation.md | 14 ++++++ tests/pkgconfig_consumer/CMakeLists.txt | 9 ++++ tests/pkgconfig_consumer/main.cpp | 8 ++++ 11 files changed, 145 insertions(+), 12 deletions(-) create mode 100644 tests/pkgconfig_consumer/CMakeLists.txt create mode 100644 tests/pkgconfig_consumer/main.cpp diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8632042..66e897ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -186,6 +186,70 @@ jobs: build-otlp/Testing/Temporary/LastTest.log if-no-files-found: ignore + linux-package-consumers: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - run: git submodule update --init --recursive + - name: Install package-consumer tools + run: sudo apt-get update && sudo apt-get install -y pkg-config + - name: Install TimeShield dependency + run: | + cmake -S external/time-shield-cpp -B build-timeshield \ + -DTIME_SHIELD_CPP_BUILD_TESTS=OFF \ + -DTIME_SHIELD_CPP_BUILD_EXAMPLES=OFF \ + -DTIME_SHIELD_ENABLE_NTP_CLIENT=OFF \ + -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install-timeshield" + cmake --build build-timeshield + cmake --install build-timeshield + - name: Build and install source package + run: | + cmake -S . -B build-package \ + -DLOGIT_CPP_BUILD_TESTS=OFF \ + -DLOGIT_WITH_SYSLOG=OFF \ + -DLOGIT_WITH_WIN_EVENT_LOG=OFF \ + -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install-logit" \ + -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install-timeshield" + cmake --build build-package + cmake --install build-package + - name: Configure pkg-config consumer + env: + PKG_CONFIG_PATH: ${{ github.workspace }}/install-logit/share/pkgconfig:${{ github.workspace }}/install-timeshield/lib/pkgconfig + run: | + pkg-config --exists log-it-cpp + test "$(pkg-config --modversion log-it-cpp)" = "1.0.2" + cmake -S tests/pkgconfig_consumer -B build-pkgconfig + - name: Build and run pkg-config consumer + run: | + cmake --build build-pkgconfig + ./build-pkgconfig/pkgconfig_consumer + - name: Create clean source archive + run: | + archive_root="$RUNNER_TEMP/logit-archive" + mkdir -p "$archive_root/source" + git archive --format=tar.gz --prefix=log-it-cpp/ HEAD > "$RUNNER_TEMP/log-it-cpp.tar.gz" + tar -xzf "$RUNNER_TEMP/log-it-cpp.tar.gz" -C "$archive_root/source" + - name: Build and install clean source archive + run: | + archive_source="$RUNNER_TEMP/logit-archive/source/log-it-cpp" + cmake -S "$archive_source" -B "$RUNNER_TEMP/logit-archive/build" \ + -DLOGIT_CPP_BUILD_TESTS=OFF \ + -DLOGIT_WITH_SYSLOG=OFF \ + -DLOGIT_WITH_WIN_EVENT_LOG=OFF \ + -DCMAKE_INSTALL_PREFIX="$RUNNER_TEMP/logit-archive/install" \ + -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install-timeshield" + cmake --build "$RUNNER_TEMP/logit-archive/build" + cmake --install "$RUNNER_TEMP/logit-archive/build" + - name: Build and run clean archive consumer + run: | + archive_source="$RUNNER_TEMP/logit-archive/source/log-it-cpp" + cmake -S "$archive_source/tests/install_consumer" -B "$RUNNER_TEMP/logit-archive/consumer" \ + -DCMAKE_PREFIX_PATH="$RUNNER_TEMP/logit-archive/install;$GITHUB_WORKSPACE/install-timeshield" + cmake --build "$RUNNER_TEMP/logit-archive/consumer" + "$RUNNER_TEMP/logit-archive/consumer/install_consumer" + windows: runs-on: windows-latest strategy: diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 72d1a1ef..4df15fc2 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -4,6 +4,8 @@ on: push: branches: - main + tags: + - 'v*' pull_request: branches: - main @@ -20,7 +22,7 @@ jobs: with: submodules: "true" fetch-depth: 0 - - name: Inject development version into mainpage.dox + - name: Inject documentation version into mainpage.dox run: | VERSION=$(sed -n 's/^project(log-it-cpp VERSION \([^ ]*\).*/\1/p' CMakeLists.txt | head -n 1) if [ -z "$VERSION" ]; then @@ -30,7 +32,16 @@ jobs: VERSION="0.0.0-untagged" fi fi - DOC_VERSION="${VERSION}-dev" + if [ "${GITHUB_EVENT_NAME:-}" = "push" ] && [ "${GITHUB_REF_TYPE:-}" = "tag" ]; then + TAG_VERSION="${GITHUB_REF_NAME#v}" + if [ "$TAG_VERSION" != "$VERSION" ]; then + echo "Release tag v${TAG_VERSION} does not match project version ${VERSION}." + exit 1 + fi + DOC_VERSION="$TAG_VERSION" + else + DOC_VERSION="${VERSION}-dev" + fi echo "Using version: $DOC_VERSION" echo "DOC_VERSION=$DOC_VERSION" >> "$GITHUB_ENV" test -f docs/mainpage.dox || { echo "mainpage.dox not found!"; exit 1; } diff --git a/CHANGELOG.md b/CHANGELOG.md index 53761f12..739d4e02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,7 @@ All notable changes to this project will be documented in this file. -## [Unreleased] - -Target release: **v1.0.2** +## [v1.0.2] - 2026-09-15 ### Added diff --git a/README-RU.md b/README-RU.md index a94128c6..3b883ba2 100644 --- a/README-RU.md +++ b/README-RU.md @@ -892,6 +892,20 @@ cmake --install build --prefix ./install поддерживаются только в source/build-tree; install намеренно завершается ошибкой вместо создания неработающего package. +### Потребитель через pkg-config + +При установке также создаётся модуль pkg-config `log-it-cpp`. Добавьте +каталоги pkg-config установленной библиотеки в `PKG_CONFIG_PATH` и используйте +флаги модуля при сборке consumer-проекта: + +```bash +export PKG_CONFIG_PATH=/path/to/install/share/pkgconfig:/path/to/install/lib/pkgconfig +c++ -std=c++11 $(pkg-config --cflags log-it-cpp) \ + app.cpp $(pkg-config --libs log-it-cpp) -o app +``` + +Модуль объявляет обязательную зависимость `time-shield`. + 4. (Необязательно) Включите макросы fmt: LogIt++ включает библиотеку *fmt* для форматирования с `{}`. Чтобы использовать макросы `LOGIT_FMT_*` и `LOGIT_SCOPE_FMT_*`, соберите библиотеку с опцией CMake `-DLOGIT_WITH_FMT=ON`. diff --git a/README.md b/README.md index 9553ac40..9ab942b1 100644 --- a/README.md +++ b/README.md @@ -1074,6 +1074,20 @@ Pass `-DCMAKE_PREFIX_PATH=/path/to/install` when configuring the consumer. currently supported for source/build-tree development only; the install step rejects them rather than exporting a broken package. +### pkg-config consumer + +The installation also provides a `log-it-cpp` pkg-config module. Set +`PKG_CONFIG_PATH` to the installation's pkg-config directories and use the +module's flags when compiling a consumer: + +```bash +export PKG_CONFIG_PATH=/path/to/install/share/pkgconfig:/path/to/install/lib/pkgconfig +c++ -std=c++11 $(pkg-config --cflags log-it-cpp) \ + app.cpp $(pkg-config --libs log-it-cpp) -o app +``` + +The module declares the required `time-shield` dependency. + 4. (Optional) Enable fmt-style macros: LogIt++ includes the *fmt* library for `{}`-based formatting. To use the `LOGIT_FMT_*` and `LOGIT_SCOPE_FMT_*` macros, build the library with the CMake option `-DLOGIT_WITH_FMT=ON`. diff --git a/cmake/log-it-cpp.pc.in b/cmake/log-it-cpp.pc.in index 0a8fab95..893ecd51 100644 --- a/cmake/log-it-cpp.pc.in +++ b/cmake/log-it-cpp.pc.in @@ -1,4 +1,4 @@ -prefix=@CMAKE_INSTALL_PREFIX@ +prefix=${pcfiledir}/../.. exec_prefix=${prefix} libdir=${prefix}/lib includedir=${prefix}/include @@ -6,5 +6,6 @@ includedir=${prefix}/include Name: log-it-cpp Description: LogIt C++ logging library Version: @PROJECT_VERSION@ -Cflags: -I${includedir} +Requires: time-shield +Cflags: -I${includedir}/logit_cpp Libs: diff --git a/docs/comparison-RU.md b/docs/comparison-RU.md index e71fe228..5208f07a 100644 --- a/docs/comparison-RU.md +++ b/docs/comparison-RU.md @@ -5,11 +5,11 @@ подходит лучше компактного string-oriented логгера, общего event framework или диагностической macro-утилиты?** -Сравнение проверено **10.09.2026** по следующим upstream-релизам: +Сравнение проверено **15.09.2026** по следующим upstream-релизам: | Проект | Проверенная версия | Основная документация | | --- | --- | --- | -| LogIt++ | `1.0.2-dev` (`main`) | [документация проекта](https://liminode.github.io/log-it-cpp/) | +| LogIt++ | `v1.0.2` | [документация проекта](https://liminode.github.io/log-it-cpp/) | | spdlog | [`v1.17.0`](https://github.com/gabime/spdlog/releases/tag/v1.17.0) | [README](https://github.com/gabime/spdlog), [асинхронное логирование](https://github.com/gabime/spdlog/wiki/Asynchronous-logging) | | Quill | [`v13.0.0`](https://github.com/odygrd/quill/releases/tag/v13.0.0) | [документация проекта](https://quillcpp.readthedocs.io/) | | Boost.Log | [Boost `1.92.0`](https://www.boost.org/users/history/version_1_92_0.html) | [документация Boost.Log](https://www.boost.org/doc/libs/1_92_0/libs/log/doc/html/) | diff --git a/docs/comparison.md b/docs/comparison.md index 19c13df3..1185cb43 100644 --- a/docs/comparison.md +++ b/docs/comparison.md @@ -7,11 +7,11 @@ answers a practical question: **when does LogIt++ fit better than a smaller formatted-string logger, a general event framework, or a diagnostic macro utility?** -The comparison was checked on **2026-09-10** against these upstream releases: +The comparison was checked on **2026-09-15** against these upstream releases: | Project | Release checked | Primary documentation | | --- | --- | --- | -| LogIt++ | `1.0.2-dev` (`main`) | [project documentation](https://liminode.github.io/log-it-cpp/) | +| LogIt++ | `v1.0.2` | [project documentation](https://liminode.github.io/log-it-cpp/) | | spdlog | [`v1.17.0`](https://github.com/gabime/spdlog/releases/tag/v1.17.0) | [README](https://github.com/gabime/spdlog), [async logging](https://github.com/gabime/spdlog/wiki/Asynchronous-logging) | | Quill | [`v13.0.0`](https://github.com/odygrd/quill/releases/tag/v13.0.0) | [project documentation](https://quillcpp.readthedocs.io/) | | Boost.Log | [Boost `1.92.0`](https://www.boost.org/users/history/version_1_92_0.html) | [Boost.Log documentation](https://www.boost.org/doc/libs/1_92_0/libs/log/doc/html/) | @@ -235,7 +235,7 @@ Choose LogIt++ with its trade-offs in mind: backends. The [upstream `google/glog` repository](https://github.com/google/glog) was -archived and made read-only as of the 2026-09-10 check; account for that +archived and made read-only as of the 2026-09-15 check; account for that lifecycle status before adopting it as a new dependency. **Consider IceCream-Cpp when:** diff --git a/docs/installation.md b/docs/installation.md index f965ae32..0fec5506 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -50,6 +50,20 @@ target_link_libraries(my_app PRIVATE log-it-cpp::log-it-cpp) Pass `-DCMAKE_PREFIX_PATH=/path/to/install` when configuring the consumer. +## pkg-config consumer + +The installation also provides a `log-it-cpp` pkg-config module. Set +`PKG_CONFIG_PATH` to include the installation's `share/pkgconfig` and +`lib/pkgconfig` directories, then use the module's flags when compiling: + +```bash +export PKG_CONFIG_PATH=/path/to/install/share/pkgconfig:/path/to/install/lib/pkgconfig +c++ -std=c++11 $(pkg-config --cflags log-it-cpp) \ + app.cpp $(pkg-config --libs log-it-cpp) -o app +``` + +The module declares the required `time-shield` dependency. + ## Optional dependencies and features Enable only the features needed by the application. `fmt`, zlib, and zstd can diff --git a/tests/pkgconfig_consumer/CMakeLists.txt b/tests/pkgconfig_consumer/CMakeLists.txt new file mode 100644 index 00000000..a25087e3 --- /dev/null +++ b/tests/pkgconfig_consumer/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.18) +project(pkgconfig_consumer LANGUAGES CXX) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(LOGIT REQUIRED IMPORTED_TARGET log-it-cpp) + +add_executable(pkgconfig_consumer main.cpp) +target_compile_features(pkgconfig_consumer PRIVATE cxx_std_11) +target_link_libraries(pkgconfig_consumer PRIVATE PkgConfig::LOGIT) diff --git a/tests/pkgconfig_consumer/main.cpp b/tests/pkgconfig_consumer/main.cpp new file mode 100644 index 00000000..5a8b667f --- /dev/null +++ b/tests/pkgconfig_consumer/main.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + LOGIT_ADD_CONSOLE_DEFAULT(); + LOGIT_INFO("pkg-config consumer works"); + LOGIT_WAIT(); + return 0; +} From db15a940710132d0b1ccfa88ae42c91f4089589b Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Tue, 15 Sep 2026 22:55:20 +0300 Subject: [PATCH 2/3] fix(vcpkg): allow dependency pkg-config metadata Skip vcpkg's isolated pkg-config existence check because it omits the time-shield dependency directory; retain metadata fixup and validate the dependency through the Linux consumer smoke. --- vcpkg-overlay/ports/log-it-cpp/portfile.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vcpkg-overlay/ports/log-it-cpp/portfile.cmake b/vcpkg-overlay/ports/log-it-cpp/portfile.cmake index ee86620e..23a11743 100644 --- a/vcpkg-overlay/ports/log-it-cpp/portfile.cmake +++ b/vcpkg-overlay/ports/log-it-cpp/portfile.cmake @@ -19,7 +19,11 @@ vcpkg_cmake_install() vcpkg_cmake_config_fixup(PACKAGE_NAME log-it-cpp CONFIG_PATH lib/cmake/log-it-cpp) -vcpkg_fixup_pkgconfig() +# vcpkg's isolated fixup check does not include the dependency port's +# pkg-config directory, even though time-shield is declared in Requires. +# The relocatable metadata is still rewritten; the dependency is validated by +# the dedicated Linux pkg-config consumer job. +vcpkg_fixup_pkgconfig(SKIP_CHECK) vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") From c37d462dde8d4f1d5717144b4061c999a936004c Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Fri, 18 Sep 2026 18:56:04 +0300 Subject: [PATCH 3/3] fix(release): align dependency and Pages contracts Constrain pkg-config consumers to TimeShield 2.0.x, document the v2 dependency migration, and publish GitHub Pages only from matching release tags. --- .github/workflows/ci.yml | 4 ++++ .github/workflows/publish.yaml | 2 +- CHANGELOG.md | 2 ++ cmake/log-it-cpp.pc.in | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66e897ab..7758c162 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -220,6 +220,10 @@ jobs: run: | pkg-config --exists log-it-cpp test "$(pkg-config --modversion log-it-cpp)" = "1.0.2" + pkg-config --print-requires log-it-cpp + pkg-config --print-requires log-it-cpp | grep -Fx 'time-shield >= 2.0.0' + pkg-config --print-requires log-it-cpp | grep -Fx 'time-shield < 2.1.0' + pkg-config --atleast-version=2.0.0 time-shield cmake -S tests/pkgconfig_consumer -B build-pkgconfig - name: Build and run pkg-config consumer run: | diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 4df15fc2..c54ea15f 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -106,7 +106,7 @@ jobs: sleep 1 NODE_PATH="$PLAYWRIGHT_DIR/node_modules" node .github/scripts/docs-layout-smoke.cjs - name: Publish generated content to GitHub Pages - if: github.event_name != 'pull_request' + if: github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ github.token }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 739d4e02..7223d967 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ All notable changes to this project will be documented in this file. ### Packaging / Build - Refreshed bundled dependency revisions and canonical repository URLs. +- Updated the required TimeShield dependency to the 2.0.x line (minimum 2.0.0) + and migrated to its v2 header layout. - Added fail-closed installation checks for unsupported bundled optional dependencies and source-tree-only Prometheus server headers. ### CI / Testing diff --git a/cmake/log-it-cpp.pc.in b/cmake/log-it-cpp.pc.in index 893ecd51..a345a9d2 100644 --- a/cmake/log-it-cpp.pc.in +++ b/cmake/log-it-cpp.pc.in @@ -6,6 +6,6 @@ includedir=${prefix}/include Name: log-it-cpp Description: LogIt C++ logging library Version: @PROJECT_VERSION@ -Requires: time-shield +Requires: time-shield >= 2.0.0, time-shield < 2.1.0 Cflags: -I${includedir}/logit_cpp Libs: