From 4c83f5eacc2db5c19cd185a16b0882033f3097e8 Mon Sep 17 00:00:00 2001 From: Bruno Lopes Date: Thu, 12 Mar 2026 21:06:07 -0300 Subject: [PATCH] gitlab-ci, build/macos: Only save macports/ on GitLab CI cache The Hessele runner started to complain about the artifacts size and the macports/ dir as artifact is not needed on a non-splitted job. It was a leftover from the inspiration from Flatpak scripts. (On Flatpak it is needed becase if we don't pass .flatpak-builder as artifacts the gimp job will not know that babl and gegl were built) --- .gitlab-ci.yml | 7 ++++++- build/macos/1_build-deps-macports.sh | 17 ++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e6245c121d..7d031bac58 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -699,7 +699,6 @@ deps-macos-inhouse: - zsh build/macos/1_build-deps-macports.sh artifacts: paths: - - macports-$ARCH - _install-* # The full build dir is needed due to its .o for .dSYM creation on next job - babl/_build-* @@ -712,6 +711,12 @@ gimp-macos-inhouse: stage: build variables: GIT_SUBMODULE_STRATEGY: recursive + cache: + - key: $CI_PROJECT_NAMESPACE-$ARCH + unprotect: true + paths: + - macports-cached-$ARCH + policy: pull script: # Do not call sh since it is old bash on macOS, not the default zsh - zsh build/macos/2_build-gimp-macports.sh diff --git a/build/macos/1_build-deps-macports.sh b/build/macos/1_build-deps-macports.sh index c48374ee63..b4d85cb279 100644 --- a/build/macos/1_build-deps-macports.sh +++ b/build/macos/1_build-deps-macports.sh @@ -38,20 +38,15 @@ fi #End of config printf "\e[0Ksection_start:`date +%s`:deps_install[collapsed=true]\r\e[0KInstalling dependencies provided by $( [ -f "$OPT_PREFIX/bin/port" ] && echo MacPorts || echo Homebrew )\n" if [ -f "$OPT_PREFIX/bin/port" ]; then eval $( [ "$OPT_PREFIX" = /opt/local ] && echo sudo ) port sync && eval $( [ "$OPT_PREFIX" = /opt/local ] && echo sudo ) port upgrade outdated - if [ "$CI_JOB_NAME" ] && ls -d macports* 2>/dev/null | grep -q .; then - if [ -d "macports-cached-$(uname -m)" ]; then - cp -fa macports-cached-$(uname -m)/* $OPT_PREFIX/var/macports || true - elif [ -d "macports-$(uname -m)" ]; then - cp -fa macports-$(uname -m)/* $OPT_PREFIX/var/macports || true - fi + if [ "$CI_JOB_NAME" ] && [ -d "macports-cached-$(uname -m)" ]; then + cp -fa macports-cached-$(uname -m)/* $OPT_PREFIX/var/macports || true eval $( [ "$OPT_PREFIX" = /opt/local ] && echo sudo ) port deactivate -fN installed + elif echo "$CI_JOB_NAME" | grep -q 'deps'; then + export first_cache=true fi eval $( [ "$OPT_PREFIX" = /opt/local ] && echo sudo ) port install -N $(grep -v '^#' build/macos/all-deps-uni.txt | sed 's/|homebrew:[^ ]*//g' | tr -d '\' | xargs) - if echo "$CI_JOB_NAME" | grep -q 'deps'; then - mkdir -p macports-$(uname -m) && cp -fa $OPT_PREFIX/var/macports/* macports-$(uname -m) || true - if [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ]; then - cp -fa macports-$(uname -m) macports-cached-$(uname -m) || true - fi + if echo "$CI_JOB_NAME" | grep -q 'deps' && { [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ] || [ "$first_cache" ] }; then + mkdir -p macports-cached-$(uname -m) && cp -fa $OPT_PREFIX/var/macports/* macports-cached-$(uname -m) || true fi git apply -v build/macos/patches/0001-meson-Patch-python-version.patch || true else