Skip to content

Commit eab89f1

Browse files
committed
Deb: Adapt custom build steps to be compatible with latest Salsa-CI
Upstream Salsa-CI refactored the build process in https://salsa.debian.org/salsa-ci-team/pipeline/-/commit/58880fcef5b742cb9c661121a8c8707bf392b3b5 This broke our custom direct invocation of install-build-deps.sh as the Salsa-CI images no longer contain them. Adapt the .build-script equivalent to follow new Salsa-CI method so builds work again.
1 parent c9db50b commit eab89f1

File tree

1 file changed

+5
-44
lines changed

1 file changed

+5
-44
lines changed

debian/salsa-ci.yml

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ build:
3232
# Run Salsa-CI .build-before-script equivalent
3333
- mkdir -p ${WORKING_DIR} ${CCACHE_WORK_DIR}
3434
- mv ${CCACHE_WORK_DIR} ${CCACHE_TMP_DIR}
35-
# Run Salsa-CI .build-script equivalent
36-
- export CCACHE_DIR="${CCACHE_TMP_DIR}"
37-
- apt-get update && eatmydata apt-get install --yes --no-install-recommends aptitude devscripts ccache equivs
35+
# Run Salsa-CI .build-script equivalent, with extra devscripts so autobake-deb.sh can run 'dch'
36+
- export CCACHE_DIR=${CCACHE_TMP_DIR}
37+
- apt-get update && eatmydata apt-get install --no-install-recommends -y ccache fakeroot build-essential devscripts
3838
- cd ${WORKING_DIR}/${SOURCE_DIR}
39-
- eatmydata install-build-deps.sh .
39+
- eatmydata apt-get build-dep --no-install-recommends -y .
4040
- update-ccache-symlinks; ccache -z # Zero out ccache counters
4141
- while true; do sleep 600; echo "10 minutes passed" >&2; done & # Progress keeper since build is long and silent
4242
- debian/autobake-deb.sh |& tail -n 10000 # Keep Gitlab-CI output under 4 MB
4343
- cd ${WORKING_DIR}
4444
- rm -rf ${WORKING_DIR}/${SOURCE_DIR}
4545
- du -shc ${WORKING_DIR}/* # Show total file size of artifacts. Must stay are under 100 MB.
4646
- ccache -s # Show ccache stats to validate it worked
47-
- mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR} || true
47+
- mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR}
4848

4949
build bullseye-backports:
5050
extends: .build-package
@@ -77,45 +77,6 @@ build i386:
7777

7878
build native deb:
7979
extends: .build-package
80-
script: &buildpackage-script |
81-
mkdir -p ${WORKING_DIR} ${CCACHE_WORK_DIR}
82-
mv ${CCACHE_WORK_DIR} ${CCACHE_TMP_DIR}
83-
export CCACHE_DIR=${CCACHE_TMP_DIR}
84-
# Add deb-src entries
85-
sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
86-
apt-get update && eatmydata apt-get install --no-install-recommends -y \
87-
aptitude \
88-
devscripts \
89-
ccache \
90-
equivs \
91-
build-essential \
92-
python3
93-
# Enter source package dir
94-
cd ${WORKING_DIR}/${SOURCE_DIR}
95-
# Install package build dependencies
96-
eatmydata install-build-deps.sh .
97-
# Generate ccache links
98-
dpkg-reconfigure ccache
99-
PATH="/usr/lib/ccache/:${PATH}"
100-
# Reset ccache stats
101-
ccache -z
102-
# Create salsaci user and fix permissions
103-
useradd salsaci
104-
chown -R salsaci. ${WORKING_DIR} ${CCACHE_DIR}
105-
# Define buildlog filename
106-
BUILD_LOGFILE_SOURCE=$(dpkg-parsechangelog -S Source)
107-
BUILD_LOGFILE_VERSION=$(dpkg-parsechangelog -S Version)
108-
BUILD_LOGFILE_VERSION=${BUILD_LOGFILE_VERSION#*:}
109-
BUILD_LOGFILE_ARCH=$(dpkg --print-architecture)
110-
BUILD_LOGFILE="${WORKING_DIR}/${BUILD_LOGFILE_SOURCE}_${BUILD_LOGFILE_VERSION}_${BUILD_LOGFILE_ARCH}.build"
111-
# Build package as user salsaci
112-
su salsaci -c "eatmydata dpkg-buildpackage ${DB_BUILD_PARAM}" |& OUTPUT_FILENAME=${BUILD_LOGFILE} filter-output
113-
# Restore PWD to ${WORKING_DIR}
114-
cd ${WORKING_DIR}
115-
rm -rf ${WORKING_DIR}/${SOURCE_DIR}
116-
# Print ccache stats on job log
117-
ccache -s
118-
mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR}
11980

12081
piuparts:
12182
extends: .test-piuparts

0 commit comments

Comments
 (0)