From ef0a66ba7ef2175ae3ce52181f4d78bc17fe7dff Mon Sep 17 00:00:00 2001 From: Mike Golant Date: Tue, 2 Sep 2025 12:15:51 +0300 Subject: [PATCH 1/2] ci(sbuild): install Astral uv in chroot to satisfy RediSearch test deps (PR #6715) and add curl --- setup_sbuild.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/setup_sbuild.sh b/setup_sbuild.sh index a0e94db..4b98ad5 100755 --- a/setup_sbuild.sh +++ b/setup_sbuild.sh @@ -45,11 +45,11 @@ sbuild-createchroot --arch=${arch} --make-sbuild-tarball=/var/lib/sbuild/${dist} # For cross-compilation, install the necessary packages if [ "$arch" != "$host_arch" ]; then echo "Setting up cross-compilation environment from $host_arch to $arch" - + # Install cross-compilation tools in the chroot schroot -c source:${dist}-${arch}-sbuild -d / -- apt-get update schroot -c source:${dist}-${arch}-sbuild -d / -- apt-get install -y crossbuild-essential-${arch} - + # Create a file to tell sbuild this is a cross-compilation environment schroot -c source:${dist}-${arch}-sbuild -d / -- touch /etc/sbuild-cross-building fi @@ -85,7 +85,14 @@ fi # Install native build tools in the chroot schroot -c source:${dist}-${arch}-sbuild -d / -- apt-get update -schroot -c source:${dist}-${arch}-sbuild -d / -- apt-get install -y build-essential python3 python3-pip python3-venv python3-dev g++ clang +schroot -c source:${dist}-${arch}-sbuild -d / -- apt-get install -y build-essential python3 python3-pip python3-venv python3-dev g++ clang curl + +# Install Astral uv inside chroot for RediSearch test dependencies that expect it +schroot -c source:${dist}-${arch}-sbuild -d / -- bash -lc "set -e; curl --proto '=https' --tlsv1.2 -LsSf https://astral.sh/uv/install.sh | sh" +# Make uv available system-wide in chroot PATH +schroot -c source:${dist}-${arch}-sbuild -d / -- bash -lc "install -m 0755 \"$HOME/.local/bin/uv\" /usr/local/bin/uv || cp -f \"$HOME/.local/bin/uv\" /usr/local/bin/uv" +# Verify uv installed +schroot -c source:${dist}-${arch}-sbuild -d / -- uv -V # Install latest CMake version for Jammy and Bullseye if [ "$dist" = "jammy" ] || [ "$dist" = "bullseye" ]; then From c6b0ce832017123ed9f010be76e16420f2ae5239 Mon Sep 17 00:00:00 2001 From: Mike Golant Date: Tue, 2 Sep 2025 12:33:39 +0300 Subject: [PATCH 2/2] ci(sbuild): switch to directory chroot; install uv in setup_sbuild.sh with /usr/bin symlink; workflow no longer installs uv; preserve master behavior --- .github/workflows/apt.yml | 27 +++++++++++++++------------ setup_sbuild.sh | 8 ++++---- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/apt.yml b/.github/workflows/apt.yml index bf11d36..8265e40 100644 --- a/.github/workflows/apt.yml +++ b/.github/workflows/apt.yml @@ -9,15 +9,16 @@ on: - unstable workflow_call: + jobs: build-source-package: runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: - dist: ${{ fromJSON(vars.BUILD_DISTS) }} - arch: ${{ fromJSON(vars.BUILD_ARCHS) }} - exclude: ${{ fromJSON(vars.BUILD_EXCLUDE) }} + dist: ${{ fromJSON(vars.BUILD_DISTS || '["bookworm"]') }} + arch: ${{ fromJSON(vars.BUILD_ARCHS || '["amd64"]') }} + exclude: ${{ fromJSON(vars.BUILD_EXCLUDE || '[]') }} steps: - uses: actions/checkout@v4 with: @@ -39,22 +40,22 @@ jobs: mkdir -p redis-${VERSION} tar --extract --gunzip --file redis_${VERSION}.orig.tar.gz --strip-components=1 -C redis-${VERSION} sed -i 's/INSTALL_BIN=\$(PREFIX)\/bin/INSTALL_BIN=\$(DESTDIR)\$(PREFIX)\/bin/' redis-${VERSION}/src/Makefile - + echo "===== Updating all Redis module versions to 'master' =====" find redis-${VERSION}/modules -name "Makefile" -type f | while read -r makefile; do echo "Processing $makefile" echo " Before change:" grep "MODULE_VERSION" "$makefile" || echo " No MODULE_VERSION found" - + # Update the MODULE_VERSION to 'master' sed -i 's/MODULE_VERSION = .*/MODULE_VERSION = master/g' "$makefile" - + echo " After change:" grep "MODULE_VERSION" "$makefile" || echo " No MODULE_VERSION found after update" echo "-----------------------------------" done echo "===== Module version updates completed =====" - + cp -pr debian redis-${VERSION} sed -i "s/@RELEASE@/${{ matrix.dist }}/g" redis-${VERSION}/debian/changelog ( cd redis-${VERSION} && dpkg-buildpackage -S ) @@ -72,9 +73,9 @@ jobs: strategy: fail-fast: false matrix: - dist: ${{ fromJSON(vars.BUILD_DISTS) }} - arch: ${{ fromJSON(vars.BUILD_ARCHS) }} - exclude: ${{ fromJSON(vars.BUILD_EXCLUDE) }} + dist: ${{ fromJSON(vars.BUILD_DISTS || '["bookworm"]') }} + arch: ${{ fromJSON(vars.BUILD_ARCHS || '["amd64"]') }} + exclude: ${{ fromJSON(vars.BUILD_EXCLUDE || '[]') }} needs: build-source-package steps: - uses: actions/checkout@v4 @@ -121,6 +122,8 @@ jobs: --dist ${{ matrix.dist }} \ --build-dep-resolver=apt \ --chroot-setup-commands="apt-get update && apt-get install -y build-essential" \ + + *.dsc - name: Upload binary package artifact uses: actions/upload-artifact@v4 @@ -135,8 +138,8 @@ jobs: strategy: fail-fast: false matrix: - image: ${{ fromJSON(vars.SMOKE_TEST_IMAGES) }} - arch: [amd64, arm64] + image: ${{ fromJSON(vars.SMOKE_TEST_IMAGES || '["debian:bookworm"]') }} + arch: ${{ fromJSON(vars.BUILD_ARCHS || '["amd64","arm64"]') }} container: ${{ matrix.image }} steps: - name: Extract distribution from image diff --git a/setup_sbuild.sh b/setup_sbuild.sh index 4b98ad5..3d8a4a1 100755 --- a/setup_sbuild.sh +++ b/setup_sbuild.sh @@ -39,8 +39,8 @@ cat > "$SBUILD_CONF" << EOF $host_arch $arch $dist $url EOF -# Create the sbuild chroot with the configuration -sbuild-createchroot --arch=${arch} --make-sbuild-tarball=/var/lib/sbuild/${dist}-${arch}.tar.gz ${dist} $(mktemp -d) ${url} +# Create the sbuild chroot with the configuration (use directory chroot so installed tools persist into build clones) +sbuild-createchroot --arch=${arch} ${dist} /var/lib/sbuild/chroots/${dist}-${arch} ${url} # For cross-compilation, install the necessary packages if [ "$arch" != "$host_arch" ]; then @@ -91,8 +91,8 @@ schroot -c source:${dist}-${arch}-sbuild -d / -- apt-get install -y build-essent schroot -c source:${dist}-${arch}-sbuild -d / -- bash -lc "set -e; curl --proto '=https' --tlsv1.2 -LsSf https://astral.sh/uv/install.sh | sh" # Make uv available system-wide in chroot PATH schroot -c source:${dist}-${arch}-sbuild -d / -- bash -lc "install -m 0755 \"$HOME/.local/bin/uv\" /usr/local/bin/uv || cp -f \"$HOME/.local/bin/uv\" /usr/local/bin/uv" -# Verify uv installed -schroot -c source:${dist}-${arch}-sbuild -d / -- uv -V +# Verify uv installed and ensure it's in PATH via /usr/bin +schroot -c source:${dist}-${arch}-sbuild -d / -- bash -lc "ln -sf /usr/local/bin/uv /usr/bin/uv && /usr/bin/uv -V" # Install latest CMake version for Jammy and Bullseye if [ "$dist" = "jammy" ] || [ "$dist" = "bullseye" ]; then