From dbef602cc7b1eb5ec76a4df38bd243fac12756fe Mon Sep 17 00:00:00 2001 From: firewave Date: Mon, 4 Aug 2025 13:32:53 +0200 Subject: [PATCH 01/14] added MinGW workflow Co-authored-by: glankk --- .github/workflows/CI-mingw.yml | 113 +++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 .github/workflows/CI-mingw.yml diff --git a/.github/workflows/CI-mingw.yml b/.github/workflows/CI-mingw.yml new file mode 100644 index 00000000..93e90590 --- /dev/null +++ b/.github/workflows/CI-mingw.yml @@ -0,0 +1,113 @@ +name: CI-mingw + +on: [push, pull_request] + +permissions: + contents: read + +defaults: + run: + shell: msys2 {0} + +jobs: + build: + + strategy: + matrix: + compiler: [g++, clang++] + msystem: [MSYS, MINGW32, MINGW64, CLANG64] + include: + - msystem: MSYS + pkg-prefix: '' + - msystem: MINGW32 + pkg-prefix: 'mingw-w64-i686-' + - msystem: MINGW64 + pkg-prefix: 'mingw-w64-x86_64-' + - msystem: CLANG64 + pkg-prefix: 'mingw-w64-clang-x86_64-' + - compiler: g++ + compiler-pkg: gcc + - compiler: clang++ + compiler-pkg: clang + exclude: + - msystem: CLANG64 + compiler: g++ + fail-fast: false + + runs-on: windows-2025 + + env: + CXX: ${{ matrix.compiler }} + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up MSYS2 + uses: msys2/setup-msys2@v2 + with: + release: false # use pre-installed + msystem: ${{ matrix.msystem }} + # TODO: install mingw-w64-x86_64-make and use mingw32.make instead - currently fails with "Windows Subsystem for Linux has no installed distributions." + # TODO: also run tests with non-prefixed Python? + install: >- + make + ${{ matrix.pkg-prefix }}cmake + ${{ matrix.pkg-prefix }}python + ${{ matrix.pkg-prefix }}python-pytest + + - name: install compiler + run: | + pacman -S --noconfirm ${{ matrix.pkg-prefix }}${{ matrix.compiler-pkg }} + ${CXX} -v + + - name: make simplecpp + run: make -j$(nproc) CXXOPTS="-Werror" + + # gcc *and* clang are required to run-tests.py + # install it at this point since it has gcc as dependency which might interfere with the build + - name: install compiler (clang) + if: matrix.compiler == 'g++' + run: | + pacman -S --noconfirm clang + + - name: install compiler (gcc) + if: matrix.compiler == 'clang++' + run: | + pacman -S --noconfirm gcc + + - name: make test + run: make -j$(nproc) test + + - name: selfcheck + run: | + make -j$(nproc) selfcheck + + - name: Run CMake + run: | + cmake -S . -B cmake.output -DCMAKE_COMPILE_WARNING_AS_ERROR=On + + - name: CMake simplecpp + run: | + cmake --build cmake.output --target simplecpp -- -j $(nproc) + + - name: CMake testrunner + run: | + cmake --build cmake.output --target testrunner -- -j $(nproc) + + - name: Run testrunner + run: | + ./cmake.output/testrunner + + - name: Run with libstdc++ debug mode + if: matrix.compiler == 'g++' + run: | + make clean + make -j$(nproc) test selfcheck CXXOPTS="-Werror -g3 -D_GLIBCXX_DEBUG" + + - name: Run with libc++ hardening mode + if: matrix.compiler == 'clang++' && matrix.msystem == 'CLANG64' + run: | + make clean + make -j$(nproc) test selfcheck CXXOPTS="-Werror -stdlib=libc++ -g3 -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG" LDOPTS="-lc++" From 6ff1192cbfee9f8f4538eb500a2f39823b146956 Mon Sep 17 00:00:00 2001 From: firewave Date: Tue, 2 Sep 2025 09:24:25 +0200 Subject: [PATCH 02/14] mitigated some compiler warnings Co-authored-by: glankk --- CMakeLists.txt | 11 ++++++++++- simplecpp.cpp | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index efdc0d96..d91a7c2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,9 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") add_compile_options(-Woverloaded-virtual) # when a function declaration hides virtual functions from a base class add_compile_options(-Wsuggest-attribute=noreturn) - add_compile_options_safe(-Wuseless-cast) + if (NOT MINGW) + add_compile_options_safe(-Wuseless-cast) # triggered by _WIN32 code + endif() elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") add_compile_definitions(_CRT_SECURE_NO_WARNINGS) # TODO: bump warning level @@ -62,6 +64,13 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wno-suggest-destructor-override) # contradicts -Wcovered-switch-default add_compile_options(-Wno-switch-default) + if (MINGW) + add_compile_options(-Wno-reserved-macro-identifier) + add_compile_options(-Wno-unused-macros) + endif() + # these are experimental warning which might produce false positives + add_compile_options_safe(-Wno-thread-safety-negative) + add_compile_options_safe(-Wno-thread-safety-beta) # TODO: fix these? add_compile_options(-Wno-padded) add_compile_options(-Wno-sign-conversion) diff --git a/simplecpp.cpp b/simplecpp.cpp index d5b51080..bca4b9e0 100644 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -3122,7 +3122,7 @@ std::pair simplecpp::FileDataCache::get(const std:: bool simplecpp::FileDataCache::getFileId(const std::string &path, FileID &id) { #ifdef _WIN32 - HANDLE hFile = CreateFileA(path.c_str(), 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE hFile = CreateFileA(path.c_str(), 0, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); if (hFile == INVALID_HANDLE_VALUE) return false; From 7603d5c61400c136829c0f126c386e3e45ada8b5 Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 17 Sep 2025 09:56:12 +0200 Subject: [PATCH 03/14] selfcheck.sh: adjustments for MinGW --- selfcheck.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/selfcheck.sh b/selfcheck.sh index e708023a..b2129cc9 100755 --- a/selfcheck.sh +++ b/selfcheck.sh @@ -41,16 +41,20 @@ if [ "$cxx_type" = "Ubuntu" ] || [ "$cxx_type" = "Debian" ]; then fi # TODO: generate defines from compiler -if [ "$cxx_type" = "g++" ]; then +if [ "$cxx_type" = "g++" ] || [ "$cxx_type" = "g++.exe" ]; then defs= defs="$defs -D__GNUC__" defs="$defs -D__STDC__" defs="$defs -D__x86_64__" defs="$defs -D__STDC_HOSTED__" defs="$defs -D__CHAR_BIT__=8" + if [ "${MSYSTEM}" = "MINGW32" ] || [ "${MSYSTEM}" = "MINGW64" ]; then + defs="$defs -D_WIN32" + fi defs="$defs -D__has_builtin(x)=(1)" defs="$defs -D__has_cpp_attribute(x)=(1)" defs="$defs -D__has_attribute(x)=(1)" + defs="$defs -Ddefined(x)=(0)" inc= while read line @@ -63,12 +67,19 @@ elif [ "$cxx_type" = "clang" ]; then defs="$defs -D__x86_64__" defs="$defs -D__STDC_HOSTED__" defs="$defs -D__CHAR_BIT__=8" + defs="$defs -D__BYTE_ORDER__=1234" + defs="$defs -D__SIZEOF_SIZE_T__=8" + if [ "${MSYSTEM}" = "MINGW32" ] || [ "${MSYSTEM}" = "MINGW64" ] || [ "${MSYSTEM}" = "CLANG64" ]; then + defs="$defs -D_WIN32" + fi defs="$defs -D__has_builtin(x)=(1)" defs="$defs -D__has_cpp_attribute(x)=(1)" defs="$defs -D__has_feature(x)=(1)" - defs="$defs -D__has_include_next(x)=(0)" + defs="$defs -D__has_include_next(x)=(1)" defs="$defs -D__has_attribute(x)=(0)" defs="$defs -D__building_module(x)=(0)" + defs="$defs -D__has_extension(x)=(1)" + defs="$defs -Ddefined(x)=(0)" inc= while read line From 382515d443c9b12fb697ddc1e5d5730b1c739b76 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 3 Oct 2025 11:26:31 +0200 Subject: [PATCH 04/14] s --- test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.cpp b/test.cpp index 26e3b95b..dbfede84 100644 --- a/test.cpp +++ b/test.cpp @@ -3257,7 +3257,7 @@ static void safe_api() } static void isAbsolutePath() { -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) ASSERT_EQUALS(true, simplecpp::isAbsolutePath("C:\\foo\\bar")); ASSERT_EQUALS(true, simplecpp::isAbsolutePath("C:/foo/bar")); ASSERT_EQUALS(true, simplecpp::isAbsolutePath("\\\\foo\\bar")); From f7261988c8c18a2decbd447945e18d1b41e3c013 Mon Sep 17 00:00:00 2001 From: firewave Date: Tue, 7 Oct 2025 19:23:29 +0200 Subject: [PATCH 05/14] cygwin --- .github/workflows/CI-cygwin.yml | 77 +++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/CI-cygwin.yml diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml new file mode 100644 index 00000000..595f6e4e --- /dev/null +++ b/.github/workflows/CI-cygwin.yml @@ -0,0 +1,77 @@ +name: CI-cygwin + +on: [push, pull_request] + +permissions: + contents: read + +defaults: + run: + shell: bash + +jobs: + build: + + strategy: + matrix: + compiler: [g++] + fail-fast: false + + runs-on: windows-2025 + + env: + CXX: ${{ matrix.compiler }} + + steps: + - run: git config --global core.autocrlf input + + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Cygwin + uses: cygwin/cygwin-install-action@v6 + with: + platform: 'x86_64' + packages: | + gcc-g++ + python3 + cmake + + - name: make simplecpp + run: make -j4 CXXOPTS="-Werror" + + - name: make test + run: make -j4 test + + - name: selfcheck + run: | + make -j4 selfcheck + + - name: Run CMake + run: | + cmake -S . -B cmake.output -DCMAKE_COMPILE_WARNING_AS_ERROR=On + + - name: CMake simplecpp + run: | + cmake --build cmake.output --target simplecpp -- -j 4 + + - name: CMake testrunner + run: | + cmake --build cmake.output --target testrunner -- -j 4 + + - name: Run testrunner + run: | + ./cmake.output/testrunner + + - name: Run with libstdc++ debug mode + if: matrix.compiler == 'g++' + run: | + make clean + make -j4 test selfcheck CXXOPTS="-Werror -g3 -D_GLIBCXX_DEBUG" + + - name: Run with libc++ hardening mode + if: matrix.compiler == 'clang++' && matrix.msystem == 'CLANG64' + run: | + make clean + make -j4 test selfcheck CXXOPTS="-Werror -stdlib=libc++ -g3 -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG" LDOPTS="-lc++" From 1df2d99f0b894b1ab006fa60f93ac609d6bade62 Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 11 Oct 2025 16:41:57 +0200 Subject: [PATCH 06/14] renmove --- .github/workflows/CI-mingw.yml | 113 --------------------- .github/workflows/CI-unixish.yml | 163 ------------------------------- .github/workflows/CI-windows.yml | 66 ------------- .github/workflows/clang-tidy.yml | 51 ---------- .github/workflows/format.yml | 62 ------------ 5 files changed, 455 deletions(-) delete mode 100644 .github/workflows/CI-mingw.yml delete mode 100644 .github/workflows/CI-unixish.yml delete mode 100644 .github/workflows/CI-windows.yml delete mode 100644 .github/workflows/clang-tidy.yml delete mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/CI-mingw.yml b/.github/workflows/CI-mingw.yml deleted file mode 100644 index 93e90590..00000000 --- a/.github/workflows/CI-mingw.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: CI-mingw - -on: [push, pull_request] - -permissions: - contents: read - -defaults: - run: - shell: msys2 {0} - -jobs: - build: - - strategy: - matrix: - compiler: [g++, clang++] - msystem: [MSYS, MINGW32, MINGW64, CLANG64] - include: - - msystem: MSYS - pkg-prefix: '' - - msystem: MINGW32 - pkg-prefix: 'mingw-w64-i686-' - - msystem: MINGW64 - pkg-prefix: 'mingw-w64-x86_64-' - - msystem: CLANG64 - pkg-prefix: 'mingw-w64-clang-x86_64-' - - compiler: g++ - compiler-pkg: gcc - - compiler: clang++ - compiler-pkg: clang - exclude: - - msystem: CLANG64 - compiler: g++ - fail-fast: false - - runs-on: windows-2025 - - env: - CXX: ${{ matrix.compiler }} - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Set up MSYS2 - uses: msys2/setup-msys2@v2 - with: - release: false # use pre-installed - msystem: ${{ matrix.msystem }} - # TODO: install mingw-w64-x86_64-make and use mingw32.make instead - currently fails with "Windows Subsystem for Linux has no installed distributions." - # TODO: also run tests with non-prefixed Python? - install: >- - make - ${{ matrix.pkg-prefix }}cmake - ${{ matrix.pkg-prefix }}python - ${{ matrix.pkg-prefix }}python-pytest - - - name: install compiler - run: | - pacman -S --noconfirm ${{ matrix.pkg-prefix }}${{ matrix.compiler-pkg }} - ${CXX} -v - - - name: make simplecpp - run: make -j$(nproc) CXXOPTS="-Werror" - - # gcc *and* clang are required to run-tests.py - # install it at this point since it has gcc as dependency which might interfere with the build - - name: install compiler (clang) - if: matrix.compiler == 'g++' - run: | - pacman -S --noconfirm clang - - - name: install compiler (gcc) - if: matrix.compiler == 'clang++' - run: | - pacman -S --noconfirm gcc - - - name: make test - run: make -j$(nproc) test - - - name: selfcheck - run: | - make -j$(nproc) selfcheck - - - name: Run CMake - run: | - cmake -S . -B cmake.output -DCMAKE_COMPILE_WARNING_AS_ERROR=On - - - name: CMake simplecpp - run: | - cmake --build cmake.output --target simplecpp -- -j $(nproc) - - - name: CMake testrunner - run: | - cmake --build cmake.output --target testrunner -- -j $(nproc) - - - name: Run testrunner - run: | - ./cmake.output/testrunner - - - name: Run with libstdc++ debug mode - if: matrix.compiler == 'g++' - run: | - make clean - make -j$(nproc) test selfcheck CXXOPTS="-Werror -g3 -D_GLIBCXX_DEBUG" - - - name: Run with libc++ hardening mode - if: matrix.compiler == 'clang++' && matrix.msystem == 'CLANG64' - run: | - make clean - make -j$(nproc) test selfcheck CXXOPTS="-Werror -stdlib=libc++ -g3 -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG" LDOPTS="-lc++" diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml deleted file mode 100644 index b4089ee1..00000000 --- a/.github/workflows/CI-unixish.yml +++ /dev/null @@ -1,163 +0,0 @@ -name: CI-unixish - -on: [push, pull_request] - -permissions: - contents: read - -jobs: - build: - - strategy: - matrix: - os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, macos-15] - compiler: [clang++] - include: - - os: ubuntu-22.04 - compiler: g++ - - os: ubuntu-24.04 - compiler: g++ - fail-fast: false - - runs-on: ${{ matrix.os }} - - env: - CXX: ${{ matrix.compiler }} - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - # the man-db trigger causes package installations to stall for several minutes at times. so just drop the package. - # see https://github.com/actions/runner/issues/4030 - - name: Remove man-db package on ubuntu - if: matrix.os == 'ubuntu-24.04' - run: | - sudo apt-get update - sudo apt-get remove man-db - - - name: Install missing software on ubuntu - if: matrix.os == 'ubuntu-24.04' - run: | - sudo apt-get update - sudo apt-get install valgrind - - - name: Install missing software on ubuntu (clang++) - if: contains(matrix.os, 'ubuntu') && matrix.compiler == 'clang++' - run: | - sudo apt-get update - sudo apt-get install libc++-dev - - # coreutils contains "nproc" - - name: Install missing software on macos - if: contains(matrix.os, 'macos') - run: | - brew install coreutils - - - name: Install missing Python packages - run: | - python3 -m pip config set global.break-system-packages true - python3 -m pip install pytest - - - name: make simplecpp - run: make -j$(nproc) CXXOPTS="-Werror" - - - name: make test - run: make -j$(nproc) test CXXOPTS="-Werror" - - - name: selfcheck - run: | - make -j$(nproc) selfcheck - - - name: make testrunner (c++17) - run: | - make clean - make -j$(nproc) testrunner CXXOPTS="-std=c++17" - - - name: make testrunner (c++20) - run: | - make clean - make -j$(nproc) testrunner CXXOPTS="-std=c++20" - - - name: Run CMake - run: | - cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_COMPILE_WARNING_AS_ERROR=On - - - name: CMake simplecpp - run: | - cmake --build cmake.output --target simplecpp -- -j $(nproc) - - - name: CMake testrunner - run: | - cmake --build cmake.output --target testrunner -- -j $(nproc) - ./cmake.output/testrunner - # Re-run tests from within the build directory to validate that - # SIMPLECPP_TEST_SOURCE_DIR is correctly defined and resolved - (cd cmake.output && ./testrunner) - - - name: Run valgrind - if: matrix.os == 'ubuntu-24.04' - run: | - make clean - make -j$(nproc) CXXOPTS="-O1" - valgrind --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --gen-suppressions=all --error-exitcode=42 ./testrunner - # TODO: run Python tests with valgrind - VALGRIND_TOOL=memcheck ./selfcheck.sh - - - name: Run with libstdc++ debug mode - if: matrix.os == 'ubuntu-24.04' && matrix.compiler == 'g++' - run: | - make clean - make -j$(nproc) test selfcheck CXXOPTS="-Werror -g3 -D_GLIBCXX_DEBUG" - - - name: Run with libc++ hardening mode - if: matrix.os == 'ubuntu-24.04' && matrix.compiler == 'clang++' - run: | - make clean - make -j$(nproc) test selfcheck CXXOPTS="-Werror -stdlib=libc++ -g3 -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG" LDOPTS="-lc++" - - - name: Run AddressSanitizer - if: matrix.os == 'ubuntu-24.04' - run: | - make clean - make -j$(nproc) test selfcheck CXXOPTS="-Werror -O2 -g3 -fsanitize=address" LDOPTS="-fsanitize=address" - env: - ASAN_OPTIONS: detect_stack_use_after_return=1 - - - name: Run UndefinedBehaviorSanitizer - if: matrix.os == 'ubuntu-24.04' - run: | - make clean - make -j$(nproc) test selfcheck CXXOPTS="-Werror -O2 -g3 -fsanitize=undefined -fno-sanitize=signed-integer-overflow" LDOPTS="-fsanitize=undefined -fno-sanitize=signed-integer-overflow" - env: - UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1:report_error_type=1 - - # TODO: requires instrumented libc++ - - name: Run MemorySanitizer - if: false && matrix.os == 'ubuntu-24.04' && matrix.compiler == 'clang++' - run: | - make clean - make -j$(nproc) test selfcheck CXXOPTS="-Werror -O2 -g3 -stdlib=libc++ -fsanitize=memory" LDOPTS="-lc++ -fsanitize=memory" - - - name: Run callgrind - if: matrix.os == 'ubuntu-24.04' - run: | - wget https://github.com/danmar/simplecpp/archive/refs/tags/1.5.1.tar.gz - tar xvf 1.5.1.tar.gz - make clean - make -j$(nproc) CXXOPTS="-O2 -g3" - VALGRIND_TOOL=callgrind SIMPLECPP_PATH=simplecpp-1.5.1 ./selfcheck.sh >callgrind.log || (cat callgrind.log && false) - cat callgrind.log - for f in callgrind.out.*; - do - callgrind_annotate --auto=no $f > $f.annotated.log - head -50 $f.annotated.log - done - - - uses: actions/upload-artifact@v4 - if: matrix.os == 'ubuntu-24.04' - with: - name: Callgrind Output - ${{ matrix.compiler }} - path: | - ./callgrind.* diff --git a/.github/workflows/CI-windows.yml b/.github/workflows/CI-windows.yml deleted file mode 100644 index ccf208fa..00000000 --- a/.github/workflows/CI-windows.yml +++ /dev/null @@ -1,66 +0,0 @@ -# Some convenient links: -# - https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md -# - -name: CI-windows - -on: [push,pull_request] - -permissions: - contents: read - -defaults: - run: - shell: cmd - -jobs: - - build: - strategy: - matrix: - os: [windows-2022, windows-2025, windows-11-arm] - config: [Release, Debug] - fail-fast: false - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Setup msbuild.exe - uses: microsoft/setup-msbuild@v2 - - - name: Set up Python 3.13 - uses: actions/setup-python@v5 - with: - python-version: '3.13' - check-latest: true - - - name: Install missing Python packages - run: | - python -m pip install pip --upgrade || exit /b !errorlevel! - python -m pip install pytest || exit /b !errorlevel! - - - name: Run CMake - run: | - cmake -G "Visual Studio 17 2022" -A x64 -Werror=dev --warn-uninitialized -DCMAKE_COMPILE_WARNING_AS_ERROR=On . || exit /b !errorlevel! - - - name: Build - run: | - msbuild -m simplecpp.sln /p:Configuration=${{ matrix.config }} /p:Platform=x64 || exit /b !errorlevel! - - - name: Test - run: | - .\${{ matrix.config }}\testrunner.exe || exit /b !errorlevel! - - - name: Selfcheck - run: | - .\${{ matrix.config }}\simplecpp.exe simplecpp.cpp -e || exit /b !errorlevel! - - - name: integration test - run: | - set SIMPLECPP_EXE_PATH=.\${{ matrix.config }}\simplecpp.exe - python -m pytest integration_test.py -vv || exit /b !errorlevel! - diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml deleted file mode 100644 index 4b52d7bc..00000000 --- a/.github/workflows/clang-tidy.yml +++ /dev/null @@ -1,51 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: clang-tidy - -on: [push, pull_request] - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-24.04 - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - # the man-db trigger causes package installations to stall for several minutes at times. so just drop the package. - # see https://github.com/actions/runner/issues/4030 - - name: Remove man-db package - run: | - sudo apt-get update - sudo apt-get remove man-db - - - name: Install missing software - run: | - sudo apt-get update - sudo apt-get install -y cmake make - - - name: Install clang - run: | - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 21 - sudo apt-get install clang-tidy-21 - - - name: Verify clang-tidy configuration - run: | - clang-tidy-21 --verify-config - - - name: Prepare CMake - run: | - cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - env: - CXX: clang-21 - - - name: Clang-Tidy - run: | - run-clang-tidy-21 -q -j $(nproc) -p=cmake.output diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml deleted file mode 100644 index 4d5657f8..00000000 --- a/.github/workflows/format.yml +++ /dev/null @@ -1,62 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: format - -on: - push: - branches: - - 'master' - - 'releases/**' - - '1.*' - tags: - - '1.*' - pull_request: - -permissions: - contents: read - -jobs: - format: - - runs-on: ubuntu-22.04 - - defaults: - run: - shell: bash -euo pipefail {0} - - env: - UNCRUSTIFY_INSTALL_DIR: ${{ github.workspace }}/runformat-uncrustify - - steps: - - uses: actions/checkout@v5 - with: - persist-credentials: false - - - name: Determine uncrustify version - id: get-uncrustify-version - run: | - version="$(./runformat --expected-uncrustify-version)" - echo "Expected uncrustify version: $version" - echo "version=$version" >> "$GITHUB_OUTPUT" - - - name: Set UNCRUSTIFY_VERSION env variable - run: | - version=$(./runformat --expected-uncrustify-version) - echo "version [$version]" - echo "UNCRUSTIFY_VERSION=${version}" >> "$GITHUB_ENV" - - - name: Cache uncrustify - uses: actions/cache@v4 - id: cache-uncrustify - with: - path: ${{ env.UNCRUSTIFY_INSTALL_DIR }} - key: ${{ runner.os }}-uncrustify-${{ steps.get-uncrustify-version.outputs.version }} - - - name: Install uncrustify - if: steps.cache-uncrustify.outputs.cache-hit != 'true' - run: | - ./runformat --install --install-dir "${UNCRUSTIFY_INSTALL_DIR}" - - - name: Uncrustify check - run: | - ./runformat From 3b2bbf40a2a3e3e30642f07fd373a69b9b078a51 Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 11 Oct 2025 16:53:37 +0200 Subject: [PATCH 07/14] j --- .github/workflows/CI-cygwin.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml index 595f6e4e..4c00f676 100644 --- a/.github/workflows/CI-cygwin.yml +++ b/.github/workflows/CI-cygwin.yml @@ -39,14 +39,14 @@ jobs: cmake - name: make simplecpp - run: make -j4 CXXOPTS="-Werror" + run: make -j1 CXXOPTS="-Werror" - name: make test - run: make -j4 test + run: make -j1 test - name: selfcheck run: | - make -j4 selfcheck + make -j1 selfcheck - name: Run CMake run: | @@ -68,10 +68,10 @@ jobs: if: matrix.compiler == 'g++' run: | make clean - make -j4 test selfcheck CXXOPTS="-Werror -g3 -D_GLIBCXX_DEBUG" + make -j1 test selfcheck CXXOPTS="-Werror -g3 -D_GLIBCXX_DEBUG" - name: Run with libc++ hardening mode if: matrix.compiler == 'clang++' && matrix.msystem == 'CLANG64' run: | make clean - make -j4 test selfcheck CXXOPTS="-Werror -stdlib=libc++ -g3 -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG" LDOPTS="-lc++" + make -j1 test selfcheck CXXOPTS="-Werror -stdlib=libc++ -g3 -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG" LDOPTS="-lc++" From c134e76722fcc297e55e2dc15d613b9407d86f55 Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 11 Oct 2025 16:54:21 +0200 Subject: [PATCH 08/14] cygwin --- .github/workflows/CI-cygwin.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml index 4c00f676..4fc6d054 100644 --- a/.github/workflows/CI-cygwin.yml +++ b/.github/workflows/CI-cygwin.yml @@ -23,7 +23,8 @@ jobs: CXX: ${{ matrix.compiler }} steps: - - run: git config --global core.autocrlf input + - run: | + git config --global core.autocrlf input - uses: actions/checkout@v4 with: @@ -39,10 +40,12 @@ jobs: cmake - name: make simplecpp - run: make -j1 CXXOPTS="-Werror" + run: | + make -j1 CXXOPTS="-Werror" - name: make test - run: make -j1 test + run: | + make -j1 test - name: selfcheck run: | From 09dbda0c1e7b4c219fd4f28fa8b85746ef56209e Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 11 Oct 2025 16:54:54 +0200 Subject: [PATCH 09/14] run --- .github/workflows/CI-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml index 4fc6d054..5f71a053 100644 --- a/.github/workflows/CI-cygwin.yml +++ b/.github/workflows/CI-cygwin.yml @@ -43,7 +43,7 @@ jobs: run: | make -j1 CXXOPTS="-Werror" - - name: make test + - name: run test run: | make -j1 test From f7c2033a304ef5907a21b12030cc993b9a7232a8 Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 11 Oct 2025 16:55:44 +0200 Subject: [PATCH 10/14] cygwin --- .github/workflows/CI-cygwin.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml index 5f71a053..1abbaca8 100644 --- a/.github/workflows/CI-cygwin.yml +++ b/.github/workflows/CI-cygwin.yml @@ -41,6 +41,7 @@ jobs: - name: make simplecpp run: | + ls -l make -j1 CXXOPTS="-Werror" - name: run test From e0dbef05cf9476f7b12067bd85c8844a76add169 Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 11 Oct 2025 17:03:23 +0200 Subject: [PATCH 11/14] cygwin --- .github/workflows/CI-cygwin.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml index 1abbaca8..a3de616d 100644 --- a/.github/workflows/CI-cygwin.yml +++ b/.github/workflows/CI-cygwin.yml @@ -40,7 +40,15 @@ jobs: cmake - name: make simplecpp + shell: cmd run: | + pwd + ls -l + make -j1 CXXOPTS="-Werror" + + - name: make simplecpp + run: | + pwd ls -l make -j1 CXXOPTS="-Werror" From 6583678c30683e3c33285cecdb9c4aefa894a380 Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 11 Oct 2025 17:07:24 +0200 Subject: [PATCH 12/14] cygwin --- .github/workflows/CI-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml index a3de616d..9511e3a8 100644 --- a/.github/workflows/CI-cygwin.yml +++ b/.github/workflows/CI-cygwin.yml @@ -31,7 +31,7 @@ jobs: persist-credentials: false - name: Set up Cygwin - uses: cygwin/cygwin-install-action@v6 + uses: cygwin/cygwin-install-action@v5 with: platform: 'x86_64' packages: | From 8eb602be8e0ea9e0e732b9901a0996018e79feae Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 11 Oct 2025 17:10:28 +0200 Subject: [PATCH 13/14] cygwin --- .github/workflows/CI-cygwin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml index 9511e3a8..af4d6cc9 100644 --- a/.github/workflows/CI-cygwin.yml +++ b/.github/workflows/CI-cygwin.yml @@ -31,7 +31,7 @@ jobs: persist-credentials: false - name: Set up Cygwin - uses: cygwin/cygwin-install-action@v5 + uses: cygwin/cygwin-install-action@v6 with: platform: 'x86_64' packages: | @@ -44,7 +44,7 @@ jobs: run: | pwd ls -l - make -j1 CXXOPTS="-Werror" + C:\cygwin\bin\bash.exe -c make -j1 CXXOPTS="-Werror" - name: make simplecpp run: | From 3a92237c3b8f2c51d731ba06d288e8450a235109 Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 11 Oct 2025 17:12:46 +0200 Subject: [PATCH 14/14] cygwin --- .github/workflows/CI-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml index af4d6cc9..a3de616d 100644 --- a/.github/workflows/CI-cygwin.yml +++ b/.github/workflows/CI-cygwin.yml @@ -44,7 +44,7 @@ jobs: run: | pwd ls -l - C:\cygwin\bin\bash.exe -c make -j1 CXXOPTS="-Werror" + make -j1 CXXOPTS="-Werror" - name: make simplecpp run: |