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 <masahiro.yamada@canonical.com>
Acked-by: Agathe Porte <agathe.porte@canonical.com>
Acked-by: Thibault Ferrante <thibault.ferrante@canonical.com>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
This commit is contained in:
Masahiro Yamada
2023-12-04 10:49:47 +09:00
committed by Paolo Pisati
parent 106510ac07
commit 2d590ff08f
+1 -1
View File
@@ -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)