Fix GCC 14 stringop-overflow warning in date library #424
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Linux builds (basic) | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| name: ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}} | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| cxx: | |
| - g++-14 | |
| # Note: Older compilers (g++-12, g++-13, clang++-16, clang++-17, clang++-18) | |
| # don't have full C++23 stdlib support (missing std::format in libstdc++) | |
| build_type: [Debug] #, Release] | |
| std: [23] | |
| include: | |
| - cxx: g++-14 | |
| cc: gcc-14 | |
| other_pkgs: g++-14 | |
| cxxflags: "-O1 -fmax-errors=5" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Verify directory structure | |
| run: | | |
| echo "Verifying directory structure..." | |
| echo "Contents of root directory:" | |
| ls -la | |
| echo "" | |
| echo "Checking essential directories:" | |
| for dir in src main scripts assets config docs fonts external/core; do | |
| if [ -d "$dir" ]; then | |
| echo "✓ $dir/ exists" | |
| else | |
| echo "✗ $dir/ missing" | |
| exit 1 | |
| fi | |
| done | |
| echo "Directory verification complete." | |
| - name: Prepare environment | |
| env: | |
| TZ: "America/Los_Angeles" | |
| run: | | |
| sudo ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime | |
| echo ${TZ} | sudo tee /etc/timezone | |
| sudo apt-get update -q | |
| sudo apt-get install -y -y --no-install-recommends \ | |
| ${{matrix.other_pkgs}} \ | |
| build-essential \ | |
| xorg-dev \ | |
| libmotif-dev \ | |
| libfreetype6-dev \ | |
| cmake \ | |
| git \ | |
| xwit \ | |
| xfonts-base \ | |
| xfonts-75dpi \ | |
| xfonts-100dpi \ | |
| tzdata \ | |
| libcurl4-gnutls-dev | |
| - name: Configure build | |
| env: | |
| CC: ${{matrix.cc}} | |
| CXX: ${{matrix.cxx}} | |
| CXXFLAGS: ${{matrix.cxxflags}} | |
| run: | | |
| echo "Configuring build for ${{matrix.cxx}}..." | |
| cmake -S . -B _build_${{matrix.cxx}}_${{matrix.std}} \ | |
| -DCMAKE_INSTALL_PREFIX="${PWD}/_install_${{matrix.cxx}}_${{matrix.std}}" \ | |
| -DCMAKE_BUILD_TYPE="${{matrix.build_type}}" \ | |
| -DCMAKE_CXX_STANDARD=${{matrix.std}} \ | |
| -DCMAKE_CXX_EXTENSIONS=OFF | |
| - name: Build + install | |
| run: | | |
| echo "Building with ${{matrix.cxx}}..." | |
| echo "Available CPU cores: $(nproc)" | |
| echo "Starting build at $(date)..." | |
| # Run build and capture exit code | |
| set +e | |
| timeout 600 cmake --build _build_${{matrix.cxx}}_${{matrix.std}} -j4 | |
| BUILD_EXIT_CODE=$? | |
| set -e | |
| echo "Build command completed at $(date) with exit code $BUILD_EXIT_CODE" | |
| if [ $BUILD_EXIT_CODE -ne 0 ]; then | |
| echo "Build failed with exit code $BUILD_EXIT_CODE" | |
| echo "Showing last 100 lines of CMake build output:" | |
| tail -100 _build_${{matrix.cxx}}_${{matrix.std}}/CMakeFiles/CMakeOutput.log 2>/dev/null || echo "No CMakeOutput.log found" | |
| echo "Showing last 100 lines of CMake error output:" | |
| tail -100 _build_${{matrix.cxx}}_${{matrix.std}}/CMakeFiles/CMakeError.log 2>/dev/null || echo "No CMakeError.log found" | |
| exit $BUILD_EXIT_CODE | |
| fi | |
| if [ -f "_build_${{matrix.cxx}}_${{matrix.std}}/vt_main" ]; then | |
| echo "Build appears successful, running tests..." | |
| ctest --test-dir _build_${{matrix.cxx}}_${{matrix.std}} --output-on-failure -j$(nproc) | |
| echo "Tests completed successfully, proceeding with install..." | |
| timeout 120 cmake --build _build_${{matrix.cxx}}_${{matrix.std}} --target install | |
| else | |
| echo "Build failed - executable not found" | |
| exit 1 | |
| fi |