From 2d590ff08faf396703d466a28342da4c64c4c012 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Mon, 4 Dec 2023 10:49:47 +0900 Subject: [PATCH] UBUNTU: [Packaging] make $(stampdir)/stamp-build-perarch depend on build-arch Since commit ("UBUNTU: [Packaging] bpftool: always use vmlinux to generate headers"), tools/bpf/bpftool/vmlinux must be created before building the bpftool. This is not guaranteed because the $(stampdir)/stamp-build-perarch target does not depend on build-arch. Running 'debian/rules binary' results in the following build error: mv [...]/linux/debian/build/tools-perarch/tools/bpf/bpftool/vmlinux [...]/linux/debian/build/tools-perarch/vmlinux mv: cannot stat '[...]/linux/debian/build/tools-perarch/tools/bpf/bpftool/vmlinux': No such file or directory This potential issue has been hidden, relying on build drivers such as dpkg-buildpackage running 'debian/rules build' and 'debian/rules binary' as separate steps. Without rootless builds, the (fake) root privilege is required for the binary target, hence dpkg-buildpackage splits the build process into three stages: - fakeroot debian/rules clean - debian/rules build - fakeroot debian/rules binary To support rootless builds, you need to specify all dependencies correctly without such an assumption. Once we transition to rootless builds, the 'binary' target will not require the root privilege any more, so dpkg-buildpackage will merge 'build' and 'binary' into a single step. We need to assume only the following two will be executed: - debian/rules clean - debian/rules binary Signed-off-by: Masahiro Yamada Acked-by: Agathe Porte Acked-by: Thibault Ferrante Signed-off-by: Dimitri John Ledkov --- debian/rules.d/2-binary-arch.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index 66f48980b3ea..a07600d6c17d 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -662,7 +662,7 @@ ifeq ($(do_any_tools),true) endif touch $@ -$(stampdir)/stamp-build-perarch: $(stampdir)/stamp-prepare-perarch install-arch-headers +$(stampdir)/stamp-build-perarch: $(stampdir)/stamp-prepare-perarch install-arch-headers build-arch @echo Debug: $@ ifeq ($(do_linux_tools),true) ifeq ($(do_tools_usbip),true)