[CI] Install split packages separately.

Good:
- de-duplicate code
- No more need for `.ci-sequential` trick for conflicting split packages.
- Check their runtime dependencies independently.

Bad:
- Take more time for intall/uninstall
This commit is contained in:
Mehdi Chinoune
2022-03-14 09:42:59 +01:00
parent 316ae5e758
commit af9b5bd4bd
5 changed files with 35 additions and 92 deletions

View File

@@ -65,106 +65,49 @@ for package in "${packages[@]}"; do
execute 'Building binary' makepkg-mingw --noconfirm --noprogressbar --nocheck --syncdeps --rmdeps --cleanbuild
echo "::endgroup::"
if [ -f $package/.ci-sequential ]; then
cd "$package"
for pkg in *.pkg.tar.*; do
pkgname="$(echo "$pkg" | rev | cut -d- -f4- | rev)"
echo "::group::[install] ${pkgname}"
grep -qFx "${package}" "$(dirname "$0")/ci-dont-install-list.txt" || pacman --noprogressbar --upgrade --noconfirm $pkg
echo "::endgroup::"
echo "::group::[meta-diff] ${pkgname}"
message "Package info diff for ${pkgname}"
diff -Nur <(pacman -Si "${pkgname}") <(pacman -Qip "${pkg}") || true
echo "::endgroup::"
echo "::group::[file-diff] ${pkgname}"
message "File listing diff for ${pkgname}"
diff -Nur <(pacman -Fl "$pkgname" | sed -e 's|^[^ ]* |/|' | sort) <(pacman -Ql "$pkgname" | sed -e 's|^[^/]*||' | sort) || true
echo "::endgroup::"
echo "::group::[runtime-dependencies] ${pkgname}"
message "Runtime dependencies for ${pkgname}"
declare -a binaries=($(pacman -Ql $pkgname | sed -e 's|^[^ ]* ||' | grep -E ${MINGW_PREFIX}/bin/[^/]+\.\(dll\|exe\)$))
if [ "${#binaries[@]}" -ne 0 ]; then
for binary in ${binaries[@]}; do
echo "${binary}:"
ntldd -R ${binary} | grep -v "ext-ms\|api-ms\|WINDOWS\|Windows\|HvsiFileTrust\|wpaxholder" || true
done
fi
declare -a py_modules=($(pacman -Ql $pkgname | sed -e 's|^[^ ]* ||' | grep -E ${MINGW_PREFIX}/lib/python[0-9]\.[0-9]+/site-packages/.+\.pyd$))
if [ "${#py_modules[@]}" -ne 0 ]; then
for pyd in ${py_modules[@]}; do
echo "${pyd}:"
ntldd -R ${pyd} | grep -v "ext-ms\|api-ms\|WINDOWS\|Windows\|HvsiFileTrust\|wpaxholder" || true
done
fi
echo "::endgroup::"
echo "::group::[uninstall] ${pkgname}"
message "Uninstalling $pkgname"
repo-add $PWD/../artifacts/ci.db.tar.gz $PWD/$pkg
pacman -Sy
pacman -R --recursive --unneeded --noconfirm --noprogressbar "$pkgname"
echo "::endgroup::"
done
cd - > /dev/null
else
echo "::group::[install] ${package}"
grep -qFx "${package}" "$(dirname "$0")/ci-dont-install-list.txt" || execute 'Installing' install_packages
cd "$package"
for pkg in *.pkg.tar.*; do
pkgname="$(echo "$pkg" | rev | cut -d- -f4- | rev)"
echo "::group::[install] ${pkgname}"
grep -qFx "${package}" "$(dirname "$0")/ci-dont-install-list.txt" || pacman --noprogressbar --upgrade --noconfirm $pkg
echo "::endgroup::"
echo "::group::[diff] ${package}"
cd "$package"
for pkg in *.pkg.tar.*; do
pkgname="$(echo "$pkg" | rev | cut -d- -f4- | rev)"
message "Package info diff for ${pkgname}"
diff -Nur <(pacman -Si "${pkgname}") <(pacman -Qip "${pkg}") || true
message "File listing diff for ${pkgname}"
diff -Nur <(pacman -Fl "$pkgname" | sed -e 's|^[^ ]* |/|' | sort) <(pacman -Ql "$pkgname" | sed -e 's|^[^/]*||' | sort) || true
done
cd - > /dev/null
echo "::group::[meta-diff] ${pkgname}"
message "Package info diff for ${pkgname}"
diff -Nur <(pacman -Si "${pkgname}") <(pacman -Qip "${pkg}") || true
echo "::endgroup::"
echo "::group::[runtime-dependencies] ${package}"
cd "$package"
for pkg in *.pkg.tar.*; do
pkgname="$(echo "$pkg" | rev | cut -d- -f4- | rev)"
message "Runtime dependencies for ${pkgname}"
declare -a binaries=($(pacman -Ql $pkgname | sed -e 's|^[^ ]* ||' | grep -E ${MINGW_PREFIX}/bin/[^/]+\.\(dll\|exe\)$))
if [ "${#binaries[@]}" -ne 0 ]; then
for binary in ${binaries[@]}; do
echo "${binary}:"
ntldd -R ${binary} | grep -v "ext-ms\|api-ms\|WINDOWS\|Windows\|HvsiFileTrust\|wpaxholder" || true
done
fi
declare -a py_modules=($(pacman -Ql $pkgname | sed -e 's|^[^ ]* ||' | grep -E ${MINGW_PREFIX}/lib/python[0-9]\.[0-9]+/site-packages/.+\.pyd$))
if [ "${#py_modules[@]}" -ne 0 ]; then
for pyd in ${py_modules[@]}; do
echo "${pyd}:"
ntldd -R ${pyd} | grep -v "ext-ms\|api-ms\|WINDOWS\|Windows\|HvsiFileTrust\|wpaxholder" || true
done
fi
done
cd - > /dev/null
echo "::group::[file-diff] ${pkgname}"
message "File listing diff for ${pkgname}"
diff -Nur <(pacman -Fl "$pkgname" | sed -e 's|^[^ ]* |/|' | sort) <(pacman -Ql "$pkgname" | sed -e 's|^[^/]*||' | sort) || true
echo "::endgroup::"
echo "::group::[uninstall] ${package}"
repo-add $PWD/artifacts/ci.db.tar.gz "${package}"/*.pkg.tar.*
echo "::group::[runtime-dependencies] ${pkgname}"
message "Runtime dependencies for ${pkgname}"
declare -a binaries=($(pacman -Ql $pkgname | sed -e 's|^[^ ]* ||' | grep -E ${MINGW_PREFIX}/bin/[^/]+\.\(dll\|exe\)$))
if [ "${#binaries[@]}" -ne 0 ]; then
for binary in ${binaries[@]}; do
echo "${binary}:"
ntldd -R ${binary} | grep -v "ext-ms\|api-ms\|WINDOWS\|Windows\|HvsiFileTrust\|wpaxholder" || true
done
fi
declare -a py_modules=($(pacman -Ql $pkgname | sed -e 's|^[^ ]* ||' | grep -E ${MINGW_PREFIX}/lib/python[0-9]\.[0-9]+/site-packages/.+\.pyd$))
if [ "${#py_modules[@]}" -ne 0 ]; then
for pyd in ${py_modules[@]}; do
echo "${pyd}:"
ntldd -R ${pyd} | grep -v "ext-ms\|api-ms\|WINDOWS\|Windows\|HvsiFileTrust\|wpaxholder" || true
done
fi
echo "::endgroup::"
echo "::group::[uninstall] ${pkgname}"
message "Uninstalling $pkgname"
repo-add $PWD/../artifacts/ci.db.tar.gz $PWD/$pkg
pacman -Sy
message "Uninstalling $package"
cd "$package"
export installed_packages=()
for pkg in *.pkg.tar.*; do
installed_packages+=("$(echo "$pkg" | rev | cut -d- -f4- | rev)")
done
pacman -R --recursive --unneeded --noconfirm --noprogressbar "${installed_packages[@]}"
unset installed_packages
cd - > /dev/null
pacman -R --recursive --unneeded --noconfirm --noprogressbar "$pkgname"
echo "::endgroup::"
fi
done
cd - > /dev/null
mv "${package}"/*.pkg.tar.* artifacts
unset package