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 7e1ddf2e84
commit fb2d1c0442
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" \
-e RELEASE="$RELEASE" -e VERSION="$VERSION" \
ubuntu:22.04 bash -c '
set -e
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y build-essential debhelper fakeroot libssl-dev libpcre2-dev libpam0g-dev
cd /debian
tar xzf 3proxy_$RELEASE.orig.tar.gz tar xzf 3proxy_$RELEASE.orig.tar.gz
cd 3proxy-$RELEASE cd 3proxy-$RELEASE
echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium" >debian/changelog { echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium"
echo " " >>debian/changelog echo " "
echo " *3proxy $RELEASE build" >>debian/changelog echo " *3proxy $RELEASE build"
echo " " >>debian/changelog echo " "
echo " -- z3APA3A <3apa3a@3proxy.org> "`date "+%a, %d %b %Y %H:%M:%S %z"` >>debian/changelog echo " -- z3APA3A <3apa3a@3proxy.org> $(date "+%a, %d %b %Y %H:%M:%S %z")"
echo "">>debian/changelog echo ""
dpkg-buildpackage } > debian/changelog
cd $ret 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" \
-e RELEASE="$RELEASE" -e VERSION="$VERSION" \
ubuntu:22.04 bash -c '
set -e
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture armhf
sed -i "s|^deb |deb [arch=amd64] |" /etc/apt/sources.list
{ echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse"
echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse"
} >> /etc/apt/sources.list
apt-get update
apt-get install -y crossbuild-essential-armhf build-essential debhelper fakeroot \
libssl-dev:armhf libpcre2-dev:armhf libpam0g-dev:armhf
cd /debian
tar xzf 3proxy_$RELEASE.orig.tar.gz tar xzf 3proxy_$RELEASE.orig.tar.gz
cd 3proxy-$RELEASE cd 3proxy-$RELEASE
echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium" >debian/changelog { echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium"
echo " " >>debian/changelog echo " "
echo " *3proxy $RELEASE build" >>debian/changelog echo " *3proxy $RELEASE build"
echo " " >>debian/changelog echo " "
echo " -- z3APA3A <3apa3a@3proxy.org> "`date "+%a, %d %b %Y %H:%M:%S %z"` >>debian/changelog echo " -- z3APA3A <3apa3a@3proxy.org> $(date "+%a, %d %b %Y %H:%M:%S %z")"
echo "">>debian/changelog echo ""
PATH=/usr/arm-linux-gnueabihf/bin:$PATH } > debian/changelog
export PATH=$PATH export PATH=/usr/arm-linux-gnueabihf/bin:$PATH
CC=arm-linux-gnueabihf-gcc export CC=arm-linux-gnueabihf-gcc
export CC=$CC
export RPATH=/usr/arm-linux-gnueabihf/lib:$RPATH
export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:$LD_LIBRARY_PATH
dpkg-buildpackage dpkg-buildpackage'
cd $ret
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" \
-e RELEASE="$RELEASE" -e VERSION="$VERSION" \
ubuntu:22.04 bash -c '
set -e
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y build-essential debhelper fakeroot libssl-dev libpcre2-dev libpam0g-dev
cd /debian
tar xzf 3proxy_$RELEASE.orig.tar.gz tar xzf 3proxy_$RELEASE.orig.tar.gz
cd 3proxy-$RELEASE cd 3proxy-$RELEASE
echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium" >debian/changelog { echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium"
echo " " >>debian/changelog echo " "
echo " *3proxy $RELEASE build" >>debian/changelog echo " *3proxy $RELEASE build"
echo " " >>debian/changelog echo " "
echo " -- z3APA3A <3apa3a@3proxy.org> "`date "+%a, %d %b %Y %H:%M:%S %z"` >>debian/changelog echo " -- z3APA3A <3apa3a@3proxy.org> $(date "+%a, %d %b %Y %H:%M:%S %z")"
echo "">>debian/changelog echo ""
dpkg-buildpackage } > debian/changelog
cd $ret 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