[vlc-commits] [Git][videolan/vlc][master] 2 commits: CI: restrict the build scripts used to build contribs

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Feb 18 12:28:36 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
4ac6168d by Steve Lhomme at 2024-02-18T11:06:44+00:00
CI: restrict the build scripts used to build contribs

For example, updating a Windows build script shouldn't force the macOS jobs to rebuild contribs.

By default the script behaves the same as before. It requires giving a job name or target OS name to
select the changes only for that OS.

- - - - -
9dd68a3c by Steve Lhomme at 2024-02-18T11:06:44+00:00
CI: pass the type of target to get-contrib-sha

So we only update contribs if specific targets have been updated.

The script will have to match the CI target name with a package folder.

- - - - -


3 changed files:

- doc/BUILD-win32.md
- extras/ci/get-contrib-sha.sh
- extras/ci/gitlab-ci.yml


Changes:

=====================================
doc/BUILD-win32.md
=====================================
@@ -190,7 +190,7 @@ and reuse prebuilt contribs:
 ```sh
 mkdir build
 cd build
-export VLC_CONTRIB_SHA="$(cd ../vlc; extras/ci/get-contrib-sha.sh)"
+export VLC_CONTRIB_SHA="$(cd ../vlc; extras/ci/get-contrib-sha.sh win32)"
 export VLC_PREBUILT_CONTRIBS_URL="https://artifacts.videolan.org/vlc/win64/vlc-contrib-x86_64-w64-mingw32-${VLC_CONTRIB_SHA}.tar.bz2"
 ../vlc/extras/package/win32/build.sh -a x86_64 -p
 ```
@@ -203,7 +203,7 @@ and reuse prebuilt contribs. The name of the prebuilt tarball is the same, but t
 ```sh
 mkdir build
 cd build
-export VLC_CONTRIB_SHA="$(cd ../vlc; extras/ci/get-contrib-sha.sh)"
+export VLC_CONTRIB_SHA="$(cd ../vlc; extras/ci/get-contrib-sha.sh win32)"
 export VLC_PREBUILT_CONTRIBS_URL="https://artifacts.videolan.org/vlc/win64-llvm/vlc-contrib-x86_64-w64-mingw32-$VLC_CONTRIB_SHA.tar.bz2"
 time ../vlc/extras/package/win32/build.sh -a x86_64 -p
 ```


=====================================
extras/ci/get-contrib-sha.sh
=====================================
@@ -7,7 +7,7 @@
 set -e
 
 # Array of paths that should trigger contrib rebuilds
-VLC_CONTRIB_REBUILD_PATHS=("extras/tools" "contrib" "extras/ci" "extras/package")
+VLC_CONTRIB_REBUILD_PATHS=("extras/tools" "contrib" "extras/ci")
 # Revision from which to start look for changes (backwards in time)
 VLC_START_REVISION="HEAD"
 
@@ -28,9 +28,37 @@ VLC_SRC_ROOT_DIR=$(git rev-parse --show-toplevel)
 [ -n "${VLC_SRC_ROOT_DIR}" ] || abort_err "This script must be run in the VLC Git repo and git must be available"
 [ -f "${VLC_SRC_ROOT_DIR}/src/libvlc.h" ] || abort_err "This script must be run in the VLC Git repository"
 
+VLC_BUILD_TARGET="extras/package"
+case $1 in
+    win32*|win64*|uwp*)
+        VLC_BUILD_TARGET="extras/package/win32"
+        ;;
+    debian*)
+        VLC_BUILD_TARGET="extras/package/linux"
+        ;;
+    ios*|tvos*)
+        VLC_BUILD_TARGET="extras/package/apple"
+        ;;
+    macos*)
+        VLC_BUILD_TARGET="extras/package/macosx"
+        ;;
+    raspbian*)
+        VLC_BUILD_TARGET="extras/package/raspberry"
+        ;;
+    snap*)
+        VLC_BUILD_TARGET="extras/package/snap"
+        ;;
+    wasm*)
+        VLC_BUILD_TARGET="extras/package/wasm-emscripten"
+        ;;
+    android*)
+        VLC_BUILD_TARGET=""
+        ;;
+esac
+
 VLC_LAST_CONTRIB_SHA=$(
     cd "$VLC_SRC_ROOT_DIR" &&
-    git rev-list -1 "${VLC_START_REVISION}" -- "${VLC_CONTRIB_REBUILD_PATHS[@]}"
+    git rev-list -1 "${VLC_START_REVISION}" -- "${VLC_CONTRIB_REBUILD_PATHS[@]}" "${VLC_BUILD_TARGET}"
 )
 
 [ -n "${VLC_LAST_CONTRIB_SHA}" ] || abort_err "Failed to determine last contrib SHA using Git!"


=====================================
extras/ci/gitlab-ci.yml
=====================================
@@ -4,11 +4,11 @@ stages:
 default:
     before_script:
         - set -x
-        - export VLC_CONTRIB_SHA="$(extras/ci/get-contrib-sha.sh)"
+        - export VLC_CONTRIB_SHA="$(extras/ci/get-contrib-sha.sh ${CI_JOB_NAME##nightly-})"
         - export VLC_PREBUILT_CONTRIBS_URL="https://artifacts.videolan.org/vlc/${CI_JOB_NAME##nightly-}/vlc-contrib-${TRIPLET}-${VLC_CONTRIB_SHA}.tar.bz2"
         - if ! extras/ci/check-url.sh "$VLC_PREBUILT_CONTRIBS_URL"; then unset VLC_PREBUILT_CONTRIBS_URL; fi
     after_script:
-        - export VLC_CONTRIB_SHA="$(extras/ci/get-contrib-sha.sh)"
+        - export VLC_CONTRIB_SHA="$(extras/ci/get-contrib-sha.sh ${CI_JOB_NAME##nightly-})"
         - mv contrib/vlc-contrib-*.tar.bz2 contrib/vlc-contrib-${TRIPLET}-${VLC_CONTRIB_SHA}.tar.bz2 2>/dev/null || true
         - cd contrib && find . -maxdepth 1 -type f -name "vlc-contrib-*-${VLC_CONTRIB_SHA}.tar.bz2" -exec sh -c 'tar tf "$0" > /dev/null && shasum -a 512 "$0" | tee SHA512SUM' "{}" \;
     interruptible: true
@@ -263,8 +263,7 @@ debian-contrib:
         - contrib/*
         - extras/tools/*
         - extras/ci/*
-        - extras/package/**/*
-        - extras/package/*
+        - extras/package/linux/*
     script: |
         export NCPU=$(getconf _NPROCESSORS_ONLN)
         echo "Building branch '${CI_COMMIT_BRANCH}' (default: '${CI_DEFAULT_BRANCH}')"
@@ -396,7 +395,7 @@ debian-meson:
             cd extras/package/snap
             make -f package.mak snap
     after_script:
-        - export VLC_CONTRIB_SHA="$(extras/ci/get-contrib-sha.sh)"
+        - export VLC_CONTRIB_SHA="$(extras/ci/get-contrib-sha.sh snap)"
         - mv extras/package/snap/parts/vlc/build/contrib/vlc-contrib-*.tar.bz2 contrib/vlc-contrib-${TRIPLET}-${VLC_CONTRIB_SHA}.tar.bz2 2>/dev/null || true
     allow_failure: true
     variables: *variables-snap



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/049fbf5008fe7feb07ecd5ef06b718fdae0e1b9c...9dd68a3cac1020113f4e998016a38e142e99b492

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/049fbf5008fe7feb07ecd5ef06b718fdae0e1b9c...9dd68a3cac1020113f4e998016a38e142e99b492
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list