This is an automated email from the ASF dual-hosted git repository.
djwang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/main by this push:
new a16ad2b62e4 Fix DEB packaging to support multi-arch builds
a16ad2b62e4 is described below
commit a16ad2b62e421c90c9e41ab12fcf9eb795591e10
Author: Dianjin Wang <[email protected]>
AuthorDate: Fri Feb 13 21:04:18 2026 +0800
Fix DEB packaging to support multi-arch builds
Fix DEB build failures on arm64 by addressing three issues:
- Change Architecture from 'amd64' to 'any' in control file to
support building on any architecture
- Fix DESTDIR path in rules to correctly install cloudberry-env.sh
to the debian staging directory
- Use DEB_HOST_MULTIARCH variable instead of hardcoded x86_64 path
for libfakeroot in dh_shlibdeps
- Update workflow to support new deb format
Also update package version format to include OS distribution name
(e.g., ubuntu22.04) instead of git commit info for clearer package
identification. The file name format will be like:
```
apache-cloudberry-db-incubating_2.1.0-1-ubuntu22.04_arm64.deb
```
Before:
```
apache-cloudberry-db-incubating_2.1.0-1-1.bdf90c55_arm64.deb
```
---
.github/workflows/build-deb-cloudberry.yml | 11 +++++++++--
devops/build/packaging/deb/build-deb.sh | 12 +++++++++++-
devops/build/packaging/deb/ubuntu22.04/control | 2 +-
devops/build/packaging/deb/ubuntu22.04/rules | 4 ++--
4 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/build-deb-cloudberry.yml
b/.github/workflows/build-deb-cloudberry.yml
index 53b3c54e038..705e82ca87f 100644
--- a/.github/workflows/build-deb-cloudberry.yml
+++ b/.github/workflows/build-deb-cloudberry.yml
@@ -554,8 +554,15 @@ jobs:
exit 1
fi
- ARCH="amd64"
- CBDB_PKG_VERSION=${CBDB_VERSION}-${BUILD_NUMBER}-$(git
--git-dir=.git rev-list HEAD --count).$(git --git-dir=.git rev-parse --short
HEAD)
+ ARCH=$(dpkg --print-architecture)
+ # Detect OS distribution (e.g., ubuntu22.04, debian12)
+ if [ -f /etc/os-release ]; then
+ . /etc/os-release
+ OS_DISTRO=$(echo "${ID}${VERSION_ID}" | tr '[:upper:]'
'[:lower:]')
+ else
+ OS_DISTRO="unknown"
+ fi
+ CBDB_PKG_VERSION=${CBDB_VERSION}-${BUILD_NUMBER}-${OS_DISTRO}
echo "Produced artifacts"
ls -l ../
diff --git a/devops/build/packaging/deb/build-deb.sh
b/devops/build/packaging/deb/build-deb.sh
index 2e7312be53f..1f5aef2258a 100755
--- a/devops/build/packaging/deb/build-deb.sh
+++ b/devops/build/packaging/deb/build-deb.sh
@@ -124,7 +124,17 @@ if [ -z ${BUILD_USER+x} ]; then
export BUILD_USER=github
fi
-export CBDB_PKG_VERSION=${CBDB_FULL_VERSION}-${BUILD_NUMBER}-$(git
--git-dir=.git rev-list HEAD --count).$(git --git-dir=.git rev-parse --short
HEAD)
+# Detect OS distribution (e.g., ubuntu22.04, debian12)
+if [ -z ${OS_DISTRO+x} ]; then
+ if [ -f /etc/os-release ]; then
+ . /etc/os-release
+ OS_DISTRO=$(echo "${ID}${VERSION_ID}" | tr '[:upper:]' '[:lower:]')
+ else
+ OS_DISTRO="unknown"
+ fi
+fi
+
+export CBDB_PKG_VERSION=${CBDB_FULL_VERSION}-${BUILD_NUMBER}-${OS_DISTRO}
# Check if required commands are available
check_commands
diff --git a/devops/build/packaging/deb/ubuntu22.04/control
b/devops/build/packaging/deb/ubuntu22.04/control
index 70e4eda77d3..4bc5d90b84d 100644
--- a/devops/build/packaging/deb/ubuntu22.04/control
+++ b/devops/build/packaging/deb/ubuntu22.04/control
@@ -43,7 +43,7 @@ Build-Depends: debhelper (>= 9),
Package: apache-cloudberry-db-incubating
Provides: apache-cloudberry-db
-Architecture: amd64
+Architecture: any
Depends: curl,
cgroup-tools,
iputils-ping,
diff --git a/devops/build/packaging/deb/ubuntu22.04/rules
b/devops/build/packaging/deb/ubuntu22.04/rules
index 6213985b48c..cb387d209e6 100755
--- a/devops/build/packaging/deb/ubuntu22.04/rules
+++ b/devops/build/packaging/deb/ubuntu22.04/rules
@@ -19,7 +19,7 @@ include /usr/share/dpkg/default.mk
dh $@ --parallel
gpinstall:
- make install
+ make install DESTDIR=${DEBIAN_DESTINATION} prefix=
override_dh_auto_install: gpinstall
# the staging directory for creating a debian is NOT the right GPHOME.
@@ -43,7 +43,7 @@ override_dh_gencontrol:
dh_gencontrol -- -v${CBDB_PKG_VERSION} -p${PACKAGE_CBDB}
override_dh_shlibdeps:
-
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/libfakeroot:${DEBIAN_DESTINATION}/lib
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
+
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/$(DEB_HOST_MULTIARCH)/libfakeroot:${DEBIAN_DESTINATION}/lib
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
clean_dev_local:
rm -rf ${DEBIAN_DESTINATION}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]