From fbd00f51fbb90ce110a5d21e01dc56f21fb7dbc1 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Wed, 7 Aug 2024 15:13:21 +0100 Subject: [PATCH 1/2] Move utilities from .github/scripts/ into packaging/ --- .github/workflows/build_ffmpeg.yaml | 2 +- .github/workflows/wheel.yaml | 2 +- {.github/scripts => packaging}/assert_ffmpeg_not_installed.sh | 0 {.github/scripts => packaging}/build_ffmpeg.sh | 0 {.github/scripts => packaging}/check_glibcxx.py | 0 {.github/scripts => packaging}/helpers.sh | 0 packaging/post_build_script.sh | 4 ++-- 7 files changed, 4 insertions(+), 4 deletions(-) rename {.github/scripts => packaging}/assert_ffmpeg_not_installed.sh (100%) rename {.github/scripts => packaging}/build_ffmpeg.sh (100%) rename {.github/scripts => packaging}/check_glibcxx.py (100%) rename {.github/scripts => packaging}/helpers.sh (100%) diff --git a/.github/workflows/build_ffmpeg.yaml b/.github/workflows/build_ffmpeg.yaml index 1078de9f1..4adf3ab7a 100644 --- a/.github/workflows/build_ffmpeg.yaml +++ b/.github/workflows/build_ffmpeg.yaml @@ -33,7 +33,7 @@ jobs: export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}" export FFMPEG_ROOT="${PWD}/ffmpeg" - .github/scripts/build_ffmpeg.sh + packaging/build_ffmpeg.sh tar -czf ffmpeg.tar.gz ffmpeg/include ffmpeg/lib diff --git a/.github/workflows/wheel.yaml b/.github/workflows/wheel.yaml index 69dc66a83..338dc3383 100644 --- a/.github/workflows/wheel.yaml +++ b/.github/workflows/wheel.yaml @@ -94,7 +94,7 @@ jobs: # but we need to checkout the repo to access this file, and we don't # want to checkout the repo before installing the wheel to avoid any # side-effect. It's OK. - .github/scripts/assert_ffmpeg_not_installed.sh + packaging/assert_ffmpeg_not_installed.sh conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge ffmpeg -version diff --git a/.github/scripts/assert_ffmpeg_not_installed.sh b/packaging/assert_ffmpeg_not_installed.sh similarity index 100% rename from .github/scripts/assert_ffmpeg_not_installed.sh rename to packaging/assert_ffmpeg_not_installed.sh diff --git a/.github/scripts/build_ffmpeg.sh b/packaging/build_ffmpeg.sh similarity index 100% rename from .github/scripts/build_ffmpeg.sh rename to packaging/build_ffmpeg.sh diff --git a/.github/scripts/check_glibcxx.py b/packaging/check_glibcxx.py similarity index 100% rename from .github/scripts/check_glibcxx.py rename to packaging/check_glibcxx.py diff --git a/.github/scripts/helpers.sh b/packaging/helpers.sh similarity index 100% rename from .github/scripts/helpers.sh rename to packaging/helpers.sh diff --git a/packaging/post_build_script.sh b/packaging/post_build_script.sh index 688d88771..84686d84f 100755 --- a/packaging/post_build_script.sh +++ b/packaging/post_build_script.sh @@ -1,6 +1,6 @@ #!/bin/bash -source .github/scripts/helpers.sh +source packaging/helpers.sh wheel_path=$(pwd)/$(find dist -type f -name "*.whl") echo "Wheel content:" @@ -24,7 +24,7 @@ assert_not_in_wheel $wheel_path "^packaging" extracted_wheel_dir=$(mktemp -d) unzip -q $wheel_path -d $extracted_wheel_dir symbols_matches=$(find $extracted_wheel_dir | grep ".so$" | xargs objdump --syms | grep GLIBCXX_3.4.) -python .github/scripts/check_glibcxx.py "$symbols_matches" +python packaging/check_glibcxx.py "$symbols_matches" echo "ls dist" ls dist From 1aea1a3826869840b7a1d089ac0a5481f291ca21 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Wed, 7 Aug 2024 15:16:42 +0100 Subject: [PATCH 2/2] move assert_ffmpeg_not_installed into helpers.sh --- .github/workflows/wheel.yaml | 3 ++- packaging/assert_ffmpeg_not_installed.sh | 7 ------- packaging/helpers.sh | 8 ++++++++ 3 files changed, 10 insertions(+), 8 deletions(-) delete mode 100755 packaging/assert_ffmpeg_not_installed.sh diff --git a/.github/workflows/wheel.yaml b/.github/workflows/wheel.yaml index 338dc3383..00dc3da63 100644 --- a/.github/workflows/wheel.yaml +++ b/.github/workflows/wheel.yaml @@ -94,7 +94,8 @@ jobs: # but we need to checkout the repo to access this file, and we don't # want to checkout the repo before installing the wheel to avoid any # side-effect. It's OK. - packaging/assert_ffmpeg_not_installed.sh + source packaging/helpers.sh + assert_ffmpeg_not_installed conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge ffmpeg -version diff --git a/packaging/assert_ffmpeg_not_installed.sh b/packaging/assert_ffmpeg_not_installed.sh deleted file mode 100755 index 67f3a9cc1..000000000 --- a/packaging/assert_ffmpeg_not_installed.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -if command -v "ffmpeg" &> /dev/null -then - echo "ffmpeg is installed, but it shouldn't! Exiting!!" - exit 1 -fi diff --git a/packaging/helpers.sh b/packaging/helpers.sh index e73d38549..16562f674 100644 --- a/packaging/helpers.sh +++ b/packaging/helpers.sh @@ -25,3 +25,11 @@ assert_in_wheel() { exit 1 fi } + +assert_ffmpeg_not_installed() { + if command -v "ffmpeg" &> /dev/null + then + echo "ffmpeg is installed, but it shouldn't! Exiting!!" + exit 1 + fi +}