Skip to content

Commit 7850bbe

Browse files
roxellbhcopeland
authored andcommitted
docker: fix native pkg-config after foreign-arch install
Installing pkg-config for a foreign architecture may break the native binary through the alternatives system. The fuse3 check then fails even with the fallback to native pkg-config. Symlink the native binary into /usr/local/bin so it takes PATH precedence. Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
1 parent 87e6392 commit 7850bbe

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

support/docker/Dockerfile.build

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ RUN set -x; \
151151
--assume-yes \
152152
--no-install-recommends \
153153
--option=debug::pkgProblemResolver=yes \
154-
pkg-config:${arch}; \
154+
pkg-config:${arch} && \
155+
: foreign-arch pkg-config may switch the alternatives symlink to a && \
156+
: binary that cannot execute on the build host, fix it && \
157+
native_triplet=$(dpkg-architecture -q DEB_HOST_MULTIARCH) && \
158+
ln -sf /usr/bin/${native_triplet}-pkg-config /usr/local/bin/pkg-config; \
155159
fi && \
156160
: This is a horrible hack, but a foreign binutils-dev is not installable && \
157161
: See https://bugs.debian.org/983540 && \

0 commit comments

Comments
 (0)