Build deb packages in an Ubuntu 22.04 container

dpkg-buildpackage ran on the runner itself, so the packages inherited its ABI.
On ubuntu-latest that means glibc 2.38 and libssl3t64, which restricts the
packages to Ubuntu 24.04 and newer - Debian 12, Debian 13 and Ubuntu 22.04
cannot install them.

Nothing in the source needs glibc 2.38. The floor comes from the build host:
gcc 13 with glibc 2.38 redirects sscanf and strtol to __isoc23_ variants, and
arc4random arrived in glibc 2.36.

Build in an Ubuntu 22.04 container instead. That lowers the dependencies to
libc6 (>= 2.34) and libssl3, and libssl3t64 declares Provides: libssl3, so one
package covers Ubuntu 22.04 and later as well as Debian 12 and later. Verified
by installing on all four.

The armhf cross build moves into the same container, keeping the cross
toolchain on PATH so that install -s uses the ARM strip rather than the host
one.
This commit is contained in:
Vladimir Dubrovin 2026-08-22 11:30:37 +03:00
parent b19e310956
commit 8fba7ffc40
3 changed files with 66 additions and 69 deletions

View File

@ -75,18 +75,25 @@ jobs:
path: "*.rpm" path: "*.rpm"
- name: debbuild - name: debbuild
run: | run: |
ret=`pwd` docker run --rm \
cd ~/debian/ -v "$HOME/debian:/debian" \
tar xzf 3proxy_$RELEASE.orig.tar.gz -e RELEASE="$RELEASE" -e VERSION="$VERSION" \
cd 3proxy-$RELEASE ubuntu:22.04 bash -c '
echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium" >debian/changelog set -e
echo " " >>debian/changelog export DEBIAN_FRONTEND=noninteractive
echo " *3proxy $RELEASE build" >>debian/changelog apt-get update
echo " " >>debian/changelog apt-get install -y build-essential debhelper fakeroot libssl-dev libpcre2-dev libpam0g-dev
echo " -- z3APA3A <3apa3a@3proxy.org> "`date "+%a, %d %b %Y %H:%M:%S %z"` >>debian/changelog cd /debian
echo "">>debian/changelog tar xzf 3proxy_$RELEASE.orig.tar.gz
dpkg-buildpackage cd 3proxy-$RELEASE
cd $ret { echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium"
echo " "
echo " *3proxy $RELEASE build"
echo " "
echo " -- z3APA3A <3apa3a@3proxy.org> $(date "+%a, %d %b %Y %H:%M:%S %z")"
echo ""
} > debian/changelog
dpkg-buildpackage'
cp ~/debian/3proxy_$RELEASE-"$VERSION"_arm64.deb ./3proxy-$RELEASE.arm64.deb cp ~/debian/3proxy_$RELEASE-"$VERSION"_arm64.deb ./3proxy-$RELEASE.arm64.deb
- name: Get artifact deb - name: Get artifact deb
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7

View File

@ -27,33 +27,6 @@ jobs:
pwd pwd
echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV
echo "VERSION=$(date +%y%m%d%H%M%S)" >> $GITHUB_ENV echo "VERSION=$(date +%y%m%d%H%M%S)" >> $GITHUB_ENV
- name: Linux libraries
run: |
sudo apt update
sudo dpkg --add-architecture armhf
echo "Types: deb" > ~/ubuntu.sources
echo "URIs: http://archive.ubuntu.com/ubuntu/" >> ~/ubuntu.sources
echo "Suites: noble noble-updates noble-backports" >> ~/ubuntu.sources
echo "Components: main restricted universe multiverse" >> ~/ubuntu.sources
echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >> ~/ubuntu.sources
echo "Architectures: amd64" >> ~/ubuntu.sources
echo "" >> ~/ubuntu.sources
echo "Types: deb" >> ~/ubuntu.sources
echo "URIs: http://security.ubuntu.com/ubuntu/" >> ~/ubuntu.sources
echo "Suites: noble-security" >> ~/ubuntu.sources
echo "Components: main restricted universe multiverse" >> ~/ubuntu.sources
echo "Architectures: amd64" >> ~/ubuntu.sources
echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >> ~/ubuntu.sources
echo "" >> ~/ubuntu.sources
echo "Types: deb" >>~/ubuntu.sources
echo "URIs: http://ports.ubuntu.com/ubuntu-ports/" >>~/ubuntu.sources
echo "Suites: noble noble-updates" >>~/ubuntu.sources
echo "Components: main restricted universe multiverse" >>~/ubuntu.sources
echo "Architectures: armhf" >>~/ubuntu.sources
echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >>~/ubuntu.sources
sudo cp ~/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources
sudo apt update
sudo apt install libssl3t64:armhf openssl:armhf libssl-dev:armhf libpam0g:armhf libpam0g-dev:armhf libpcre2-dev:armhf rpm crossbuild-essential-armhf build-essential debhelper
- name: configure deb env - name: configure deb env
run: | run: |
mkdir ~/debian mkdir ~/debian
@ -64,24 +37,34 @@ jobs:
cp ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/debian/3proxy_$RELEASE.orig.tar.gz cp ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/debian/3proxy_$RELEASE.orig.tar.gz
- name: debbuild - name: debbuild
run: | run: |
ret=`pwd` docker run --rm \
cd ~/debian/ -v "$HOME/debian:/debian" \
tar xzf 3proxy_$RELEASE.orig.tar.gz -e RELEASE="$RELEASE" -e VERSION="$VERSION" \
cd 3proxy-$RELEASE ubuntu:22.04 bash -c '
echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium" >debian/changelog set -e
echo " " >>debian/changelog export DEBIAN_FRONTEND=noninteractive
echo " *3proxy $RELEASE build" >>debian/changelog dpkg --add-architecture armhf
echo " " >>debian/changelog sed -i "s|^deb |deb [arch=amd64] |" /etc/apt/sources.list
echo " -- z3APA3A <3apa3a@3proxy.org> "`date "+%a, %d %b %Y %H:%M:%S %z"` >>debian/changelog { echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse"
echo "">>debian/changelog echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse"
PATH=/usr/arm-linux-gnueabihf/bin:$PATH } >> /etc/apt/sources.list
export PATH=$PATH apt-get update
CC=arm-linux-gnueabihf-gcc apt-get install -y crossbuild-essential-armhf build-essential debhelper fakeroot \
export CC=$CC libssl-dev:armhf libpcre2-dev:armhf libpam0g-dev:armhf
export RPATH=/usr/arm-linux-gnueabihf/lib:$RPATH cd /debian
export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:$LD_LIBRARY_PATH tar xzf 3proxy_$RELEASE.orig.tar.gz
dpkg-buildpackage cd 3proxy-$RELEASE
cd $ret { echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium"
echo " "
echo " *3proxy $RELEASE build"
echo " "
echo " -- z3APA3A <3apa3a@3proxy.org> $(date "+%a, %d %b %Y %H:%M:%S %z")"
echo ""
} > debian/changelog
export PATH=/usr/arm-linux-gnueabihf/bin:$PATH
export CC=arm-linux-gnueabihf-gcc
export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:$LD_LIBRARY_PATH
dpkg-buildpackage'
cp ~/debian/3proxy_$RELEASE-"$VERSION"_armhf.deb ./3proxy-$RELEASE.arm.deb cp ~/debian/3proxy_$RELEASE-"$VERSION"_armhf.deb ./3proxy-$RELEASE.arm.deb
- name: Get artifact deb - name: Get artifact deb
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7

View File

@ -75,18 +75,25 @@ jobs:
path: "*.rpm" path: "*.rpm"
- name: debbuild - name: debbuild
run: | run: |
ret=`pwd` docker run --rm \
cd ~/debian/ -v "$HOME/debian:/debian" \
tar xzf 3proxy_$RELEASE.orig.tar.gz -e RELEASE="$RELEASE" -e VERSION="$VERSION" \
cd 3proxy-$RELEASE ubuntu:22.04 bash -c '
echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium" >debian/changelog set -e
echo " " >>debian/changelog export DEBIAN_FRONTEND=noninteractive
echo " *3proxy $RELEASE build" >>debian/changelog apt-get update
echo " " >>debian/changelog apt-get install -y build-essential debhelper fakeroot libssl-dev libpcre2-dev libpam0g-dev
echo " -- z3APA3A <3apa3a@3proxy.org> "`date "+%a, %d %b %Y %H:%M:%S %z"` >>debian/changelog cd /debian
echo "">>debian/changelog tar xzf 3proxy_$RELEASE.orig.tar.gz
dpkg-buildpackage cd 3proxy-$RELEASE
cd $ret { echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium"
echo " "
echo " *3proxy $RELEASE build"
echo " "
echo " -- z3APA3A <3apa3a@3proxy.org> $(date "+%a, %d %b %Y %H:%M:%S %z")"
echo ""
} > debian/changelog
dpkg-buildpackage'
cp ~/debian/3proxy_$RELEASE-"$VERSION"_amd64.deb ./3proxy-$RELEASE.x86_64.deb cp ~/debian/3proxy_$RELEASE-"$VERSION"_amd64.deb ./3proxy-$RELEASE.x86_64.deb
- name: Get artifact deb - name: Get artifact deb
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7