Verify Ceph Deb Package Build Flag


We can confirm what build flags are enabled at build time by checking the below places.

As deb packages on different Ubuntu releases have different versions, it is necessary to verify the build flags in deb package and upstream package within the same version. For example, below are the process to verify the build flags of ceph package in Ubuntu 22.04.

How to verify

Verify the version of the ceph package by going to its package’s launchpad, or going to Ubuntu packages page, or using apt-get

Use apt-get policy to get package versions.

root@charmbuild:~# apt-cache policy ceph
ceph:
  Installed: (none)
  Candidate: 17.2.7-0ubuntu0.22.04.1
  Version table:
     17.2.7-0ubuntu0.22.04.1 500
        500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
     17.2.6-0ubuntu0.22.04.3 500
        500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
     17.1.0-0ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages

From the above result, we know the latest version of ceph in jammy/main repository is: “17.2.7-0ubuntu0.22.04.1”. This version string has the following meaning.

So in order to verify the package’s build flag, we need to

To verify build flags in upstream, we can check the source code on Github. Checking debian/rules, we see that the build flags are passed using the variable extraopts. We see that in upstream, ceph is built with utf8proc, lttng, python3, etc. Besides extraopts additional variables, CMakeLists.txt also includes many variables with ON/OFF value.

To verify build flags at build, we have 2 ways.

  1. Download the ceph source package and confirm its debian/rules
  2. Via lauchpad.

1. Download package

Pakackage ubuntu-dev-tools provide a tool called pull-lp-source to download a source package from Launchpad. We can download and verify the build flags as below.

sudo apt install ubuntu-dev-tools
pull-lp-sources ceph-osd jammy
cd ceph-17.2.7
less debian/rules

We can see that many build flags are configured differently from the upstream. For example, Ubuntu’s Ceph is built with -DWITH_LTTNG=OFF while it’s ON in upstream, or -DWITH_SYSTEM_BOOST=ON while it is OFF in upstream. So we can see that Ubuntu’s Ceph package is built with many differences from the upstream default.

2. Via Launchpad build logs

A specific version can be access in launchpad through https://launchpad.net/ubuntu/+source//${PACKAGE_NAME}/${VERSION}. So the ceph package in example can be referred at https://launchpad.net/ubuntu/+source/ceph/17.2.7-0ubuntu0.22.04.1. In this page, we can see the build log for each architecture (amd64, or arm64..). Click on the “amd64” link and we open the build log of ceph for amd64 architecture. We can see all build flags at the time build script was run in the following line.

cd obj-x86_64-linux-gnu && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu -DWITH_OCF=ON -DWITH_NSS=ON -DWITH_PYTHON3=ON -DWITH_DEBUG=ON -DWITH_PYTHON2=OFF -DMGR_PYTHON_VERSION=3 -DWITH_PYTHON3=3 -DWITH_CEPHFS_JAVA=ON -DWITH_CEPHFS_SHELL=ON -DWITH_TESTS=OFF -DWITH_SYSTEM_BOOST=ON -DWITH_LTTNG=OFF -DWITH_EMBEDDED=OFF -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib -DWITH_MGR_DASHBOARD_FRONTEND=OFF -DWITH_SYSTEMD=ON -DCEPH_SYSTEMD_ENV_DIR=/etc/default -DCMAKE_INSTALL_SYSCONFDIR=/etc -DSYSTEMD_SYSTEM_UNIT_DIR=/lib/systemd/system -DWITH_RADOSGW_KAFKA_ENDPOINT=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_GRAFANA=ON -DWITH_RADOSGW_SELECT_PARQUET=OFF -DWITH_RBD_RWL=ON -DWITH_RBD_SSD_CACHE=ON -DWITH_SYSTEM_PMDK=ON -DWITH_BLUESTORE_PMEM=ON -DWITH_SPDK=ON -DWITH_SEASTAR=ON -DSeastar_CXX_FLAGS=-DSEASTAR_DEFAULT_ALLOCATOR -DBOOST_J=4 -DWITH_BOOST_CONTEXT=ON ..

Package version strings

For details about packages’ version strings, refer to the [Ubuntu Maintainers Handbook(https://github.com/canonical/ubuntu-maintainers-handbook/blob/main/VersionStrings.md)]. The break down for each number in the version string of Ceph 17.2.7-0ubuntu0.22.04.1 is as below.

Conclusions

We have 2 ways to verify an Ubuntu deb package build flags: by 1) verify in debian/rules from the downloaded source, or 2) from buildlog in lauchpad web ui. A deb package might be built differently from upstream so it’d better to verify build flags in both upstream source and package source.