From 139f198416cc52286b36feca49a73a7cac18c00d Mon Sep 17 00:00:00 2001 From: fl4tisjustice Date: Mon, 20 Oct 2025 15:10:42 +0100 Subject: [PATCH 1/9] testing --- .github/pipeline.yml | 79 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/pipeline.yml diff --git a/.github/pipeline.yml b/.github/pipeline.yml new file mode 100644 index 0000000..24056bc --- /dev/null +++ b/.github/pipeline.yml @@ -0,0 +1,79 @@ +name: libringqueue +on: + push: + tags: + - 'v*.*.*' # Triggers on version tags + branches: + - '**' # Triggers on all branches + workflow_dispatch: + +jobs: + build: + name: ${{ matrix.build-name }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + build-name: linux + additional-args: "['-DCMAKE_CXX_COMPILER=g++-14']" + - os: windows-2025 + build-name: windows + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: '0' + + - uses: lukka/get-cmake@latest + + - name: Build the project + uses: lukka/run-cmake@v10 + with: + configurePreset: Release + buildPreset: Release + configurePresetAdditionalArgs: ${{ matrix.additional-args }} + + - name: Create Github Artifact + uses: actions/upload-artifact@v4.1.0 + with: + name: libringqueue-${{ matrix.build-name }} + path: ${{ github.workspace }}/build/Release/libringqueue* + + finalize: + runs-on: ubuntu-latest + needs: + - build + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: '0' + + - name: Get Next Version + id: getver + uses: anothrNick/github-tag-action@v1 + if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags') || github.ref_name == 'master') + env: + GITHUB_TOKEN: ${{ github.token }} + TAG_PREFIX: v + DEFAULT_BUMP: patch + + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + merge-multiple: true + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + if: github.event_name == 'push' && ((startsWith(github.ref, 'refs/tags') || github.ref_name == 'master')) + with: + files: | + ${{ github.workspace }}/libringqueue.so + ${{ github.workspace }}/libringqueue.dll + + tag_name: ${{ steps.getver.outputs.new_tag }} + env: + GITHUB_TOKEN: ${{ github.token }} From 8e4c9c39fd240aa5481a43f15a6e297139c05656 Mon Sep 17 00:00:00 2001 From: fl4tisjustice Date: Mon, 20 Oct 2025 15:11:45 +0100 Subject: [PATCH 2/9] Wrong folder --- .github/{ => workflows}/pipeline.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/pipeline.yml (100%) diff --git a/.github/pipeline.yml b/.github/workflows/pipeline.yml similarity index 100% rename from .github/pipeline.yml rename to .github/workflows/pipeline.yml From 4002210312b45a670c3630fb9c7d4f7be0d7a9f7 Mon Sep 17 00:00:00 2001 From: fl4tisjustice Date: Mon, 20 Oct 2025 15:13:25 +0100 Subject: [PATCH 3/9] Remove useless compiler flag --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 913cd4f..b1737fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ set_target_properties (ringqueue PROPERTIES DEFINE_SYMBOL LIBRINGQUEUE_BUILD ) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -pedantic-errors -Wpedantic -Wall -Werror -Wextra -Wabi -fPIC -fvisibility=hidden") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -pedantic-errors -Wpedantic -Wall -Werror -Wextra -fPIC -fvisibility=hidden") target_sources(ringqueue PRIVATE ${PROJECT_SOURCE_DIR}/src/ringbuffer_interface.cpp From c62132cab1919580aa1049ef611c641473dd0413 Mon Sep 17 00:00:00 2001 From: fl4tisjustice Date: Mon, 20 Oct 2025 15:15:47 +0100 Subject: [PATCH 4/9] Follow proper fprintf signature --- src/ringbuffer_interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ringbuffer_interface.cpp b/src/ringbuffer_interface.cpp index 41096dc..f29d734 100644 --- a/src/ringbuffer_interface.cpp +++ b/src/ringbuffer_interface.cpp @@ -20,7 +20,7 @@ extern "C" { try { reinterpret_cast*>(handle)->enqueueMany(std::span(static_cast(item), size)); } catch (const std::length_error &e) { - fprintf(stderr, e.what()); + fprintf(stderr, "%s\n", e.what()); return false; } @@ -31,7 +31,7 @@ extern "C" { try { return reinterpret_cast*>(handle)->popMany(static_cast(out), size); } catch (const std::out_of_range &e) { - fprintf(stderr, e.what()); + fprintf(stderr, "%s\n", e.what()); return false; } From 26cb793bb8e189321286d78b025611be5dff075d Mon Sep 17 00:00:00 2001 From: fl4tisjustice Date: Mon, 20 Oct 2025 15:18:13 +0100 Subject: [PATCH 5/9] Explicitly ignore return value --- include/ringqueue.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ringqueue.hpp b/include/ringqueue.hpp index 163a190..879746f 100644 --- a/include/ringqueue.hpp +++ b/include/ringqueue.hpp @@ -89,7 +89,7 @@ class RingQueue { #ifdef __linux int fd = memfd_create(ANONYMOUS_FILENAME, MFD_CLOEXEC); - ftruncate(fd, size); + static_cast(ftruncate(fd, size)); void *const shm = mmap(nullptr, size * 2zu, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0l); From 283949fe35487684596143fcafd6c1a19ba7e394 Mon Sep 17 00:00:00 2001 From: fl4tisjustice Date: Mon, 20 Oct 2025 15:21:34 +0100 Subject: [PATCH 6/9] Explicitly ignore return value again --- include/ringqueue.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/ringqueue.hpp b/include/ringqueue.hpp index 879746f..58081df 100644 --- a/include/ringqueue.hpp +++ b/include/ringqueue.hpp @@ -89,7 +89,8 @@ class RingQueue { #ifdef __linux int fd = memfd_create(ANONYMOUS_FILENAME, MFD_CLOEXEC); - static_cast(ftruncate(fd, size)); + const _ = ftruncate(fd, size); + static_cast(_); void *const shm = mmap(nullptr, size * 2zu, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0l); From 9cb171c82f819144cfd786f19921dd3a4299be5b Mon Sep 17 00:00:00 2001 From: fl4tisjustice Date: Mon, 20 Oct 2025 15:22:35 +0100 Subject: [PATCH 7/9] Explicitly ignore return value again again --- include/ringqueue.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ringqueue.hpp b/include/ringqueue.hpp index 58081df..097375c 100644 --- a/include/ringqueue.hpp +++ b/include/ringqueue.hpp @@ -89,7 +89,7 @@ class RingQueue { #ifdef __linux int fd = memfd_create(ANONYMOUS_FILENAME, MFD_CLOEXEC); - const _ = ftruncate(fd, size); + const int _ = ftruncate(fd, size); static_cast(_); void *const shm = mmap(nullptr, size * 2zu, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0l); From c1d04f26a43a7974d0862bff3ab65e7d66148f39 Mon Sep 17 00:00:00 2001 From: fl4tisjustice Date: Mon, 20 Oct 2025 15:31:06 +0100 Subject: [PATCH 8/9] Ensure proper linker argument ordering --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1737fa..6f9e937 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ target_include_directories(ringqueue PUBLIC target_link_options(ringqueue PRIVATE -shared -fPIC -fvisibility=hidden) if (WIN32) - target_link_options(ringqueue PRIVATE -static-libgcc -static-libstdc++ LINKER:-Bstatic,--whole-archive -lwinpthread LINKER:-Bdynamic,--no-whole-archive -lonecore) + target_link_libraries(ringqueue PRIVATE -static-libgcc -static-libstdc++ LINKER:-Bstatic,--whole-archive -lwinpthread LINKER:-Bdynamic,--no-whole-archive -lonecore) endif () install(TARGETS ringqueue DESTINATION .) From 94d2806d331d0c158b2fb0a9b1f92b5295ebdd51 Mon Sep 17 00:00:00 2001 From: fl4tisjustice Date: Mon, 20 Oct 2025 15:37:44 +0100 Subject: [PATCH 9/9] Ensure correct default branch name --- .github/workflows/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 24056bc..3a3c8a8 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -55,7 +55,7 @@ jobs: - name: Get Next Version id: getver uses: anothrNick/github-tag-action@v1 - if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags') || github.ref_name == 'master') + if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags') || github.ref_name == 'main') env: GITHUB_TOKEN: ${{ github.token }} TAG_PREFIX: v @@ -68,7 +68,7 @@ jobs: - name: Create GitHub Release uses: softprops/action-gh-release@v1 - if: github.event_name == 'push' && ((startsWith(github.ref, 'refs/tags') || github.ref_name == 'master')) + if: github.event_name == 'push' && ((startsWith(github.ref, 'refs/tags') || github.ref_name == 'main')) with: files: | ${{ github.workspace }}/libringqueue.so