rustc/debian/architecture-test.mk
Andres Salomon 39ef841c01 fix bootstrap build (source_orig-stage0 rule) to include all archs
In order to expand the various DEB_HOST_* variables when running
make_orig-stage0_tarball.sh, we were calling out to dpkg-architecture,
specifying for example -a<arch> -qDEB_HOST_ARCH. However, the
dpkg-architecture man page states:

      You can specify the host architecture by providing one or both of the options
       --host-arch and --host-type, otherwise the DEB_HOST_ARCH variable is used if set
       (and --force not being specified).

[--host-arch is equivalent to -a]

DEB_HOST_ARCH is set somewhere else during the build, and is overriding
what dpkg-architecture returns. That's why, if run on an amd64 machine,
the bootstrap stage0.orig.tar.xz would only include the amd64 rustc
binary. We must pass --force (aka -f) to dpkg-architecture to get it to
return the proper results we're expecting.

This fixes https://bugs.debian.org/1021711
2024-02-09 20:54:00 -05:00

17 lines
609 B
Makefile

# Used for testing architecture.mk, and for make_orig-stage0_tarball.sh.
# Not for end users.
#
# Usage:
# $ make -s --no-print-directory -f debian/architecture-test.mk rust-for-deb_arm64
# arm64 aarch64-unknown-linux-gnu
include debian/architecture.mk
deb_arch_setvars = $(foreach var,ARCH ARCH_OS ARCH_CPU ARCH_BITS ARCH_ENDIAN GNU_CPU GNU_SYSTEM GNU_TYPE MULTIARCH,\
$(eval DEB_$(1)_$(var) = $(shell dpkg-architecture -f -a$(1) -qDEB_HOST_$(var) 2>/dev/null)))
rust-for-deb_%:
$(eval $(call deb_arch_setvars,$*))
$(eval $(call rust_type_setvar,DEB_$*))
@echo $(DEB_$(*)_ARCH) $(DEB_$(*)_RUST_TYPE)