Skip to content

CI: various improvements #4633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- name: "Linux x64 (Ubuntu 24.04) - Clang 19 with ASan and UBSan"
os: ubuntu-24.04
build: { cc: clang-19, cxx: clang++-19, linker: ld.lld-19, sanitize: true }
build: { cc: clang-19, cxx: clang++-19, linker: ld.lld-19, sanitize: 'address,undefined' }

- name: "macOS arm64 (14) - Xcode 15"
os: macos-14
Expand All @@ -32,7 +32,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Install Ubuntu dependencies
if: runner.os == 'Linux'
Expand Down Expand Up @@ -69,40 +69,44 @@ jobs:

- name: Install Clang 19
if: runner.os == 'Linux' && matrix.build.cc == 'clang-19'
run: sudo apt-get install clang-19 libomp-19-dev lld-19 llvm-19
run: sudo apt-get install clang-19 libclang-rt-19-dev lld-19 llvm-19

- name: Prepare macOS environment
if: runner.os == 'macOS'
run: |
echo "PKG_CONFIG_PATH=$(brew --prefix mozjpeg)/lib/pkgconfig:$(brew --prefix libarchive)/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV

- name: Prepare sanitizers
- name: Prepare sanitizers environment
if: matrix.build.sanitize
env:
LLVM_PREFIX: /usr/lib/llvm-19
run: |
ASAN_DSO=`$CC -print-file-name=libclang_rt.asan-x86_64.so`
echo "LDSHARED=$CC -shared" >> $GITHUB_ENV
echo "CPPFLAGS=-g -fsanitize=address,undefined -fno-sanitize=function -fno-omit-frame-pointer -fopenmp -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" >> $GITHUB_ENV
echo "LDFLAGS=-g -fsanitize=address,undefined -shared-libasan -fopenmp=libomp" >> $GITHUB_ENV
echo "ASAN_DSO=$ASAN_DSO" >> $GITHUB_ENV
echo "CPPFLAGS=-g -fno-omit-frame-pointer -fno-sanitize=function -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" >> $GITHUB_ENV
echo "LDFLAGS=-g -shared-libsan" >> $GITHUB_ENV
# Glib is built without -fno-omit-frame-pointer. We need
# to disable the fast unwinder to get full stacktraces.
echo "ASAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/asan.supp:fast_unwind_on_malloc=0:allocator_may_return_null=1" >> $GITHUB_ENV
echo "LSAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/lsan.supp:fast_unwind_on_malloc=0" >> $GITHUB_ENV
echo "TSAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/tsan.supp" >> $GITHUB_ENV
# Ensure UBSan issues causes the program to abort.
echo "UBSAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/ubsan.supp:halt_on_error=1:abort_on_error=1:print_stacktrace=1" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LLVM_PREFIX/lib:`dirname $ASAN_DSO`" >> $GITHUB_ENV
echo "$LLVM_PREFIX/bin" >> $GITHUB_PATH
echo "$(dirname $($CC -print-prog-name=llvm-symbolizer))" >> $GITHUB_PATH

- name: Prepare ASan/UBSan
if: matrix.build.sanitize == 'address,undefined'
run: |
ASAN_DSO=$($CC -print-file-name=libclang_rt.asan-x86_64.so)
echo "SANITIZE_DSO=$ASAN_DSO" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$(dirname $ASAN_DSO)" >> $GITHUB_ENV

- name: Configure libvips
run:
meson setup build
-Ddebug=true
-Ddocs=${{ matrix.build.docs && 'true' || 'false' }}
-Ddeprecated=false
-Dmagick=disabled
-Ddocs=${{ matrix.build.docs || 'false' }}
-Dintrospection=${{ matrix.build.docs && 'enabled' || 'disabled' }}
-Db_sanitize=${{ matrix.build.sanitize || 'none' }}
-Db_lundef=${{ matrix.build.sanitize && 'false' || 'true' }}
|| (cat build/meson-logs/meson-log.txt && exit 1)

- name: Build libvips
Expand All @@ -126,5 +130,5 @@ jobs:
- name: Run test suite
env:
VIPS_LEAK: 1
LD_PRELOAD: ${{ env.ASAN_DSO }}
LD_PRELOAD: ${{ env.SANITIZE_DSO }}
run: python3 -m pytest -sv --log-cli-level=WARNING test/test-suite
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
cpp-linter:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: cpp-linter/cpp-linter-action@v2
id: linter
with:
Expand Down
Loading