From e3d0db5d273be362cefcca8fc20d3f6f9e32efef Mon Sep 17 00:00:00 2001 From: Gaspard Kirira Date: Fri, 2 Jan 2026 18:07:45 +0300 Subject: [PATCH] release: v1.17.4 --- CHANGELOG.md | 32 +++++++++++++++ CMakeLists.txt | 2 +- README.md | 84 ++++++++++++++------------------------- cmake/VixConfig.cmake.in | 85 ++++++++++++---------------------------- modules/cli | 2 +- modules/core | 2 +- modules/utils | 2 +- modules/websocket | 2 +- 8 files changed, 93 insertions(+), 118 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12d36c4..670607f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## v1.17.4 — 2026-01-02 + +### 🔧 Fixed + +- **CMake / Packaging** + + - Fixed `find_package(Vix)` failures caused by missing `Boost::filesystem` / `Boost::system` targets. + - Ensured all required dependencies are resolved **before** loading `VixTargets.cmake`. + - Removed deprecated `FindBoost` behavior in exported configs (CMP0167-safe). + - Stabilized consumer builds on macOS (AppleClang + Homebrew Boost) and Linux. + +- **Core** + + - Removed `Boost::filesystem` from `vix::core` public link interface. + - Restricted Boost dependency to `Boost::system` only (Asio / Beast). + - Updated HTTP server internals and headers accordingly. + - Prevented Boost symbols from leaking into consumer CMake targets. + +- **WebSocket** + - Cleaned `vix::websocket` exported link interface. + - Fixed missing `Boost::system` target errors in downstream applications. + - Improved module behavior with modern CMake dependency resolution. + +### ✨ Improved + +- More robust umbrella CMake configuration for multi-module installs. +- Clearer separation between internal dependencies and public API surface. +- Better cross-platform developer experience when using: + ```bash + find_package(Vix CONFIG REQUIRED) + ``` + ## v1.17.3 ### Added diff --git a/CMakeLists.txt b/CMakeLists.txt index 3564225..4a4a03d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -588,7 +588,7 @@ option(VIX_ENABLE_INSTALL "Enable install/export rules for packaging" ON) # Compute feature flags as real ON/OFF at configure-time (NO generator expressions) set(VIX_WITH_JSON ON) # umbrella always links JSON backend -set(VIX_WITH_BOOST_FS ON) # adjust if you ever disable Boost::filesystem in core +set(VIX_WITH_BOOST_FS OFF) # do NOT require Boost for consumers by default set(VIX_WITH_OPENSSL ON) # adjust if you ever disable SSL in core set(VIX_WITH_MYSQL OFF) # do NOT require MySQL for consumers by default set(VIX_WITH_SQLITE OFF) # will be set ON only if websocket exists diff --git a/README.md b/README.md index f87f76d..82772cc 100644 --- a/README.md +++ b/README.md @@ -82,40 +82,6 @@ Results represent steady-state throughput on a simple `"OK"` endpoint. --- -### ✔ Vix.cpp recommended benchmark mode - -When benchmarking from inside the Vix.cpp repository (using the built-in example): - -```bash -cd ~/vixcpp/vix -export VIX_LOG_LEVEL=critical -export VIX_LOG_ASYNC=false - -# Run the optimized example server -vix run example main -``` - -Then, in another terminal: - -```bash -wrk -t8 -c800 -d30s --latency http://127.0.0.1:8080/bench -``` - -If you want CPU pinning for more stable results: - -```bash -taskset -c 2 ./build/main -wrk -t8 -c800 -d30s --latency http://127.0.0.1:8080/bench -``` - -#### 🏁 Result: ~98,942 req/s - -✔ Fast-path routing gives +1–3% - -Use /fastbench to bypass RequestHandler overhead. - ---- - # 🧭 Quick Example ```cpp @@ -156,7 +122,7 @@ Example startup: Vix.cpp v1.x (CLI) — Modern C++ backend runtime [GCC 13.3.0] on linux Exit: Ctrl+C / Ctrl+D | Clear: Ctrl+L | Type help for help -vix> +>>> ``` --- @@ -201,18 +167,6 @@ int main() } ``` -## Minimal WebSocket Client - -```cpp -auto client = Client::create("localhost", "9090", "/"); - -client->on_open([] { - std::cout << "Connected!" << std::endl; -}); - -client->send("chat.message", {"text", "Hello world!"}); -``` - --- # Why Vix Exists @@ -260,6 +214,8 @@ C++20 + Asio + zero-overhead abstractions. To build **Vix.cpp** from source: +--- + ## 🐧 Linux / Ubuntu ### Prerequisites @@ -267,12 +223,14 @@ To build **Vix.cpp** from source: ```bash sudo apt update sudo apt install -y \ - g++-12 cmake make git \ # Build tools - libboost-all-dev \ # Boost (asio, beast) - nlohmann-json3-dev \ # JSON (nlohmann/json) - libspdlog-dev \ # Logging (spdlog) - zlib1g-dev \ # gzip / ZLIB - libmysqlcppconn-dev # Optional: MySQL Connector/C++ for ORM + g++-12 cmake make git \ + libboost-all-dev \ + nlohmann-json3-dev \ + libspdlog-dev \ + libfmt-dev \ + zlib1g-dev \ + libsqlite3-dev \ + libmysqlcppconn-dev # Optional: ORM (MySQL) ``` Optional dependencies: @@ -290,7 +248,16 @@ sudo apt install -y libmysqlcppconn-dev libsqlite3-dev Install Homebrew first, then: ```bash -brew install cmake ninja llvm boost nlohmann-json spdlog fmt mysql sqlite3 zlib +brew install cmake ninja boost nlohmann-json spdlog fmt sqlite3 zlib +``` + +â„šī¸ Notes + +AppleClang (default on macOS) is fully supported. +llvm is optional and only needed if you explicitly want clang++ from Homebrew. +In rare cases, you may need: + +```bash export ZLIB_ROOT="$(brew --prefix zlib)" ``` @@ -300,9 +267,18 @@ export ZLIB_ROOT="$(brew --prefix zlib)" git clone https://github.com/vixcpp/vix.git cd vix git submodule update --init --recursive + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build -j + sudo cmake --install build --prefix /usr/local + +``` + +### Verify + +```bash +vix --version ``` > This builds the Vix runtime and CLI. diff --git a/cmake/VixConfig.cmake.in b/cmake/VixConfig.cmake.in index d8af6cb..cf89c54 100644 --- a/cmake/VixConfig.cmake.in +++ b/cmake/VixConfig.cmake.in @@ -2,75 +2,23 @@ include(CMakeFindDependencyMacro) -# ------------------------------------------------------- -# 0) Optional deps that may be referenced by exported targets -# MUST be defined BEFORE including VixTargets.cmake -# ------------------------------------------------------- - -find_package(MySQLCppConn QUIET CONFIG) -if (NOT TARGET MySQLCppConn::MySQLCppConn) - add_library(MySQLCppConn::MySQLCppConn INTERFACE IMPORTED) -endif() - -# ------------------------------------------------------- -# 0bis) Compression deps (optional) — MUST exist before VixTargets.cmake -# ------------------------------------------------------- -if (@VIX_WITH_ZLIB@) - find_dependency(ZLIB QUIET) - - # Safety net: if ZLIB was found but did not create the target - if (ZLIB_FOUND AND NOT TARGET ZLIB::ZLIB) - add_library(ZLIB::ZLIB INTERFACE IMPORTED) - target_include_directories(ZLIB::ZLIB INTERFACE "${ZLIB_INCLUDE_DIRS}") - target_link_libraries(ZLIB::ZLIB INTERFACE "${ZLIB_LIBRARIES}") - endif() - - # If Vix exports ZLIB::ZLIB, we must have it - if (NOT TARGET ZLIB::ZLIB) - message(FATAL_ERROR - "Vix was built with gzip support (VIX_WITH_ZLIB=ON), but ZLIB::ZLIB is not available on this system." - ) - endif() -endif() - -# ------------------------------------------------------- -# 1) Load exported Vix targets -# ------------------------------------------------------- -include("${CMAKE_CURRENT_LIST_DIR}/VixTargets.cmake") - -# ------------------------------------------------------- -# 2) Core and common dependencies -# ------------------------------------------------------- - +# ---- deps that exported targets may reference ---- find_dependency(Threads REQUIRED) - find_dependency(fmt CONFIG REQUIRED) - find_dependency(spdlog CONFIG REQUIRED) -if (TARGET spdlog::spdlog AND NOT TARGET spdlog::spdlog_header_only) - add_library(spdlog::spdlog_header_only ALIAS spdlog::spdlog) + +if (@VIX_WITH_OPENSSL@) + find_dependency(OpenSSL REQUIRED) endif() if (@VIX_WITH_JSON@) find_dependency(nlohmann_json CONFIG REQUIRED) endif() -if (@VIX_WITH_BOOST_FS@) - find_dependency(Boost REQUIRED COMPONENTS filesystem system) -endif() - -if (@VIX_WITH_OPENSSL@) - find_dependency(OpenSSL REQUIRED) -endif() - -# ------------------------------------------------------- -# 3) SQLite (optional) -# ------------------------------------------------------- if (@VIX_WITH_SQLITE@) find_dependency(SQLite3 REQUIRED) if (TARGET SQLite::SQLite3) - # ok elseif (TARGET SQLite3::SQLite3) add_library(SQLite::SQLite3 ALIAS SQLite3::SQLite3) elseif (TARGET sqlite3) @@ -82,9 +30,28 @@ if (@VIX_WITH_SQLITE@) endif() endif() -# ------------------------------------------------------- -# 4) ORM presence flag (informational) -# ------------------------------------------------------- +# Optional (only if referenced by exported targets) +find_package(MySQLCppConn QUIET CONFIG) +if (NOT TARGET MySQLCppConn::MySQLCppConn) + add_library(MySQLCppConn::MySQLCppConn INTERFACE IMPORTED) +endif() + +if (@VIX_WITH_ZLIB@) + find_dependency(ZLIB QUIET) + if (ZLIB_FOUND AND NOT TARGET ZLIB::ZLIB) + add_library(ZLIB::ZLIB INTERFACE IMPORTED) + target_include_directories(ZLIB::ZLIB INTERFACE "${ZLIB_INCLUDE_DIRS}") + target_link_libraries(ZLIB::ZLIB INTERFACE "${ZLIB_LIBRARIES}") + endif() + if (NOT TARGET ZLIB::ZLIB) + message(FATAL_ERROR "Vix built with gzip support but ZLIB::ZLIB is unavailable.") + endif() +endif() + +# ---- load exported targets ---- +include("${CMAKE_CURRENT_LIST_DIR}/VixTargets.cmake") + +# ---- informational flags ---- set(VIX_HAS_ORM @VIX_HAS_ORM@) if (VIX_HAS_ORM AND NOT TARGET vix::orm) set(VIX_HAS_ORM OFF) diff --git a/modules/cli b/modules/cli index a3aa71b..3eebb51 160000 --- a/modules/cli +++ b/modules/cli @@ -1 +1 @@ -Subproject commit a3aa71bb59b581f7f03a70a1aa2ca32410b88bce +Subproject commit 3eebb51c995d5e380e10d566f0102eeb27cdd7ae diff --git a/modules/core b/modules/core index e1462a0..549b7f3 160000 --- a/modules/core +++ b/modules/core @@ -1 +1 @@ -Subproject commit e1462a0dd2416df2b92a1b9c79c159692fbcd117 +Subproject commit 549b7f38c8aebf2c20623d819e586224c10c33bb diff --git a/modules/utils b/modules/utils index f0b7656..6d3aa36 160000 --- a/modules/utils +++ b/modules/utils @@ -1 +1 @@ -Subproject commit f0b76563ec2bc0a3d0ecd89c74610b3694cf66ba +Subproject commit 6d3aa36b98f9ed6f549475e7ef6021ce82016918 diff --git a/modules/websocket b/modules/websocket index e85047f..e7d8df4 160000 --- a/modules/websocket +++ b/modules/websocket @@ -1 +1 @@ -Subproject commit e85047fda91162e3442c9fb3c9e500e818c1ef6d +Subproject commit e7d8df4dd202ca25a6b0cc37e664cc6230c9f6db