Skip to content

Commit 635bd70

Browse files
Merge #933
933: Deny installation of conflicting Debian packages. r=Emilgardis a=Alexhuszagh Deny the installation of Debian packages that conflict with our cross-compiler toolchains, by using package pinning with a -1 priority to ensure they have no installation candidate. Co-authored-by: Alex Huszagh <[email protected]>
2 parents c6bedf2 + 93b3592 commit 635bd70

16 files changed

+101
-10
lines changed

.changes/931.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"description": "deny installation of debian packages that conflict with our cross-compiler toolchains.",
3+
"type": "fixed"
4+
}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
99

1010
## [v0.2.4] - 2022-07-10
1111

12-
## Fixed
12+
### Fixed
1313

1414
- #930 - fix any parsing of 1-character subcommands
1515
- #929 - Fixed issue where `--verbose` would not output data when it should

docker/Dockerfile.aarch64-unknown-linux-gnu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
1414
g++-aarch64-linux-gnu \
1515
libc6-dev-arm64-cross
1616

17+
COPY deny-debian-packages.sh /
18+
RUN TARGET_ARCH=arm64 /deny-debian-packages.sh \
19+
binutils \
20+
binutils-aarch64-linux-gnu
21+
1722
COPY qemu.sh /
1823
RUN /qemu.sh aarch64 softmmu
1924

docker/Dockerfile.arm-unknown-linux-gnueabi

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ RUN /cmake.sh
1010
COPY xargo.sh /
1111
RUN /xargo.sh
1212

13-
COPY qemu.sh /
1413
RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
1514
g++-arm-linux-gnueabi \
16-
libc6-dev-armel-cross && \
17-
/qemu.sh arm
15+
libc6-dev-armel-cross
16+
17+
COPY deny-debian-packages.sh /
18+
RUN TARGET_ARCH=armel /deny-debian-packages.sh \
19+
binutils \
20+
binutils-arm-linux-gnueabi
21+
22+
COPY qemu.sh /
23+
RUN /qemu.sh arm
1824

1925
COPY qemu-runner /
2026

docker/Dockerfile.armv5te-unknown-linux-gnueabi

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ RUN /cmake.sh
1010
COPY xargo.sh /
1111
RUN /xargo.sh
1212

13-
COPY qemu.sh /
1413
RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
1514
g++-arm-linux-gnueabi \
1615
crossbuild-essential-armel \
17-
libc6-dev-armel-cross && \
18-
/qemu.sh arm
16+
libc6-dev-armel-cross
17+
18+
COPY deny-debian-packages.sh /
19+
RUN TARGET_ARCH=armel /deny-debian-packages.sh \
20+
binutils \
21+
binutils-arm-linux-gnueabi
22+
23+
COPY qemu.sh /
24+
RUN /qemu.sh arm
1925

2026
COPY qemu-runner /
2127

docker/Dockerfile.armv7-unknown-linux-gnueabihf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
1414
g++-arm-linux-gnueabihf \
1515
libc6-dev-armhf-cross
1616

17+
COPY deny-debian-packages.sh /
18+
RUN TARGET_ARCH=armhf /deny-debian-packages.sh \
19+
binutils \
20+
binutils-arm-linux-gnueabihf
21+
1722
COPY qemu.sh /
1823
RUN /qemu.sh arm softmmu
1924

docker/Dockerfile.mips64-unknown-linux-gnuabi64

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ RUN /cmake.sh
1010
COPY xargo.sh /
1111
RUN /xargo.sh
1212

13-
COPY qemu.sh /
1413
RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
1514
g++-mips64-linux-gnuabi64 \
16-
libc6-dev-mips64-cross && \
17-
/qemu.sh mips64
15+
libc6-dev-mips64-cross
16+
17+
COPY deny-debian-packages.sh /
18+
RUN TARGET_ARCH=mips64 /deny-debian-packages.sh \
19+
binutils \
20+
binutils-mips64-linux-gnuabi64
21+
22+
COPY qemu.sh /
23+
RUN /qemu.sh mips64
1824

1925
COPY qemu-runner /
2026

docker/Dockerfile.mips64el-unknown-linux-gnuabi64

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
1414
g++-mips64el-linux-gnuabi64 \
1515
libc6-dev-mips64el-cross
1616

17+
COPY deny-debian-packages.sh /
18+
RUN TARGET_ARCH=mips64el /deny-debian-packages.sh \
19+
binutils \
20+
binutils-mips64el-linux-gnuabi64
21+
1722
COPY qemu.sh /
1823
RUN /qemu.sh mips64el softmmu
1924

docker/Dockerfile.mipsel-unknown-linux-gnu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
1414
g++-mipsel-linux-gnu \
1515
libc6-dev-mipsel-cross
1616

17+
COPY deny-debian-packages.sh /
18+
RUN TARGET_ARCH=mipsel /deny-debian-packages.sh \
19+
binutils \
20+
binutils-mipsel-linux-gnu
21+
1722
COPY qemu.sh /
1823
RUN /qemu.sh mipsel softmmu
1924

docker/Dockerfile.powerpc-unknown-linux-gnu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
1414
g++-powerpc-linux-gnu \
1515
libc6-dev-powerpc-cross
1616

17+
COPY deny-debian-packages.sh /
18+
RUN TARGET_ARCH=powerpc /deny-debian-packages.sh \
19+
binutils \
20+
binutils-powerpc-linux-gnu
21+
1722
COPY qemu.sh /
1823
RUN /qemu.sh ppc softmmu
1924

docker/Dockerfile.powerpc64-unknown-linux-gnu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
1414
g++-powerpc64-linux-gnu \
1515
libc6-dev-ppc64-cross
1616

17+
COPY deny-debian-packages.sh /
18+
RUN TARGET_ARCH=ppc64 /deny-debian-packages.sh \
19+
binutils \
20+
binutils-powerpc64-linux-gnu
21+
1722
COPY qemu.sh /
1823
RUN /qemu.sh ppc64 softmmu
1924

docker/Dockerfile.powerpc64le-unknown-linux-gnu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
1414
g++-powerpc64le-linux-gnu \
1515
libc6-dev-ppc64el-cross
1616

17+
COPY deny-debian-packages.sh /
18+
RUN TARGET_ARCH=ppc64el /deny-debian-packages.sh \
19+
binutils \
20+
binutils-powerpc64le-linux-gnu
21+
1722
COPY qemu.sh /
1823
RUN /qemu.sh ppc64le softmmu
1924

docker/Dockerfile.riscv64gc-unknown-linux-gnu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1414
g++-riscv64-linux-gnu \
1515
libc6-dev-riscv64-cross
1616

17+
COPY deny-debian-packages.sh /
18+
RUN TARGET_ARCH=riscv64 /deny-debian-packages.sh \
19+
binutils \
20+
binutils-riscv64-linux-gnu
21+
1722
COPY qemu.sh /
1823
RUN /qemu.sh riscv64
1924

docker/Dockerfile.s390x-unknown-linux-gnu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
1414
g++-s390x-linux-gnu \
1515
libc6-dev-s390x-cross
1616

17+
COPY deny-debian-packages.sh /
18+
RUN TARGET_ARCH=s390x /deny-debian-packages.sh \
19+
binutils \
20+
binutils-s390x-linux-gnu
21+
1722
COPY qemu.sh /
1823
RUN /qemu.sh s390x softmmu
1924

docker/Dockerfile.sparc64-unknown-linux-gnu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
1414
g++-sparc64-linux-gnu \
1515
libc6-dev-sparc64-cross
1616

17+
COPY deny-debian-packages.sh /
18+
RUN TARGET_ARCH=sparc64 /deny-debian-packages.sh \
19+
binutils \
20+
binutils-sparc64-linux-gnu
21+
1722
COPY qemu.sh /
1823
RUN /qemu.sh sparc64 softmmu
1924

docker/deny-debian-packages.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
set -euo pipefail
5+
6+
main() {
7+
local package
8+
9+
for package in "${@}"; do
10+
echo "Package: ${package}:${TARGET_ARCH}
11+
Pin: release *
12+
Pin-Priority: -1" > "/etc/apt/preferences.d/${package}"
13+
echo "${package}"
14+
done
15+
16+
rm "${0}"
17+
}
18+
19+
main "${@}"

0 commit comments

Comments
 (0)