From 3fda07e46f5d255d97644926ed95a469311c8ea8 Mon Sep 17 00:00:00 2001 From: nircoe Date: Sun, 27 Sep 2026 12:01:42 +0300 Subject: [PATCH 1/3] [Docs]: Add refactoring notice --- README.md | 50 +++++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index f5dbccb..2651c78 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,14 @@ It provides functionalities for data persistence, serialization, and encryption. [![Linux](https://github.com/nircoe/datacoe/actions/workflows/ci-linux.yml/badge.svg?branch=main&event=push)](https://github.com/nircoe/datacoe/actions/workflows/ci-linux.yml) [![macOS](https://github.com/nircoe/datacoe/actions/workflows/ci-macos.yml/badge.svg?branch=main&event=push)](https://github.com/nircoe/datacoe/actions/workflows/ci-macos.yml) +## Current State - Refactoring towards a Generic Data API + +This README describes the current `main` branch. datacoe is being refactored towards a generic, +templated save/load API (in the `refactor/generic_data` branch), so parts of this README will be +stale until that refactor lands. + +--- + ## Table of Contents - [Overview](#overview) - [Features](#features) @@ -29,7 +37,7 @@ The library offers a base implementation for data management tasks, including: - Reading and writing game data to files - Serialization and deserialization of game data using [nlohmann/json](https://github.com/nlohmann/json) - Encryption and decryption of data using [CryptoPP](https://github.com/weidai11/cryptopp) (With the help of [CryptoPP-CMake](https://github.com/abdes/cryptopp-cmake)) -- Comprehensive test suite using [Google Test](https://github.com/google/googletest) +- Test suite using [Google Test](https://github.com/google/googletest) [Back to top](#table-of-contents) @@ -286,7 +294,7 @@ FetchContent_Declare( ## Testing -The project includes a comprehensive test suite built with Google Test. Tests cover: +The project includes a test suite built with Google Test. Tests cover: - Basic data operations - Error handling and recovery @@ -406,7 +414,7 @@ Game-specific implementations will have their own tags (e.g., `worm-v1.0.0`) to - JSON serialization using nlohmann/json - AES encryption/decryption using CryptoPP - Optional encryption with automatic format detection -- Comprehensive test suite with Google Test +- Test suite with Google Test - Proper installation targets and CMake configuration - Cross-platform support (Windows, macOS, Linux) @@ -435,26 +443,26 @@ If you'd like to contribute, please: ## Roadmap ### Implemented Features -- ✅ Basic file input/output operations -- ✅ JSON serialization using nlohmann/json -- ✅ AES encryption/decryption using CryptoPP -- ✅ Comprehensive test suite with Google Test -- ✅ Automated dependency management -- ✅ Optional encryption (ability to disable encryption if not needed) +- Basic file input/output operations +- JSON serialization using nlohmann/json +- AES encryption/decryption using CryptoPP +- Test suite with Google Test +- Automated dependency management +- Optional encryption (ability to disable encryption if not needed) ### Planned Improvements -- ⏳ Secure encryption key management (replacing fixed keys with secure storage and derivation) -- ⏳ Graceful recovery from corrupted files with backup system -- ⏳ Thread-safe operations for concurrent data access -- ⏳ Asynchronous save/load operations -- ⏳ Performance optimizations for large data sets -- ⏳ Auto-save functionality with configurable intervals -- ⏳ Save data compression -- ⏳ Save data versioning and migration -- ⏳ Multiple save slot system with profile management -- ⏳ Support for additional build systems (Make, Visual Studio, Meson, etc.) -- ⏳ Cloud save integration capabilities -- ⏳ Save data analytics and statistics +- Secure encryption key management (replacing fixed keys with secure storage and derivation) +- Graceful recovery from corrupted files with backup system +- Thread-safe operations for concurrent data access +- Asynchronous save/load operations +- Performance optimizations for large data sets +- Auto-save functionality with configurable intervals +- Save data compression +- Save data versioning and migration +- Multiple save slot system with profile management +- Support for additional build systems (Make, Visual Studio, Meson, etc.) +- Cloud save integration capabilities +- Save data analytics and statistics [Back to top](#table-of-contents) From 15fa558cf5e9271c4300ad58948f4d3a1c07fbf7 Mon Sep 17 00:00:00 2001 From: nircoe Date: Sun, 27 Sep 2026 12:54:40 +0300 Subject: [PATCH 2/3] Skip draft PRs and fix windows msvc build with ninja --- .github/workflows/ci-linux.yml | 2 ++ .github/workflows/ci-macos.yml | 2 ++ .github/workflows/ci-windows.yml | 18 ++++++++++++++---- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 68e4e0e..c89b976 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -4,12 +4,14 @@ on: push: branches: [ main ] pull_request: + types: [ opened, synchronize, reopened, ready_for_review ] branches: [ main ] jobs: build-and-test: name: ${{ matrix.name }} runs-on: ubuntu-latest + if: github.event.pull_request.draft == false || github.event_name == 'push' strategy: fail-fast: false matrix: diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index c925fe4..a24ffd0 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -4,12 +4,14 @@ on: push: branches: [ main ] pull_request: + types: [ opened, synchronize, reopened, ready_for_review ] branches: [ main ] jobs: build-and-test: name: ${{ matrix.name }} runs-on: macos-latest + if: github.event.pull_request.draft == false || github.event_name == 'push' strategy: fail-fast: false matrix: diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 4145477..2844df0 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -4,12 +4,14 @@ on: push: branches: [ main ] pull_request: + types: [ opened, synchronize, reopened, ready_for_review ] branches: [ main ] jobs: build-and-test: name: ${{ matrix.name }} runs-on: windows-latest + if: github.event.pull_request.draft == false || github.event_name == 'push' strategy: fail-fast: false matrix: @@ -17,9 +19,13 @@ jobs: # Windows with MSVC - name: "Windows MSVC" compiler: msvc - cmake-generator: 'Visual Studio 17 2022' - cmake-options: '' - + cmake-generator: 'Ninja' + cmake-options: >- + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl + -DCMAKE_POLICY_DEFAULT_CMP0141=NEW + -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded + # Windows with MinGW (GCC) - name: "Windows MinGW" compiler: gcc @@ -42,6 +48,10 @@ jobs: fi shell: bash + - name: Setup MSVC dev environment + if: matrix.compiler == 'msvc' + uses: ilammy/msvc-dev-cmd@v1.13.0 + - name: Configure CMake run: | cmake -B build -G "${{ matrix.cmake-generator }}" ${{ matrix.cmake-options }} @@ -66,6 +76,6 @@ jobs: ./all_tests.exe else # MSVC echo "Running tests" - ./tests/Release/all_tests.exe + ./tests/all_tests.exe fi shell: bash \ No newline at end of file From 7c278bf1923286422e4dfff6e356fc17b84465cd Mon Sep 17 00:00:00 2001 From: nircoe Date: Sun, 27 Sep 2026 16:22:28 +0300 Subject: [PATCH 3/3] Patch CryptoPP MSVC version check for newer toolchains --- CMakeLists.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2457ab8..c197d4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,27 @@ option(BUILD_TESTS "Build the test suite" ON) add_subdirectory(external/cryptopp-cmake) add_subdirectory(external/json) +if(MSVC) + # CryptoPP 8.9.0 fails to build on newer MSVC - integer.cpp and zdeflate.cpp both use a + # removed helper function for CRYPTOPP_MSC_VERSION >= 1500/1600 with no upper bound. Upstream + # fixed both by capping them at < 1938; patch it in until they release a version with the fix. + function(datacoe_patch_cryptopp_msc_guard relative_file old_guard new_guard) + set(file "${CMAKE_CURRENT_BINARY_DIR}/external/cryptopp-cmake/${CRYPTOPP_INCLUDE_PREFIX}/${relative_file}") + if(EXISTS "${file}") + file(READ "${file}" contents) + string(REPLACE "${old_guard}" "${new_guard}" contents "${contents}") + file(WRITE "${file}" "${contents}") + endif() + endfunction() + + datacoe_patch_cryptopp_msc_guard(integer.cpp + "#if (CRYPTOPP_MSC_VERSION >= 1500)" + "#if (CRYPTOPP_MSC_VERSION >= 1500) && (CRYPTOPP_MSC_VERSION < 1938)") + datacoe_patch_cryptopp_msc_guard(zdeflate.cpp + "#if CRYPTOPP_MSC_VERSION >= 1600" + "#if (CRYPTOPP_MSC_VERSION >= 1600) && (CRYPTOPP_MSC_VERSION < 1938)") +endif() + # project directories add_subdirectory(include) add_subdirectory(src)