From 5f9e880274a97e0e3d3d442b5cbf61864e234009 Mon Sep 17 00:00:00 2001 From: niten01 Date: Fri, 6 Jun 2025 13:22:38 +0300 Subject: [PATCH 01/13] fix wchar paths again --- src/Constructor/ConstructorForm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Constructor/ConstructorForm.cpp b/src/Constructor/ConstructorForm.cpp index 592f235..a1fc557 100644 --- a/src/Constructor/ConstructorForm.cpp +++ b/src/Constructor/ConstructorForm.cpp @@ -175,8 +175,8 @@ void ConstructorForm::onMainClick() { fs::path directory{ directoryTextBox_.text() }; nana::filebox fb{ *this, false }; - fb.init_file(fs::current_path() / - (programNameSafe + "_Installer" + NSTALL_EXE_EXTENSION)); + fb.init_file((fs::current_path() / + (programNameSafe + "_Installer" + NSTALL_EXE_EXTENSION)).string()); fb.add_filter("Executable", "*." NSTALL_EXE_EXTENSION); fb.allow_multi_select(false); auto paths{ fb.show() }; From e8b03fc79497bd3a42e47587b25068bc2a7ce043 Mon Sep 17 00:00:00 2001 From: niten01 Date: Fri, 6 Jun 2025 13:34:08 +0300 Subject: [PATCH 02/13] change nana to own fork --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03a1a82..3643a0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,8 +75,8 @@ if(NOT NSTALL_CLI_ONLY) message(STATUS "Fetching dependency: nana") FetchContent_Declare( nana - GIT_REPOSITORY https://github.com/cnjinhao/nana - GIT_TAG 96d48b8413866028f5d284ee55b763ceab7aeb1f) + GIT_REPOSITORY https://github.com/niten01/nana + GIT_TAG 4bbf352bebbf912983319c3d784a9b38aad828fd) FetchContent_MakeAvailable(nana) set_target_properties(nana PROPERTIES CXX_STANDARD 17) target_link_libraries(${COMMON_TARGET} PUBLIC nana) From 73b47f4f1fcf087638fb41f24a3c769531c1a0ba Mon Sep 17 00:00:00 2001 From: Lolitron-0 Date: Fri, 6 Jun 2025 13:54:22 +0300 Subject: [PATCH 03/13] vs gitignore --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 406f189..f1c7536 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ build *.profraw .cache compile_commands.json +.vs +CMakeSettings.json +out # testing binaries -*_Installer +*_Installer* \ No newline at end of file From d04bf182c5dfe6a7eeb0bd49c85b2dd6815b882b Mon Sep 17 00:00:00 2001 From: Lolitron-0 Date: Fri, 6 Jun 2025 14:05:57 +0300 Subject: [PATCH 04/13] test gui mode build on windows --- .github/workflows/cmake-multi-platform.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 8444b66..6d160ca 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -53,7 +53,17 @@ jobs: run: | echo "test-build-output-dir=${{ github.workspace }}/test-build" >> "$GITHUB_OUTPUT" - - name: Configure CMake + - name: Configure CMake (gui) + if: matrix.os == 'windows-latest' + run: > + cmake -B ${{ steps.strings.outputs.test-build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ github.workspace }} + + - name: Configure CMake (cli) + if: matrix.os != 'windows-latest' run: > cmake -B ${{ steps.strings.outputs.test-build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} From 41cbeaf24521f827f9d1e7f1150f6dfe1d8b0fc8 Mon Sep 17 00:00:00 2001 From: Lolitron-0 Date: Fri, 6 Jun 2025 14:14:32 +0300 Subject: [PATCH 05/13] windows export build artifact --- .github/workflows/cmake-multi-platform.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 6d160ca..315036b 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -51,12 +51,12 @@ jobs: id: strings shell: bash run: | - echo "test-build-output-dir=${{ github.workspace }}/test-build" >> "$GITHUB_OUTPUT" + echo "build-output-dir=${{ github.workspace }}/test-build" >> "$GITHUB_OUTPUT" - name: Configure CMake (gui) if: matrix.os == 'windows-latest' run: > - cmake -B ${{ steps.strings.outputs.test-build-output-dir }} + cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} @@ -65,7 +65,7 @@ jobs: - name: Configure CMake (cli) if: matrix.os != 'windows-latest' run: > - cmake -B ${{ steps.strings.outputs.test-build-output-dir }} + cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} @@ -73,8 +73,16 @@ jobs: -S ${{ github.workspace }} - name: Build for tests - run: cmake --build ${{ steps.strings.outputs.test-build-output-dir }} --config ${{ matrix.build_type }} + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - name: Test - working-directory: ${{ steps.strings.outputs.test-build-output-dir }}/tests + working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests run: ctest --build-config ${{ matrix.build_type }} --output-on-failure + + - name: Create build artifact + if: matrix.os == 'windows-latest' + uses: actions/upload-artifact@v4 + with: + name: build_out + path: ${{ steps.strings.outputs.build-output-dir }} + retention-days: 5 \ No newline at end of file From e417c01398687041c2ef3db4a260bb92580d2624 Mon Sep 17 00:00:00 2001 From: Lolitron-0 Date: Fri, 6 Jun 2025 14:16:41 +0300 Subject: [PATCH 06/13] no artifact for debug --- .github/workflows/cmake-multi-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 315036b..15f1de5 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -80,7 +80,7 @@ jobs: run: ctest --build-config ${{ matrix.build_type }} --output-on-failure - name: Create build artifact - if: matrix.os == 'windows-latest' + if: ${{ matrix.os == 'windows-latest' && matrix.build_type == 'Release' }} uses: actions/upload-artifact@v4 with: name: build_out From c131c4177295141de1d6bf21971bec081344c272 Mon Sep 17 00:00:00 2001 From: Lolitron-0 Date: Fri, 6 Jun 2025 14:53:53 +0300 Subject: [PATCH 07/13] test linux ci gui build --- .github/workflows/cmake-multi-platform.yml | 21 +++++++++++++++++---- src/Constructor/ConstructorMain.cpp | 2 ++ src/Installer/InstallerForm.cpp | 2 +- src/Installer/InstallerMain.cpp | 2 ++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 15f1de5..c9a3801 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -53,8 +53,14 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/test-build" >> "$GITHUB_OUTPUT" + - name: Install dependencies (linux) + if: matrix.os == 'ubuntu-latest' + run: > + sudo apt install -y libjpeg8-dev libpng-dev libasound2-dev + alsa-utils alsa-oss libx11-dev libxft-dev libxcursor-dev + - name: Configure CMake (gui) - if: matrix.os == 'windows-latest' + if: ${{ matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest' }} run: > cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} @@ -63,7 +69,7 @@ jobs: -S ${{ github.workspace }} - name: Configure CMake (cli) - if: matrix.os != 'windows-latest' + if: matrix.os == 'macos-latest' run: > cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} @@ -75,9 +81,16 @@ jobs: - name: Build for tests run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + - name: Test - working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests - run: ctest --build-config ${{ matrix.build_type }} --output-on-failure + uses: coactions/setup-xvfb@v1 + with: + run: ctest --build-config ${{ matrix.build_type }} --output-on-failure + working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests + + #- name: Test + # working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests + # run: ctest --build-config ${{ matrix.build_type }} --output-on-failure - name: Create build artifact if: ${{ matrix.os == 'windows-latest' && matrix.build_type == 'Release' }} diff --git a/src/Constructor/ConstructorMain.cpp b/src/Constructor/ConstructorMain.cpp index 67db828..f0a9efe 100644 --- a/src/Constructor/ConstructorMain.cpp +++ b/src/Constructor/ConstructorMain.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #ifndef NSTALL_CLI_ONLY #include "nstall/Constructor/ConstructorForm.hpp" #define FORCE_CLI false @@ -35,6 +36,7 @@ auto main(int argc, char* argv[]) -> int { nstall::ConstructorForm constructor{ resourcesDir }; constructor.run(); } catch (const nstall::ConstructorFormException& e) { + std::cerr << e.what() << std::endl; nana::msgbox err{ "Error" }; err.icon(nana::msgbox::icon_error); err << e.what(); diff --git a/src/Installer/InstallerForm.cpp b/src/Installer/InstallerForm.cpp index 369fe82..155d2da 100644 --- a/src/Installer/InstallerForm.cpp +++ b/src/Installer/InstallerForm.cpp @@ -68,7 +68,7 @@ void InstallerForm::createForm() { title_.text_align(nana::align::center); title_.typeface(nana::paint::font{ styler.font(), 20, nana::paint::font::font_style{ 500 } }); - title_.caption(metaInfo_->programName()); + title_.caption(metaInfo_->programName() + " Installer"); styler.stylize(title_); mainLayout_["title"] << title_; diff --git a/src/Installer/InstallerMain.cpp b/src/Installer/InstallerMain.cpp index 7def71e..9acaaf1 100644 --- a/src/Installer/InstallerMain.cpp +++ b/src/Installer/InstallerMain.cpp @@ -8,6 +8,7 @@ #include #include #include +#include auto main(int argc, char** argv) -> int { @@ -28,6 +29,7 @@ auto main(int argc, char** argv) -> int { nstall::InstallerForm installer{ argv[0] }; installer.run(); } catch (const nstall::InstallerFormException& e) { + std::cerr << e.what() << std::endl; nana::msgbox err{ "Error" }; err.icon(nana::msgbox::icon_error); err << e.what(); From 7bfda1a8d7433a85d2c76265497018ac0398d608 Mon Sep 17 00:00:00 2001 From: Lolitron-0 Date: Fri, 6 Jun 2025 15:02:41 +0300 Subject: [PATCH 08/13] test macos gui build --- .github/workflows/cmake-multi-platform.yml | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index c9a3801..cd56140 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -59,28 +59,31 @@ jobs: sudo apt install -y libjpeg8-dev libpng-dev libasound2-dev alsa-utils alsa-oss libx11-dev libxft-dev libxcursor-dev - - name: Configure CMake (gui) - if: ${{ matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest' }} + - name: Install dependencies (macos) + if: matrix.os == 'macos-latest' run: > - cmake -B ${{ steps.strings.outputs.build-output-dir }} - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -S ${{ github.workspace }} + brew cask install xquartz - - name: Configure CMake (cli) - if: matrix.os == 'macos-latest' + - name: Configure CMake (gui) run: > cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -DNSTALL_CLI_ONLY=ON -S ${{ github.workspace }} - - name: Build for tests - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + #- name: Configure CMake (cli) + # if: matrix.os == 'macos-latest' + # run: > + # cmake -B ${{ steps.strings.outputs.build-output-dir }} + # -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + # -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + # -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + # -DNSTALL_CLI_ONLY=ON + # -S ${{ github.workspace }} + - name: Build + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - name: Test uses: coactions/setup-xvfb@v1 From abcb6c929af8bf30ea7ca9a6a2cf532de75193ef Mon Sep 17 00:00:00 2001 From: Lolitron-0 Date: Fri, 6 Jun 2025 15:03:29 +0300 Subject: [PATCH 09/13] fix macos --- .github/workflows/cmake-multi-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index cd56140..4b4e4ff 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -62,7 +62,7 @@ jobs: - name: Install dependencies (macos) if: matrix.os == 'macos-latest' run: > - brew cask install xquartz + brew install --cask xquartz - name: Configure CMake (gui) run: > From 8f91140d46e13229afd12bf20f2e78d49ebe4490 Mon Sep 17 00:00:00 2001 From: Lolitron-0 Date: Fri, 6 Jun 2025 15:17:32 +0300 Subject: [PATCH 10/13] try fix macos --- .github/workflows/cmake-multi-platform.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 4b4e4ff..4c64f0a 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -86,17 +86,25 @@ jobs: run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - name: Test + if: matrix.os != 'macos-latest' uses: coactions/setup-xvfb@v1 with: run: ctest --build-config ${{ matrix.build_type }} --output-on-failure working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests + - name: Test + if: matrix.os == 'macos-latest' + run: | + sudo Xvfb :99 -ac -screen 0 1024x768x8 & + ctest --build-config ${{ matrix.build_type }} --output-on-failure + working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests + #- name: Test # working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests # run: ctest --build-config ${{ matrix.build_type }} --output-on-failure - name: Create build artifact - if: ${{ matrix.os == 'windows-latest' && matrix.build_type == 'Release' }} + if: ${{ matrix.build_type == 'Release' }} uses: actions/upload-artifact@v4 with: name: build_out From e00da480d0ebb436c7e0dcba03b2d722efea687e Mon Sep 17 00:00:00 2001 From: Lolitron-0 Date: Fri, 6 Jun 2025 15:24:46 +0300 Subject: [PATCH 11/13] try fix macos --- .github/workflows/cmake-multi-platform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 4c64f0a..0cf4310 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -95,7 +95,7 @@ jobs: - name: Test if: matrix.os == 'macos-latest' run: | - sudo Xvfb :99 -ac -screen 0 1024x768x8 & + sudo xvfb :99 -ac -screen 0 1024x768x8 & ctest --build-config ${{ matrix.build_type }} --output-on-failure working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests @@ -107,6 +107,6 @@ jobs: if: ${{ matrix.build_type == 'Release' }} uses: actions/upload-artifact@v4 with: - name: build_out + name: build-out-${{ matrix.os }} path: ${{ steps.strings.outputs.build-output-dir }} retention-days: 5 \ No newline at end of file From f3df62cc266171bb9c16527bedd2141e065efcf3 Mon Sep 17 00:00:00 2001 From: Lolitron-0 Date: Fri, 6 Jun 2025 20:39:53 +0300 Subject: [PATCH 12/13] remove macos compatibility --- .github/workflows/cmake-multi-platform.yml | 38 ++-------------------- 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 0cf4310..7c3ccbd 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest] build_type: [Release,Debug] c_compiler: [gcc, clang, cl] include: @@ -29,9 +29,6 @@ jobs: - os: ubuntu-latest c_compiler: clang cpp_compiler: clang++ - - os: macos-latest - c_compiler: clang - cpp_compiler: clang++ exclude: - os: windows-latest c_compiler: gcc @@ -39,10 +36,6 @@ jobs: c_compiler: clang - os: ubuntu-latest c_compiler: cl - - os: macos-latest - c_compiler: cl - - os: macos-latest - c_compiler: gcc steps: - uses: actions/checkout@v4 @@ -51,7 +44,7 @@ jobs: id: strings shell: bash run: | - echo "build-output-dir=${{ github.workspace }}/test-build" >> "$GITHUB_OUTPUT" + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - name: Install dependencies (linux) if: matrix.os == 'ubuntu-latest' @@ -59,11 +52,6 @@ jobs: sudo apt install -y libjpeg8-dev libpng-dev libasound2-dev alsa-utils alsa-oss libx11-dev libxft-dev libxcursor-dev - - name: Install dependencies (macos) - if: matrix.os == 'macos-latest' - run: > - brew install --cask xquartz - - name: Configure CMake (gui) run: > cmake -B ${{ steps.strings.outputs.build-output-dir }} @@ -72,37 +60,15 @@ jobs: -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }} - #- name: Configure CMake (cli) - # if: matrix.os == 'macos-latest' - # run: > - # cmake -B ${{ steps.strings.outputs.build-output-dir }} - # -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - # -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - # -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - # -DNSTALL_CLI_ONLY=ON - # -S ${{ github.workspace }} - - name: Build run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - name: Test - if: matrix.os != 'macos-latest' uses: coactions/setup-xvfb@v1 with: run: ctest --build-config ${{ matrix.build_type }} --output-on-failure working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests - - name: Test - if: matrix.os == 'macos-latest' - run: | - sudo xvfb :99 -ac -screen 0 1024x768x8 & - ctest --build-config ${{ matrix.build_type }} --output-on-failure - working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests - - #- name: Test - # working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests - # run: ctest --build-config ${{ matrix.build_type }} --output-on-failure - - name: Create build artifact if: ${{ matrix.build_type == 'Release' }} uses: actions/upload-artifact@v4 From ad96eee239d651e639b39324af3b1ee7182a54ea Mon Sep 17 00:00:00 2001 From: Lolitron-0 Date: Fri, 6 Jun 2025 20:48:30 +0300 Subject: [PATCH 13/13] fix artifacts --- .github/workflows/cmake-multi-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 7c3ccbd..b0e6fcf 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -73,6 +73,6 @@ jobs: if: ${{ matrix.build_type == 'Release' }} uses: actions/upload-artifact@v4 with: - name: build-out-${{ matrix.os }} + name: build-out-${{ matrix.os }}-${{ matrix.c_compiler }} path: ${{ steps.strings.outputs.build-output-dir }} retention-days: 5 \ No newline at end of file