Skip to content

[build] Clang 15 requires a flag to enable <ranges> #1373

[build] Clang 15 requires a flag to enable <ranges>

[build] Clang 15 requires a flag to enable <ranges> #1373

Workflow file for this run

name: CI
on: [push]
defaults:
run:
shell: bash
env:
CCACHE_SLOPPINESS: pch_defines,time_macros
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
name: "GCC 11 / Release"
cc: gcc
cc_ver: 11
cxx: g++
libcxx: libstdc++11
build_args: ""
- os: ubuntu-22.04
name: "GCC 12 / Release"
cc: gcc
cc_ver: 12
cxx: g++
libcxx: libstdc++11
build_args: ""
- os: ubuntu-24.04
name: "GCC 13 / Release"
cc: gcc
cc_ver: 13
cxx: g++
libcxx: libstdc++11
build_args: ""
- os: ubuntu-24.04
name: "Clang 17 / Release"
cc: clang
cc_ver: 17
cxx: clang++
libcxx: libc++
apt: libc++-17-dev libc++abi-17-dev libc++-18-dev- libc++1-18- libc++abi-18-dev- libc++abi1-18- libunwind-18- libunwind-18-dev-
build_args: ""
- os: ubuntu-24.04
name: "Clang 18 / Release"
cc: clang
cc_ver: 18
cxx: clang++
libcxx: libc++
apt: libc++-18-dev libc++abi-18-dev
build_args: ""
- os: ubuntu-24.04
name: "GCC 14 / Debug ASAN"
cc: gcc
cc_ver: 14
cxx: g++
libcxx: libstdc++11
build_args: "--debug --asan --ubsan"
- os: ubuntu-24.04
name: "GCC 14 / MinSizeRel Unity"
cc: gcc
cc_ver: 14
cxx: g++
libcxx: libstdc++11
build_args: "--minsize --unity"
- os: macos-13
name: "Clang 15 / Release"
cc: clang
cc_ver: 15
libcxx: libc++
clang: llvm@15
os_target: "13.0"
build_args: ""
- os: macos-15
name: "Clang 18 arm64 / Release"
cc: clang
cc_ver: 18
libcxx: libc++
clang: llvm@18
os_target: "15.0"
build_args: ""
- os: macos-13
name: "Xcode 14.3 / Release"
cc: apple-clang
cc_ver: 14
libcxx: libc++
clang: Xcode_14.3
os_target: "13.0"
build_args: ""
- os: macos-13
name: "Xcode 15.2 / Release"
cc: apple-clang
cc_ver: 15
libcxx: libc++
clang: Xcode_15.2.0
os_target: "13.0"
build_args: ""
- os: macos-14
name: "Xcode 15.4 arm64 / Release"
cc: apple-clang
cc_ver: 15
libcxx: libc++
clang: Xcode_15.4.0
os_target: "14.0"
build_args: ""
- os: macos-15
name: "Xcode 16.1 arm64 / Release"
cc: apple-clang
cc_ver: 16
libcxx: libc++
clang: Xcode_16.1.0
os_target: "15.0"
build_args: ""
- os: windows-2019
name: "VS 16 / Release"
cc: msvc
cc_ver: 192
build_args: "-DCMAKE_DISABLE_PRECOMPILE_HEADERS=1"
- os: windows-2022
name: "VS 17 / Release"
cc: msvc
cc_ver: 194
build_args: "-DCMAKE_DISABLE_PRECOMPILE_HEADERS=1"
name: ${{ matrix.os }} / ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }}
CONAN_REVISIONS_ENABLED: 1
BUILD_ARGS: ${{ matrix.build_args }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- uses: ilammy/msvc-dev-cmd@v1
- name: "install tools and deps"
id: tools
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt-get update
sudo apt-get install --no-install-recommends -y ninja-build \
libsdl2-dev libfreetype6-dev libharfbuzz-dev libhyperscan-dev \
${{ matrix.apt }}
export CC=${{ matrix.cc }}-${{ matrix.cc_ver }}
export CXX=${{ matrix.cxx }}-${{ matrix.cc_ver }}
echo "CC='$CC'" >> $GITHUB_ENV
echo "CXX='$CXX'" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "macOS" ]]; then
brew install ninja sdl2 doxygen google-benchmark libzip
if [[ "$(uname -m)" == "x86_64" ]]; then
brew install hyperscan
# WORKAROUND: broken cmake config in brew harfbuzz package
ln -s /usr/local/lib/libharfbuzz.0.dylib /usr/local/lib/libharfbuzz.0..dylib
else
brew install vectorscan
fi
if [[ "${{ matrix.clang }}" == llvm* ]] ; then
export CC="$(brew --prefix ${{ matrix.clang }})/bin/clang"
export CXX="$(brew --prefix ${{ matrix.clang }})/bin/clang++"
echo "CC='$CC'" >> $GITHUB_ENV
echo "CXX='$CXX'" >> $GITHUB_ENV
else
sudo xcode-select -s "/Applications/${{ matrix.clang }}.app"
fi
export MACOSX_DEPLOYMENT_TARGET=${{ matrix.os_target }}
echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "Windows" ]]; then
# remove MinGW's link as it collides with MSVC
mv /usr/bin/link /usr/bin/link.orig
# upgrade tools
choco install ccache ninja
which ccache; ccache --version
which ninja; ninja --version
fi
# Install conan
pip3 --no-cache-dir install conan
conan --version
echo "CONAN_HOME=$(conan config home)" >> $GITHUB_OUTPUT
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.13
with:
key: ${{ matrix.os }}-${{ matrix.name }}
- name: conan cache
uses: actions/cache@v4
with:
path: ${{ steps.tools.outputs.CONAN_HOME }}
key: ${{ matrix.os }}-${{ matrix.name }}-${{ hashFiles('conanfile.py', 'conandata.yml') }}-${{github.sha}}
restore-keys: |
${{ matrix.os }}-${{ matrix.name }}-${{ hashFiles('conanfile.py', 'conandata.yml') }}-
${{ matrix.os }}-${{ matrix.name }}-
${{ matrix.os }}-
- name: conan config
run: |
mkdir -p "$(conan config home)/profiles"
cat <<EOF > "$(conan config home)/profiles/default"
[settings]
os={{ {"Darwin": "Macos"}.get(platform.system(), platform.system()) }}
arch={{ {"arm64": "armv8", "AMD64": "x86_64"}.get(platform.machine(), platform.machine()) }}
build_type=Release
compiler=${{ matrix.cc }}
compiler.version=${{ matrix.cc_ver }}
compiler.cppstd=20
{% if platform.system() == "Windows" %}
compiler.runtime=dynamic
{% else %}
compiler.libcxx=${{ matrix.libcxx }}
{% endif %}
{% if platform.system() == "Darwin" %}
os.version=${{ matrix.os_target }}
{% endif %}
EOF
if [[ "$RUNNER_OS" == "Linux" && "$CXX" = clang* ]]; then
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
fi
if [[ "$RUNNER_OS" == "Windows" ]]; then
# Disable builtin compatibility extension, force exact cppstd
cat <<-EOF > "$(conan config home)/extensions/plugins/compatibility/compatibility.py"
def compatibility(conanfile):
return []
EOF
fi
cat "$(conan config home)/profiles/default"
- name: deps
run: |
if [[ "$RUNNER_OS" == "macOS" ]]; then
./build_deps.py fmt
fi
./build.sh deps $BUILD_ARGS
- name: configure
run: ./build.sh config $BUILD_ARGS
- name: build
run: ./build.sh build $BUILD_ARGS
- name: test
run: ./build.sh test $BUILD_ARGS
- name: install
if: ${{ matrix.name == 'Release build' }}
run: ./build.sh install $BUILD_ARGS
- name: package
if: ${{ matrix.name == 'Release build' }}
run: ./build.sh package $BUILD_ARGS
- name: artifacts - tarball
if: ${{ matrix.name == 'Release build' }}
uses: actions/upload-artifact@v4
with:
name: xcikit-artifacts
path: |
artifacts/xcikit-*.tar.gz
- name: artifacts - test report
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: test-report
path: |
build/*/Testing/Temporary/LastTest.log
# - name: deploy conan package
# if: github.ref == 'refs/heads/master'
# run: |
# conan remote add xcikit https://api.bintray.com/conan/rbrich/xcikit
# conan user -p $CONAN_PASSWORD -r xcikit rbrich
# conan upload "xcikit/*@rbrich/stable" --all --no-overwrite --check --confirm -r=xcikit