Skip to content

Commit fd13a17

Browse files
authored
Merge pull request ceph#62163 from zmc/bwc-debs
Enabling containerized debian pipeline builds
2 parents 563ff04 + 8964380 commit fd13a17

File tree

4 files changed

+34
-15
lines changed

4 files changed

+34
-15
lines changed

debian/rules

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ ifneq (,$(filter with_system_libs,$(DEB_BUILD_OPTIONS)))
4848
extraopts += -DWITH_SYSTEM_BOOST=ON
4949
extraopts += -DWITH_SYSTEM_PMDK=ON
5050
endif
51+
ifeq ($(SCCACHE), true)
52+
extraopts += -DWITH_SCCACHE=ON
53+
endif
54+
55+
ifeq ($(DWZ), false)
56+
override_dh_dwz:
57+
endif
5158

5259
# for python3-${pkg} packages
5360
py3_bindings := rados cephfs rbd rgw ceph-argparse ceph-common

make-debs.sh

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,28 @@ rm -fr $(dirname $releasedir)
2323
#
2424
# remove all files not under git so they are not
2525
# included in the distribution.
26-
#
27-
git clean -dxf
28-
#
26+
27+
[ -e .git ] && git clean -dxf
28+
2929
# git describe provides a version that is
3030
# a) human readable
3131
# b) is unique for each commit
3232
# c) compares higher than any previous commit
3333
# d) contains the short hash of the commit
3434
#
35-
vers=$(git describe --match "v*" | sed s/^v//)
36-
./make-dist $vers
35+
# CI builds compute the version at an earlier stage, via the same method. Since
36+
# git metadata is not part of the source distribution, we take the version as
37+
# an argument to this script.
38+
#
39+
if [ -z "${2}" ]; then
40+
vers=$(git describe --match "v*" | sed s/^v//)
41+
dvers=${vers}-1
42+
else
43+
vers=${2}
44+
dvers=${vers}-1${VERSION_CODENAME}
45+
fi
46+
47+
test -f "ceph-$vers.tar.bz2" || ./make-dist $vers
3748
#
3849
# rename the tarbal to match debian conventions and extract it
3950
#
@@ -48,12 +59,7 @@ cp -a debian $releasedir/ceph-$vers/debian
4859
cd $releasedir
4960
perl -ni -e 'print if(!(/^Package: .*-dbg$/../^$/))' ceph-$vers/debian/control
5061
perl -pi -e 's/--dbg-package.*//' ceph-$vers/debian/rules
51-
#
52-
# always set the debian version to 1 which is ok because the debian
53-
# directory is included in the sources and the upstream version will
54-
# change each time it is modified.
55-
#
56-
dvers="$vers-1"
62+
5763
#
5864
# update the changelog to match the desired version
5965
#
@@ -72,7 +78,10 @@ fi
7278
if test $NPROC -gt 1 ; then
7379
j=-j${NPROC}
7480
fi
75-
PATH=/usr/lib/ccache:$PATH dpkg-buildpackage $j -uc -us
81+
if [ "$SCCACHE" != "true" ] ; then
82+
PATH=/usr/lib/ccache:$PATH
83+
fi
84+
PATH=$PATH dpkg-buildpackage $j -uc -us
7685
cd ../..
7786
mkdir -p $VERSION_CODENAME/conf
7887
cat > $VERSION_CODENAME/conf/distributions <<EOF

src/script/build-with-container.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,12 +661,15 @@ def bc_make_debs(ctx):
661661
basedir = pathlib.Path(ctx.cli.homedir) / "debs"
662662
if ctx.cli.build_dir:
663663
basedir = pathlib.Path(ctx.cli.homedir) / ctx.cli.build_dir
664+
make_debs_cmd = f"./make-debs.sh {basedir}"
665+
if ctx.cli.ceph_version:
666+
make_debs_cmd = f"{make_debs_cmd} {ctx.cli.ceph_version} {ctx.cli.distro}"
664667
cmd = _container_cmd(
665668
ctx,
666669
[
667670
"bash",
668671
"-c",
669-
f"mkdir -p {basedir} && cd {ctx.cli.homedir} && ./make-debs.sh {basedir}",
672+
f"mkdir -p {basedir} && cd {ctx.cli.homedir} && {make_debs_cmd}",
670673
],
671674
)
672675
with ctx.user_command():

src/script/buildcontainer-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ fi
3131
# packages etc.
3232
case "${CEPH_BASE_BRANCH}~${DISTRO_KIND}" in
3333
*~*centos*8)
34-
dnf install -y java-1.8.0-openjdk-headless /usr/bin/rpmbuild wget curl
34+
dnf install -y java-1.8.0-openjdk-headless /usr/bin/{rpmbuild,wget,curl}
3535
install_container_deps
3636
dnf_clean
3737
;;
3838
*~*centos*9|*~*centos*10*|*~fedora*)
39-
dnf install -y /usr/bin/rpmbuild wget curl
39+
dnf install -y /usr/bin/{rpmbuild,wget,curl}
4040
install_container_deps
4141
dnf_clean
4242
;;

0 commit comments

Comments
 (0)