[vlc-commits] [Git][videolan/vlc][master] 2 commits: CI: Use ccache for macOS jobs

Jean-Baptiste Kempf gitlab at videolan.org
Tue Jun 8 18:45:02 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
917d8a0d by Marvin Scholz at 2021-06-08T15:05:23+00:00
CI: Use ccache for macOS jobs

- - - - -
4e96ce30 by Marvin Scholz at 2021-06-08T15:05:23+00:00
package/macosx: add ccache support to env.build.sh

- - - - -


2 changed files:

- extras/ci/gitlab-ci.yml
- extras/package/macosx/env.build.sh


Changes:

=====================================
extras/ci/gitlab-ci.yml
=====================================
@@ -316,8 +316,36 @@ raspbian-arm:
 #
 # macOS
 #
+.ccache-common-apple:
+  variables:
+    CCACHE_BASEDIR: ${CI_PROJECT_DIR}
+    CCACHE_DIR: ${CI_PROJECT_DIR}/ccache
+    CCACHE_COMPILERCHECK: content
+    CCACHE_CPP2: 'true'
+    VLC_CCACHE_BINS_PATH: '/Users/videolanci/sandbox/bin/ccache/bin'
+  before_script:
+    - |
+      if [ -x "${VLC_CCACHE_BINS_PATH}/ccache" ]; then
+        ${VLC_CCACHE_BINS_PATH}/ccache --zero-stats
+        ${VLC_CCACHE_BINS_PATH}/ccache --show-stats
+      else
+        echo "No ccache present, disabling caching"
+        unset VLC_CCACHE_BINS_PATH
+      fi
+  after_script:
+    - |
+      if [ -x "${VLC_CCACHE_BINS_PATH}/ccache" ]; then
+        ${VLC_CCACHE_BINS_PATH}/ccache --show-stats
+      fi
+  cache:
+    key: ${CI_JOB_NAME}
+    paths:
+      - ccache
+
 .macos-common:
-    extends: .base-template
+    extends:
+        - .base-template
+        - .ccache-common-apple
     tags:
         - amd64
         - catalina


=====================================
extras/package/macosx/env.build.sh
=====================================
@@ -48,6 +48,9 @@ vlcGetRootDir() {
     echo "$(cd -P "$(dirname "$SOURCE")/../../../" && pwd)"
 }
 
+# If VLC_CCACHE_BINS_PATH is set, it is assumed it contains
+# clang and clang++ symlinks to the ccache binary which will
+# then act as a compiler wrapper
 vlcSetBaseEnvironment() {
     local LOCAL_BUILD_TRIPLET="$BUILD_TRIPLET"
     if [ -z "$LOCAL_BUILD_TRIPLET" ]; then
@@ -68,6 +71,19 @@ vlcSetBaseEnvironment() {
     export RANLIB="$(xcrun --find ranlib)"
     export STRIP="$(xcrun --find strip)"
 
+    if [ -n "${VLC_CCACHE_BINS_PATH}" ]; then
+        if [ -d "${VLC_CCACHE_BINS_PATH}" ]; then
+            echo "Using ccache compiler wrappers in '${VLC_CCACHE_BINS_PATH}'"
+            export CC="${VLC_CCACHE_BINS_PATH}/cc"
+            export CXX="${VLC_CCACHE_BINS_PATH}/c++"
+            export OBJC="${VLC_CCACHE_BINS_PATH}/cc"
+            export OBJCXX="${VLC_CCACHE_BINS_PATH}/c++"
+        else
+            echo "Invalid VLC_CCACHE_BINS_PATH given, directory not found: '${VLC_CCACHE_BINS_PATH}'"
+            echo "Proceeding without ccache wrappers"
+        fi
+    fi
+
     python3Path=$(echo /Library/Frameworks/Python.framework/Versions/3.*/bin | awk '{print $1;}')
     if [ ! -d "$python3Path" ]; then
         python3Path=""



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8ef60b3b62adc5bd7cb2281e9d676dd938d66663...4e96ce306e72b824e38abd09d2ef2461ea2a97e0

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8ef60b3b62adc5bd7cb2281e9d676dd938d66663...4e96ce306e72b824e38abd09d2ef2461ea2a97e0
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list