From 0ed824d7b3e72f9fd566feebaf0126e2686758c1 Mon Sep 17 00:00:00 2001 From: Roman Kharitonov Date: Sat, 17 May 2025 01:08:49 +1000 Subject: [PATCH 1/3] Add repository authors to readme --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 89b49ce..41de413 100644 --- a/README.md +++ b/README.md @@ -56,22 +56,22 @@ specific files as needed without having to unpack the entire archive. ## Third-party components -| Project | License | -|-----------------------------------------------------|-------------------------------------| -| [json](https://github.com/nlohmann/json) | [MIT](licenses/json.txt) | -| [Catch2](https://github.com/catchorg/Catch2) | [BSL-1.0](licenses/Boost.txt) | -| [Observer](https://github.com/lazyhamster/Observer) | [LGPL-3.0](licenses/Observer.txt) | -| [Python](https://www.python.org) | [PSF-2.0](licenses/Python.txt) | -| [xxHash](https://github.com/Cyan4973/xxHash) | [BSD-2-Clause](licenses/xxHash.txt) | -| [zlib](https://zlib.net) | [zlib](licenses/zlib.txt) | -| [zstr](https://github.com/mateidavid/zstr) | [MIT](licenses/zstr.txt) | +| Project | License | +|-----------------------------------------------------------------|-------------------------------------| +| [nlohmann/json](https://github.com/nlohmann/json) | [MIT](licenses/json.txt) | +| [catchorg/Catch2](https://github.com/catchorg/Catch2) | [BSL-1.0](licenses/Boost.txt) | +| [lazyhamster/Observer](https://github.com/lazyhamster/Observer) | [LGPL-3.0](licenses/Observer.txt) | +| [Python](https://www.python.org) | [PSF-2.0](licenses/Python.txt) | +| [Cyan4973/xxHash](https://github.com/Cyan4973/xxHash) | [BSD-2-Clause](licenses/xxHash.txt) | +| [zlib](https://zlib.net) | [zlib](licenses/zlib.txt) | +| [mateidavid/zstr](https://github.com/mateidavid/zstr) | [MIT](licenses/zstr.txt) | ## Sources of inspiration | Project | License | |------------------------------------------------------------------|----------------------------------| -| [rgssad](https://github.com/luxrck/rgssad) | [MIT](licenses/rgssad.txt) | -| [rpatool](https://github.com/Shizmob/rpatool) | [WTFPL](licenses/rpatool.txt) | +| [luxrck/rgssad](https://github.com/luxrck/rgssad) | [MIT](licenses/rgssad.txt) | +| [Shizmob/rpatool](https://github.com/Shizmob/rpatool) | [WTFPL](licenses/rpatool.txt) | | [zanzapak](https://aluigi.altervista.org/papers.htm#others-file) | [GPL-3.0](licenses/zanzapak.txt) | ## Building from Source From 9688b1dd74ea1b728edc9e9cd044a1f97620ff5a Mon Sep 17 00:00:00 2001 From: Roman Kharitonov Date: Sat, 17 May 2025 01:09:40 +1000 Subject: [PATCH 2/3] Speed up tests in case of failure --- src/tests/framework/testcase.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tests/framework/testcase.cpp b/src/tests/framework/testcase.cpp index 2e6103f..e1296a3 100644 --- a/src/tests/framework/testcase.cpp +++ b/src/tests/framework/testcase.cpp @@ -1,7 +1,6 @@ #include "observer.h" #include -#include #include #include @@ -84,6 +83,9 @@ namespace test REQUIRE(actual_listing.is_open()); actual_listing << std::setw(4) << nlohmann::json(actual_strings) << std::endl; - REQUIRE(expected_strings == actual_strings); + REQUIRE(expected_strings.size() == actual_strings.size()); + for (auto i = 0; i < expected_strings.size(); i++) { + REQUIRE(expected_strings[i] == actual_strings[i]); + } } } From abf0ef32468ccba2875ebeafc1c7c30d64643073 Mon Sep 17 00:00:00 2001 From: Roman Kharitonov Date: Sat, 24 May 2025 14:24:12 +1000 Subject: [PATCH 3/3] Add x86 build, fix RenPy on PC without installed Python (closes #28, #27, #26, #19) --- .github/workflows/main.yml | 71 ++- .idea/cmake.xml | 9 - .idea/dictionaries/project.xml | 10 + .../runConfigurations/Far_Manager__Debug_.xml | 2 +- .../Far_Manager__Release_.xml | 2 +- .idea/runConfigurations/Run_Tests.xml | 2 +- CMakeLists.txt | 30 +- CMakePresets.json | 67 ++ README.md | 14 +- licenses/Python.txt | 40 -- licenses/serde-pickle.txt | 25 + src/modules/renpy/pickle.cpp | 573 ++++++++++++++++++ src/modules/renpy/pickle.h | 210 +++++++ src/modules/renpy/python/_ref.h | 83 --- src/modules/renpy/python/context.cpp | 77 --- src/modules/renpy/python/dict.cpp | 28 - src/modules/renpy/python/list.cpp | 20 - src/modules/renpy/python/python.h | 88 --- src/modules/renpy/python/tuple.cpp | 20 - src/modules/renpy/renpy.cpp | 27 +- src/tests/framework/testcase.cpp | 4 +- vcpkg.json | 3 - 22 files changed, 979 insertions(+), 426 deletions(-) delete mode 100644 .idea/cmake.xml create mode 100644 CMakePresets.json delete mode 100644 licenses/Python.txt create mode 100644 licenses/serde-pickle.txt create mode 100644 src/modules/renpy/pickle.cpp create mode 100644 src/modules/renpy/pickle.h delete mode 100644 src/modules/renpy/python/_ref.h delete mode 100644 src/modules/renpy/python/context.cpp delete mode 100644 src/modules/renpy/python/dict.cpp delete mode 100644 src/modules/renpy/python/list.cpp delete mode 100644 src/modules/renpy/python/python.h delete mode 100644 src/modules/renpy/python/tuple.cpp diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7adab0a..3f16f98 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,24 +6,23 @@ on: pull_request: branches: [ "master" ] -# https://devblogs.microsoft.com/cppblog/vcpkg-integration-with-the-github-dependency-graph/ -permissions: - contents: write - env: - # https://devblogs.microsoft.com/cppblog/vcpkg-integration-with-the-github-dependency-graph/ - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - VCPKG_ROOT: "C:/my-vcpkg" VCPKG_DEFAULT_BINARY_CACHE: "C:/vcpkg-binary-cache" - VCPKG_FEATURE_FLAGS: dependencygraph - BUILD_TYPE: RelWithDebInfo jobs: build: runs-on: windows-2022 + strategy: + matrix: + arch: [ x64, x86 ] steps: - uses: actions/checkout@v4 + - name: Setup Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} + - name: Get project vcpkg baseline shell: pwsh run: | @@ -33,14 +32,14 @@ jobs: - name: Cache vcpkg uses: actions/cache@v4 with: - key: vcpkg-${{ hashFiles('vcpkg.json') }} + key: vcpkg-${{ matrix.arch }}-${{ hashFiles('vcpkg.json') }} path: | ${{env.VCPKG_DEFAULT_BINARY_CACHE}} - name: Setup vcpkg run: | - New-Item -ItemType Directory -Path ${{env.VCPKG_ROOT}} - Set-Location -Path ${{env.VCPKG_ROOT}} + New-Item -ItemType Directory -Path C:/my-vcpkg + Set-Location -Path C:/my-vcpkg git init git remote add --no-tags origin https://github.com/microsoft/vcpkg.git git fetch --depth 1 --no-write-fetch-head origin ${{env.VCPKG_BASELINE}} @@ -48,25 +47,49 @@ jobs: git checkout ./bootstrap-vcpkg.bat New-Item -ItemType Directory -Path ${{env.VCPKG_DEFAULT_BINARY_CACHE}} -Force + echo "VCPKG_ROOT=C:/my-vcpkg" >> $env:GITHUB_ENV - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} --toolchain ${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake + run: cmake --preset ${{ matrix.arch }}-release - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + run: cmake --build ${{github.workspace}}/build/${{ matrix.arch }}-release - name: Pack run: | - cd ${{github.workspace}}/build - cpack --config CPackConfig.cmake -C ${{env.BUILD_TYPE}} + cd ${{github.workspace}}/build/${{ matrix.arch }}-release + cpack --config CPackConfig.cmake -C RelWithDebInfo + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: observer-modules-${{ matrix.arch }} + path: ${{github.workspace}}/build/${{ matrix.arch }}-release/*.zip - - name: Release nightly build - uses: andelf/nightly-release@main - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + release: + needs: build + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 with: - name: 'Nightly Release $$' - body: 'This is an automated nightly build. Download the *-dll.zip files if you need Observer modules. Download the *-pdb.zip files if you need debug symbols.' - tag_name: nightly + merge-multiple: true + path: ./artifacts + + - name: Generate release tag + id: tag + run: echo "tag=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_OUTPUT + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: release-${{ steps.tag.outputs.tag }} + name: 'Release ${{ steps.tag.outputs.tag }}' + body: | + Automated release from master branch. + + Download the *-dll.zip files if you need Observer modules. + Download the *-pdb.zip files if you need debug symbols. + files: ./artifacts/*.zip prerelease: false - files: | - ./build/*.zip diff --git a/.idea/cmake.xml b/.idea/cmake.xml deleted file mode 100644 index 090753e..0000000 --- a/.idea/cmake.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/dictionaries/project.xml b/.idea/dictionaries/project.xml index cfd78c7..7fbe760 100644 --- a/.idea/dictionaries/project.xml +++ b/.idea/dictionaries/project.xml @@ -3,23 +3,33 @@ andelf auriemma + birkenfeld bstatic + catchorg debugfarhome dependencygraph dest funcs + ilammy + lazyhamster + luxrck makemoduleversion + mateidavid nomoreitems popd pushd + refaim's ren' renpy rgssad rpatool rpgmaker + shizmob + softprops strbuf thirdparty userabort + vcvars wstring xxhash zanzapak diff --git a/.idea/runConfigurations/Far_Manager__Debug_.xml b/.idea/runConfigurations/Far_Manager__Debug_.xml index 84791f8..3fe8131 100644 --- a/.idea/runConfigurations/Far_Manager__Debug_.xml +++ b/.idea/runConfigurations/Far_Manager__Debug_.xml @@ -1,5 +1,5 @@ - + diff --git a/.idea/runConfigurations/Far_Manager__Release_.xml b/.idea/runConfigurations/Far_Manager__Release_.xml index ec1a695..3da7b08 100644 --- a/.idea/runConfigurations/Far_Manager__Release_.xml +++ b/.idea/runConfigurations/Far_Manager__Release_.xml @@ -1,5 +1,5 @@ - + diff --git a/.idea/runConfigurations/Run_Tests.xml b/.idea/runConfigurations/Run_Tests.xml index da68c74..b5dd467 100644 --- a/.idea/runConfigurations/Run_Tests.xml +++ b/.idea/runConfigurations/Run_Tests.xml @@ -1,5 +1,5 @@ - +