@@ -1146,6 +1146,35 @@ deploy directory `DEPLOY_DIR_DEB` instead of being deployed to the `WORKDIR`.
Recipes that accessed the built debs through `${WORKDIR}/*.deb` (e.g. to unpack an
artifact in a `do_deploy` task) must now reference `${DEPLOY_DIR_DEB}/*.deb` instead.
+### Debian source packages are deployed to `DEPLOY_DIR_SRC`
+
+The source packages produced by `do_dpkg_source` are now exported into a shared,
+sstate-tracked deploy dir `DEPLOY_DIR_SRC` instead of being deployed to the `WORKDIR`.
+
+Recipes that access the source packages through `${WORKDIR}/*.tar.{gz,xz}` must now
+reference the local copy in `${DEPLOY_DIR_SRC}` instead.
+
+### Architecture specific source packages
+
+Setting `DPKG_ARCH = "<arch>"` makes the source package architecture-specific,
+unlike `all` or `any`. Because Debian source packages are identified by name and
+version, package providers must ensure that a source package with the same name
+and version does not contain different content for different architectures. This
+was never allowed, but Isar now enforces it.
+
+In this case, you can use the following pattern to make the package architecture specific,
+while still maintaining backward compatibility:
+
+```
+inherit dpkg-raw
+PROVIDES := "${BPN}"
+DEBIAN_PROVIDES := "${BPN}"
+PN .= "-${DISTRO_ARCH}"
+DPKG_ARCH ?= "${DISTRO_ARCH}"
+```
+
+Firmware packages are an exception because they are built for only one architecture.
+
### Add Hyper-V machine support
A new machine `hyper-v` has been introduced for building images
@@ -13,7 +13,12 @@ TAR_REPRO_OPTS ?= "--exclude=.git --exclude=debian \
DPKG_SOURCE_EXTRA_ARGS ?= "-I"
DEBIAN_SOURCE ?= "${BPN}"
+SRCPKG_DIR = "${WORKDIR}/deploy-srcpkg"
+DEPLOY_DIR_SRC = "${DEPLOY_DIR}/isar-source/${DISTRO}/${BPN}"
+do_dpkg_source[cleandirs] = "${SRCPKG_DIR}"
+do_dpkg_source[sstate-inputdirs] = "${SRCPKG_DIR}"
+do_dpkg_source[sstate-outputdirs] = "${DEPLOY_DIR_SRC}"
do_dpkg_source() {
# Create a .dsc file from source directory to use it with sbuild
DEB_SOURCE_NAME=$(dpkg-parsechangelog --show-field Source --file ${WORKDIR}/${PPS}/debian/changelog)
@@ -22,9 +27,19 @@ do_dpkg_source() {
fi
find ${WORKDIR} -maxdepth 1 -name "${DEBIAN_SOURCE}_*.dsc" -delete
sh -c "cd ${WORKDIR}; dpkg-source ${DPKG_SOURCE_EXTRA_ARGS} -b ${PPS}"
+ # move packages to deploy directory
+ find ${WORKDIR} -maxdepth 1 \( -name "${DEBIAN_SOURCE}_*.tar.*" -o -name "${DEBIAN_SOURCE}_*.dsc" \) -exec mv {} ${SRCPKG_DIR}/ \;
}
addtask dpkg_source after do_prepare_build
+SSTATETASKS += "do_dpkg_source"
+
+python do_dpkg_source_setscene() {
+ sstate_setscene(d)
+}
+
+addtask dpkg_source_setscene
+
CLEANFUNCS += "deb_clean_source"
deb_clean_source() {
@@ -34,11 +49,11 @@ deb_clean_source() {
do_deploy_source[depends] += "isar-apt:do_cache_config"
do_deploy_source[lockfiles] = "${REPO_ISAR_DIR}/isar.lock"
-do_deploy_source[dirs] = "${S}"
+do_deploy_source[dirs] = "${S} ${DEPLOY_DIR_SRC}"
do_deploy_source() {
repo_del_srcpackage "${REPO_ISAR_DIR}"/"${DISTRO}" \
"${REPO_ISAR_DB_DIR}"/"${DISTRO}" "${DEBDISTRONAME}" "${DEBIAN_SOURCE}"
- DSC_FILE=$(find ${WORKDIR} -maxdepth 1 -name "${DEBIAN_SOURCE}_*.dsc")
+ DSC_FILE=$(find ${DEPLOY_DIR_SRC} -maxdepth 1 -name "${DEBIAN_SOURCE}_*.dsc")
if [ -n "${DSC_FILE}" ]; then
repo_add_srcpackage "${REPO_ISAR_DIR}"/"${DISTRO}" \
"${REPO_ISAR_DB_DIR}"/"${DISTRO}" \
@@ -116,7 +116,7 @@ dpkg_runbuild() {
echo '$apt_keep_downloaded_packages = 1;' >> ${SBUILD_CONFIG}
echo '$stalled_pkg_timeout = ${DPKG_BUILD_TIMEOUT};' >> ${SBUILD_CONFIG}
- DSC_FILE=$(find ${WORKDIR} -maxdepth 1 -name "${DEBIAN_SOURCE}_*.dsc" -print)
+ DSC_FILE=$(find ${DEPLOY_DIR_SRC} -maxdepth 1 -name "${DEBIAN_SOURCE}_*.dsc" -print)
# networking is automatically enabled on older versions of sbuild
sbuild_network_option=""
As the do_dpkg_source task now runs for each corresponding do_deploy_deb task, we also want to cache the generated results (to avoid pulling in a much bigger dependency tree on otherwise cached rebuilds). For that, we cache the .dsc and the .tar.* artifacts in the deploy dir. This is implemented similar to how do_dpkg_build artifacts (.debs) are cached, which is also compatible with a hash equivalence server. Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com> --- RECIPE-API-CHANGELOG.md | 29 +++++++++++++++++++++++++ meta/classes-recipe/dpkg-source.bbclass | 19 ++++++++++++++-- meta/classes-recipe/dpkg.bbclass | 2 +- 3 files changed, 47 insertions(+), 3 deletions(-)