From 6dbdac10d8a6dd3715c06b9b5d20ccab996d0fd7 Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Sat, 9 Jul 2022 20:33:52 -0500 Subject: [PATCH 1/2] Increment Ubuntu base image versions to 20.04. Update linux-image script to latest kernel and debian versions. Update by default to kernel version 5.10.0-8. This means updating our debian source to bullseye from buster. 32-bit big-endian mips was discontinued in bullseye, so we revert to buster. For some images, due to constantly updating linux kernel versions, we need to use wildcards otherwise the build step breaks. Since there may be more than one relevant package, we've added a function to manually expand wildcards and select the best kernel version, `max_kernel_version`. Likewise, on 32-bit big-endian mips, we need to specify the ncurses version. Created temporary symlinks for autconf and autom4te due to the build expecting a hard-coded version (2.69) of these binaries. Fixed the patch for `debian/rules` due to changed line numbers. Updated the patch to use dwarf rather than sjlj exceptions to patch the template file (`debian/gcc-mingw-w64-i686.install.in`) since `debian/gcc-mingw-w64-i686.install` is overwritten during the build. For `x86_64-unknown-linux-gnu`, building the linux image fails unless we download specific versions of `libgcc-s1` and `libstdc++6`, since the pre-installed Ubuntu versions are higher than the Debian versions. We therefore extract the specific versions. However, while building the linux image, it prefers these system versions, so we must uninstall them or else while running `qemu-system` it cannot find `libgcc_s1.so.1`. Since `apt` and basically every other package besides `dpkg` relies on `libgcc-s1`, we have to temporarily delete it and reinstall it. --- .changes/591.json | 6 + .github/workflows/ci.yml | 2 +- README.md | 76 ++++---- docker/Dockerfile.aarch64-unknown-linux-gnu | 2 +- docker/Dockerfile.aarch64-unknown-linux-musl | 2 +- docker/Dockerfile.arm-unknown-linux-gnueabi | 2 +- docker/Dockerfile.arm-unknown-linux-gnueabihf | 2 +- docker/Dockerfile.arm-unknown-linux-musleabi | 2 +- .../Dockerfile.arm-unknown-linux-musleabihf | 2 +- .../Dockerfile.armv5te-unknown-linux-gnueabi | 2 +- .../Dockerfile.armv5te-unknown-linux-musleabi | 2 +- docker/Dockerfile.armv7-unknown-linux-gnueabi | 2 +- .../Dockerfile.armv7-unknown-linux-gnueabihf | 2 +- .../Dockerfile.armv7-unknown-linux-musleabi | 2 +- docker/Dockerfile.i586-unknown-linux-gnu | 2 +- docker/Dockerfile.i586-unknown-linux-musl | 2 +- docker/Dockerfile.i686-pc-windows-gnu | 2 +- docker/Dockerfile.i686-unknown-freebsd | 2 +- docker/Dockerfile.i686-unknown-linux-gnu | 2 +- docker/Dockerfile.i686-unknown-linux-musl | 2 +- docker/Dockerfile.mips-unknown-linux-gnu | 2 +- docker/Dockerfile.mips-unknown-linux-musl | 2 +- .../Dockerfile.mips64-unknown-linux-gnuabi64 | 2 +- .../Dockerfile.mips64-unknown-linux-muslabi64 | 2 +- ...Dockerfile.mips64el-unknown-linux-gnuabi64 | 2 +- ...ockerfile.mips64el-unknown-linux-muslabi64 | 2 +- docker/Dockerfile.mipsel-unknown-linux-gnu | 2 +- docker/Dockerfile.mipsel-unknown-linux-musl | 2 +- docker/Dockerfile.powerpc-unknown-linux-gnu | 2 +- docker/Dockerfile.powerpc64-unknown-linux-gnu | 2 +- .../Dockerfile.powerpc64le-unknown-linux-gnu | 2 +- docker/Dockerfile.riscv64gc-unknown-linux-gnu | 2 +- docker/Dockerfile.s390x-unknown-linux-gnu | 2 +- docker/Dockerfile.sparc64-unknown-linux-gnu | 2 +- docker/Dockerfile.sparcv9-sun-solaris | 2 +- docker/Dockerfile.thumbv6m-none-eabi | 2 +- docker/Dockerfile.thumbv7em-none-eabi | 2 +- docker/Dockerfile.thumbv7em-none-eabihf | 2 +- docker/Dockerfile.thumbv7m-none-eabi | 2 +- ...erfile.thumbv7neon-unknown-linux-gnueabihf | 2 +- docker/Dockerfile.x86_64-pc-windows-gnu | 2 +- docker/Dockerfile.x86_64-sun-solaris | 2 +- docker/Dockerfile.x86_64-unknown-dragonfly | 2 +- docker/Dockerfile.x86_64-unknown-freebsd | 2 +- docker/Dockerfile.x86_64-unknown-linux-gnu | 2 +- ...Dockerfile.x86_64-unknown-linux-gnu.centos | 2 +- docker/Dockerfile.x86_64-unknown-netbsd | 2 +- docker/dragonfly.sh | 50 +----- docker/linux-image.sh | 167 ++++++++++++++++-- docker/mingw.sh | 15 +- docker/solaris.sh | 2 + src/docker/shared.rs | 2 +- 52 files changed, 260 insertions(+), 148 deletions(-) create mode 100644 .changes/591.json diff --git a/.changes/591.json b/.changes/591.json new file mode 100644 index 000000000..1f989b4bc --- /dev/null +++ b/.changes/591.json @@ -0,0 +1,6 @@ +{ + "description": "Update Ubuntu images to 20.04 LTS.", + "type": "changed", + "breaking": true, + "issues": [417, 517, 556, 616] +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9e469dff..b06415283 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -267,7 +267,7 @@ jobs: - name: Build Docker image id: build-docker-image if: steps.prepare-meta.outputs.has-image - timeout-minutes: 60 + timeout-minutes: 120 run: cargo xtask build-docker-image -v "${TARGET}${SUB:+.$SUB}" env: TARGET: ${{ matrix.target }} diff --git a/README.md b/README.md index 848aeac1a..8b82646f0 100644 --- a/README.md +++ b/README.md @@ -320,58 +320,58 @@ terminate. | Target | libc | GCC | C++ | QEMU | `test` | |--------------------------------------|-------:|--------:|:---:|------:|:------:| | `aarch64-linux-android` [1] | 9.0.8 | 9.0.8 | ✓ | 6.1.0 | ✓ | -| `aarch64-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | -| `aarch64-unknown-linux-musl` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | +| `aarch64-unknown-linux-gnu` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | +| `aarch64-unknown-linux-musl` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | | `arm-linux-androideabi` [1] | 9.0.8 | 9.0.8 | ✓ | 6.1.0 | ✓ | -| `arm-unknown-linux-gnueabi` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | +| `arm-unknown-linux-gnueabi` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | | `arm-unknown-linux-gnueabihf` | 2.17 | 8.3.0 | ✓ | 6.1.0 | ✓ | -| `arm-unknown-linux-musleabi` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | -| `arm-unknown-linux-musleabihf` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | -| `armv5te-unknown-linux-gnueabi` | 2.27 | 7.5.0 | ✓ | 6.1.0 | ✓ | -| `armv5te-unknown-linux-musleabi` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | +| `arm-unknown-linux-musleabi` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | +| `arm-unknown-linux-musleabihf` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | +| `armv5te-unknown-linux-gnueabi` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | +| `armv5te-unknown-linux-musleabi` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | | `armv7-linux-androideabi` [1] | 9.0.8 | 9.0.8 | ✓ | 6.1.0 | ✓ | -| `armv7-unknown-linux-gnueabi` | 2.27 | 7.5.0 | ✓ | 6.1.0 | ✓ | -| `armv7-unknown-linux-gnueabihf` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | -| `armv7-unknown-linux-musleabi` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | -| `armv7-unknown-linux-musleabihf` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | -| `i586-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | N/A | ✓ | -| `i586-unknown-linux-musl` | 1.1.24 | 9.2.0 | ✓ | N/A | ✓ | +| `armv7-unknown-linux-gnueabi` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | +| `armv7-unknown-linux-gnueabihf` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | +| `armv7-unknown-linux-musleabi` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | +| `armv7-unknown-linux-musleabihf` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | +| `i586-unknown-linux-gnu` | 2.31 | 9.4.0 | ✓ | N/A | ✓ | +| `i586-unknown-linux-musl` | 1.1.24 | 9.2.0 | ✓ | N/A | ✓ | | `i686-unknown-freebsd` | 1.5 | 6.4.0 | ✓ | N/A | | | `i686-linux-android` [1] | 9.0.8 | 9.0.8 | ✓ | 6.1.0 | ✓ | -| `i686-pc-windows-gnu` | N/A | 7.5 | ✓ | N/A | ✓ | -| `i686-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | -| `i686-unknown-linux-musl` | 1.1.24 | 9.2.0 | ✓ | N/A | ✓ | -| `mips-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | +| `i686-pc-windows-gnu` | N/A | 9.4 | ✓ | N/A | ✓ | +| `i686-unknown-linux-gnu` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | +| `mips-unknown-linux-musl` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | +| `mips-unknown-linux-gnu` | 2.30 | 9.4.0 | ✓ | 6.1.0 | ✓ | | `mips-unknown-linux-musl` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | -| `mips64-unknown-linux-gnuabi64` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | -| `mips64-unknown-linux-muslabi64` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | -| `mips64el-unknown-linux-gnuabi64` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | -| `mips64el-unknown-linux-muslabi64` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | -| `mipsel-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | -| `mipsel-unknown-linux-musl` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | -| `powerpc-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | -| `powerpc64-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | -| `powerpc64le-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | -| `riscv64gc-unknown-linux-gnu` | 2.27 | 7.5.0 | ✓ | 6.1.0 | ✓ | -| `s390x-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | -| `sparc64-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | +| `mips64-unknown-linux-gnuabi64` | 2.30 | 9.4.0 | ✓ | 6.1.0 | ✓ | +| `mips64-unknown-linux-muslabi64` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | +| `mips64el-unknown-linux-gnuabi64` | 2.30 | 9.4.0 | ✓ | 6.1.0 | ✓ | +| `mips64el-unknown-linux-muslabi64` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | +| `mipsel-unknown-linux-gnu` | 2.30 | 9.4.0 | ✓ | 6.1.0 | ✓ | +| `mipsel-unknown-linux-musl` | 1.1.24 | 9.2.0 | ✓ | 6.1.0 | ✓ | +| `powerpc-unknown-linux-gnu` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | +| `powerpc64-unknown-linux-gnu` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | +| `powerpc64le-unknown-linux-gnu` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | +| `riscv64gc-unknown-linux-gnu` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | +| `s390x-unknown-linux-gnu` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | +| `sparc64-unknown-linux-gnu` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | | `sparcv9-sun-solaris` | 1.22.7 | 8.4.0 | ✓ | N/A | | -| `thumbv6m-none-eabi` [4] | 2.2.0 | 4.9.3 | | N/A | | -| `thumbv7em-none-eabi` [4] | 2.2.0 | 4.9.3 | | N/A | | -| `thumbv7em-none-eabihf` [4] | 2.2.0 | 4.9.3 | | N/A | | -| `thumbv7m-none-eabi` [4] | 2.2.0 | 4.9.3 | | N/A | | +| `thumbv6m-none-eabi` [4] | 3.3.0 | 9.2.1 | | N/A | | +| `thumbv7em-none-eabi` [4] | 3.3.0 | 9.2.1 | | N/A | | +| `thumbv7em-none-eabihf` [4] | 3.3.0 | 9.2.1 | | N/A | | +| `thumbv7m-none-eabi` [4] | 3.3.0 | 9.2.1 | | N/A | | | `thumbv7neon-linux-androideabi` [1] | 9.0.8 | 9.0.8 | ✓ | 6.1.0 | ✓ | -| `thumbv7neon-unknown-linux-gnueabihf`| 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | +| `thumbv7neon-unknown-linux-gnueabihf`| 2.31 | 9.4.0 | ✓ | N/A | ✓ | | `wasm32-unknown-emscripten` [6] | 3.1.14 | 15.0.0 | ✓ | N/A | ✓ | | `x86_64-linux-android` [1] | 9.0.8 | 9.0.8 | ✓ | 6.1.0 | ✓ | -| `x86_64-pc-windows-gnu` | N/A | 7.3 | ✓ | N/A | ✓ | +| `x86_64-pc-windows-gnu` | N/A | 9.3 | ✓ | N/A | ✓ | | `x86_64-sun-solaris` | 1.22.7 | 8.4.0 | ✓ | N/A | | | `x86_64-unknown-freebsd` | 1.5 | 6.4.0 | ✓ | N/A | | -| `x86_64-unknown-dragonfly` [2] [3] | 6.0.1 | 5.3.0 | ✓ | N/A | | +| `x86_64-unknown-dragonfly` [2] [3] | 6.0.1 | 10.3.0 | ✓ | N/A | | | `x86_64-unknown-illumos` | 1.20.4 | 8.4.0 | ✓ | N/A | | -| `x86_64-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | ✓ | +| `x86_64-unknown-linux-gnu` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | | `x86_64-unknown-linux-gnu:centos` [5] | 2.17 | 4.8.5 | ✓ | 4.2.1 | ✓ | -| `x86_64-unknown-linux-musl` | 1.1.24 | 9.2.0 | ✓ | N/A | ✓ | +| `x86_64-unknown-linux-musl` | 1.1.24 | 9.2.0 | ✓ | N/A | ✓ | | `x86_64-unknown-netbsd` [3] | 9.2.0 | 9.4.0 | ✓ | N/A | | diff --git a/docker/Dockerfile.aarch64-unknown-linux-gnu b/docker/Dockerfile.aarch64-unknown-linux-gnu index b29cc4f6c..758a96036 100644 --- a/docker/Dockerfile.aarch64-unknown-linux-gnu +++ b/docker/Dockerfile.aarch64-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.aarch64-unknown-linux-musl b/docker/Dockerfile.aarch64-unknown-linux-musl index cfb7e4d87..c6a2e72f5 100644 --- a/docker/Dockerfile.aarch64-unknown-linux-musl +++ b/docker/Dockerfile.aarch64-unknown-linux-musl @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.arm-unknown-linux-gnueabi b/docker/Dockerfile.arm-unknown-linux-gnueabi index aa8644207..aa6df196f 100644 --- a/docker/Dockerfile.arm-unknown-linux-gnueabi +++ b/docker/Dockerfile.arm-unknown-linux-gnueabi @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.arm-unknown-linux-gnueabihf b/docker/Dockerfile.arm-unknown-linux-gnueabihf index cc8aa8163..369f7b3a2 100644 --- a/docker/Dockerfile.arm-unknown-linux-gnueabihf +++ b/docker/Dockerfile.arm-unknown-linux-gnueabihf @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.arm-unknown-linux-musleabi b/docker/Dockerfile.arm-unknown-linux-musleabi index 2a3844be3..9a30522d0 100644 --- a/docker/Dockerfile.arm-unknown-linux-musleabi +++ b/docker/Dockerfile.arm-unknown-linux-musleabi @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.arm-unknown-linux-musleabihf b/docker/Dockerfile.arm-unknown-linux-musleabihf index d012d38b7..da47f173f 100644 --- a/docker/Dockerfile.arm-unknown-linux-musleabihf +++ b/docker/Dockerfile.arm-unknown-linux-musleabihf @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.armv5te-unknown-linux-gnueabi b/docker/Dockerfile.armv5te-unknown-linux-gnueabi index c45f871e5..0d3b71809 100644 --- a/docker/Dockerfile.armv5te-unknown-linux-gnueabi +++ b/docker/Dockerfile.armv5te-unknown-linux-gnueabi @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.armv5te-unknown-linux-musleabi b/docker/Dockerfile.armv5te-unknown-linux-musleabi index a87d3fdb9..b4c300af1 100644 --- a/docker/Dockerfile.armv5te-unknown-linux-musleabi +++ b/docker/Dockerfile.armv5te-unknown-linux-musleabi @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.armv7-unknown-linux-gnueabi b/docker/Dockerfile.armv7-unknown-linux-gnueabi index c8bffaae0..84caad17e 100644 --- a/docker/Dockerfile.armv7-unknown-linux-gnueabi +++ b/docker/Dockerfile.armv7-unknown-linux-gnueabi @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.armv7-unknown-linux-gnueabihf b/docker/Dockerfile.armv7-unknown-linux-gnueabihf index 22725ecec..9560bc843 100644 --- a/docker/Dockerfile.armv7-unknown-linux-gnueabihf +++ b/docker/Dockerfile.armv7-unknown-linux-gnueabihf @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.armv7-unknown-linux-musleabi b/docker/Dockerfile.armv7-unknown-linux-musleabi index ab1a965a4..05d129b5c 100644 --- a/docker/Dockerfile.armv7-unknown-linux-musleabi +++ b/docker/Dockerfile.armv7-unknown-linux-musleabi @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.i586-unknown-linux-gnu b/docker/Dockerfile.i586-unknown-linux-gnu index 1e5610f28..a4266c044 100644 --- a/docker/Dockerfile.i586-unknown-linux-gnu +++ b/docker/Dockerfile.i586-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.i586-unknown-linux-musl b/docker/Dockerfile.i586-unknown-linux-musl index ade3dd4d3..d33620eba 100644 --- a/docker/Dockerfile.i586-unknown-linux-musl +++ b/docker/Dockerfile.i586-unknown-linux-musl @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.i686-pc-windows-gnu b/docker/Dockerfile.i686-pc-windows-gnu index 761f48d96..0d9da94c6 100644 --- a/docker/Dockerfile.i686-pc-windows-gnu +++ b/docker/Dockerfile.i686-pc-windows-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.i686-unknown-freebsd b/docker/Dockerfile.i686-unknown-freebsd index af4600a9c..4dffb9170 100644 --- a/docker/Dockerfile.i686-unknown-freebsd +++ b/docker/Dockerfile.i686-unknown-freebsd @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.i686-unknown-linux-gnu b/docker/Dockerfile.i686-unknown-linux-gnu index a9cd692a8..6d9ed72fa 100644 --- a/docker/Dockerfile.i686-unknown-linux-gnu +++ b/docker/Dockerfile.i686-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.i686-unknown-linux-musl b/docker/Dockerfile.i686-unknown-linux-musl index 05821dff2..0229684da 100644 --- a/docker/Dockerfile.i686-unknown-linux-musl +++ b/docker/Dockerfile.i686-unknown-linux-musl @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.mips-unknown-linux-gnu b/docker/Dockerfile.mips-unknown-linux-gnu index 8f03a28d7..36bb118d8 100644 --- a/docker/Dockerfile.mips-unknown-linux-gnu +++ b/docker/Dockerfile.mips-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.mips-unknown-linux-musl b/docker/Dockerfile.mips-unknown-linux-musl index 4ba198442..4ae946ad0 100644 --- a/docker/Dockerfile.mips-unknown-linux-musl +++ b/docker/Dockerfile.mips-unknown-linux-musl @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.mips64-unknown-linux-gnuabi64 b/docker/Dockerfile.mips64-unknown-linux-gnuabi64 index 205f656d5..46a39c6e4 100644 --- a/docker/Dockerfile.mips64-unknown-linux-gnuabi64 +++ b/docker/Dockerfile.mips64-unknown-linux-gnuabi64 @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.mips64-unknown-linux-muslabi64 b/docker/Dockerfile.mips64-unknown-linux-muslabi64 index 76f0c2001..4a4fc7bca 100644 --- a/docker/Dockerfile.mips64-unknown-linux-muslabi64 +++ b/docker/Dockerfile.mips64-unknown-linux-muslabi64 @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 b/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 index fefd72796..b8171fd59 100644 --- a/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 +++ b/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.mips64el-unknown-linux-muslabi64 b/docker/Dockerfile.mips64el-unknown-linux-muslabi64 index a65d9f39a..f3134cfdb 100644 --- a/docker/Dockerfile.mips64el-unknown-linux-muslabi64 +++ b/docker/Dockerfile.mips64el-unknown-linux-muslabi64 @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 COPY common.sh lib.sh / RUN /common.sh diff --git a/docker/Dockerfile.mipsel-unknown-linux-gnu b/docker/Dockerfile.mipsel-unknown-linux-gnu index 397e2aeab..fec2bb606 100644 --- a/docker/Dockerfile.mipsel-unknown-linux-gnu +++ b/docker/Dockerfile.mipsel-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.mipsel-unknown-linux-musl b/docker/Dockerfile.mipsel-unknown-linux-musl index 864676215..2590c2307 100644 --- a/docker/Dockerfile.mipsel-unknown-linux-musl +++ b/docker/Dockerfile.mipsel-unknown-linux-musl @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.powerpc-unknown-linux-gnu b/docker/Dockerfile.powerpc-unknown-linux-gnu index f3b15930c..581cd02fd 100644 --- a/docker/Dockerfile.powerpc-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.powerpc64-unknown-linux-gnu b/docker/Dockerfile.powerpc64-unknown-linux-gnu index 3fc954df8..4f74aa5bd 100644 --- a/docker/Dockerfile.powerpc64-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc64-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.powerpc64le-unknown-linux-gnu b/docker/Dockerfile.powerpc64le-unknown-linux-gnu index e1714e4b7..021a6a49f 100644 --- a/docker/Dockerfile.powerpc64le-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc64le-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.riscv64gc-unknown-linux-gnu b/docker/Dockerfile.riscv64gc-unknown-linux-gnu index a92ae237e..440f2a3a4 100644 --- a/docker/Dockerfile.riscv64gc-unknown-linux-gnu +++ b/docker/Dockerfile.riscv64gc-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.s390x-unknown-linux-gnu b/docker/Dockerfile.s390x-unknown-linux-gnu index 59f3972cb..6799586cc 100644 --- a/docker/Dockerfile.s390x-unknown-linux-gnu +++ b/docker/Dockerfile.s390x-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.sparc64-unknown-linux-gnu b/docker/Dockerfile.sparc64-unknown-linux-gnu index 6ca037249..3e992900d 100644 --- a/docker/Dockerfile.sparc64-unknown-linux-gnu +++ b/docker/Dockerfile.sparc64-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.sparcv9-sun-solaris b/docker/Dockerfile.sparcv9-sun-solaris index 8d9c9c49a..4cf2701a6 100644 --- a/docker/Dockerfile.sparcv9-sun-solaris +++ b/docker/Dockerfile.sparcv9-sun-solaris @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.thumbv6m-none-eabi b/docker/Dockerfile.thumbv6m-none-eabi index 40474559a..1fab9f068 100644 --- a/docker/Dockerfile.thumbv6m-none-eabi +++ b/docker/Dockerfile.thumbv6m-none-eabi @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.thumbv7em-none-eabi b/docker/Dockerfile.thumbv7em-none-eabi index f5bc0b002..3ef13fcfe 100644 --- a/docker/Dockerfile.thumbv7em-none-eabi +++ b/docker/Dockerfile.thumbv7em-none-eabi @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.thumbv7em-none-eabihf b/docker/Dockerfile.thumbv7em-none-eabihf index 0a60cf361..aa773e620 100644 --- a/docker/Dockerfile.thumbv7em-none-eabihf +++ b/docker/Dockerfile.thumbv7em-none-eabihf @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.thumbv7m-none-eabi b/docker/Dockerfile.thumbv7m-none-eabi index 37f1802af..4eed8f027 100644 --- a/docker/Dockerfile.thumbv7m-none-eabi +++ b/docker/Dockerfile.thumbv7m-none-eabi @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf b/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf index 7468bdac4..c26b059c9 100644 --- a/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf +++ b/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.x86_64-pc-windows-gnu b/docker/Dockerfile.x86_64-pc-windows-gnu index 6397e8c7b..d2b2f1620 100644 --- a/docker/Dockerfile.x86_64-pc-windows-gnu +++ b/docker/Dockerfile.x86_64-pc-windows-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.x86_64-sun-solaris b/docker/Dockerfile.x86_64-sun-solaris index 4e766d6d6..a290c31b6 100644 --- a/docker/Dockerfile.x86_64-sun-solaris +++ b/docker/Dockerfile.x86_64-sun-solaris @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.x86_64-unknown-dragonfly b/docker/Dockerfile.x86_64-unknown-dragonfly index 92caa19cf..6a60522ca 100644 --- a/docker/Dockerfile.x86_64-unknown-dragonfly +++ b/docker/Dockerfile.x86_64-unknown-dragonfly @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.x86_64-unknown-freebsd b/docker/Dockerfile.x86_64-unknown-freebsd index 4f53fb297..a3f07e203 100644 --- a/docker/Dockerfile.x86_64-unknown-freebsd +++ b/docker/Dockerfile.x86_64-unknown-freebsd @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.x86_64-unknown-linux-gnu b/docker/Dockerfile.x86_64-unknown-linux-gnu index accb0944b..0dc7340f6 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-gnu +++ b/docker/Dockerfile.x86_64-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/Dockerfile.x86_64-unknown-linux-gnu.centos b/docker/Dockerfile.x86_64-unknown-linux-gnu.centos index acccac373..e16192bf9 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-gnu.centos +++ b/docker/Dockerfile.x86_64-unknown-linux-gnu.centos @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY lib.sh / diff --git a/docker/Dockerfile.x86_64-unknown-netbsd b/docker/Dockerfile.x86_64-unknown-netbsd index f404df3c6..d1c89af8f 100644 --- a/docker/Dockerfile.x86_64-unknown-netbsd +++ b/docker/Dockerfile.x86_64-unknown-netbsd @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/dragonfly.sh b/docker/dragonfly.sh index 167aff4ad..fb040f155 100755 --- a/docker/dragonfly.sh +++ b/docker/dragonfly.sh @@ -10,14 +10,14 @@ main() { local nproc= local binutils=2.32 \ dragonfly=6.0.1_REL \ - gcc=5.3.0 \ + gcc=10.3.0 \ target=x86_64-unknown-dragonfly \ url="https://mirror-master.dragonflybsd.org/iso-images" if [[ $# != "0" ]]; then nproc="${1}" fi - install_packages bsdtar \ + install_packages libarchive-tools \ bzip2 \ ca-certificates \ curl \ @@ -42,47 +42,11 @@ main() { cd gcc sed -i -e 's/ftp:/https:/g' ./contrib/download_prerequisites ./contrib/download_prerequisites - patch -p0 <<'EOF' ---- libatomic/configure.tgt.orig 2015-07-09 16:08:55 UTC -+++ libatomic/configure.tgt -@@ -110,7 +110,7 @@ case "${target}" in - ;; - - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \ -- | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \ -+ | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* \ - | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \ - | *-*-darwin* | *-*-aix* | *-*-cygwin*) - # POSIX system. The OS is supported. -EOF - - patch -p0 <<'EOF' ---- libstdc++-v3/config/os/bsd/dragonfly/os_defines.h.orig 2015-07-09 16:08:54 UTC -+++ libstdc++-v3/config/os/bsd/dragonfly/os_defines.h -@@ -29,4 +29,9 @@ - // System-specific #define, typedefs, corrections, etc, go here. This - // file will come before all others. - -+#define _GLIBCXX_USE_C99_CHECK 1 -+#define _GLIBCXX_USE_C99_DYNAMIC (!(__ISO_C_VISIBLE >= 1999)) -+#define _GLIBCXX_USE_C99_LONG_LONG_CHECK 1 -+#define _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC (_GLIBCXX_USE_C99_DYNAMIC || !defined __LONG_LONG_SUPPORTED) -+ - #endif -EOF - - patch -p0 <<'EOF' ---- libstdc++-v3/configure.orig 2016-05-26 18:34:47.163132921 +0200 -+++ libstdc++-v3/configure 2016-05-26 18:35:29.594590648 +0200 -@@ -52013,7 +52013,7 @@ - - ;; - -- *-freebsd*) -+ *-freebsd* | *-dragonfly*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - - + patch libstdc++-v3/configure <<'EOF' +47159c47159 +< *-freebsd*) +--- +> *-freebsd* | *-dragonfly*) EOF cd .. diff --git a/docker/linux-image.sh b/docker/linux-image.sh index dc85ed45c..f445132a5 100755 --- a/docker/linux-image.sh +++ b/docker/linux-image.sh @@ -6,39 +6,101 @@ set -euo pipefail # shellcheck disable=SC1091 . lib.sh +max_kernel_version() { + # kernel versions have the following format: + # `5.10.0-10-$arch`, where the `$arch` may be optional. + local IFS=$'\n' + local -a versions + local major=0 + local minor=0 + local patch=0 + local release=0 + local index=0 + local version + local x + local y + local z + local r + local is_larger + + read -r -d '' -a versions <<< "$1" + for i in "${!versions[@]}"; do + version="${versions[$i]}" + x=$(echo "$version" | cut -d '.' -f 1) + y=$(echo "$version" | cut -d '.' -f 2) + z=$(echo "$version" | cut -d '.' -f 3 | cut -d '-' -f 1) + r=$(echo "$version" | cut -d '-' -f 2) + is_larger= + + if [ "$x" -gt "$major" ]; then + is_larger=1 + elif [ "$x" -eq "$major" ] && [ "$y" -gt "$minor" ]; then + is_larger=1 + elif [ "$x" -eq "$major" ] && [ "$y" -eq "$minor" ] && [ "$z" -gt "$patch" ]; then + is_larger=1 + elif [ "$x" -eq "$major" ] && [ "$y" -eq "$minor" ] && [ "$z" -eq "$patch" ] && [ "$r" -gt "$release" ]; then + is_larger=1 + fi + + if [ -n "$is_larger" ]; then + index="$i" + major="$x" + minor="$y" + patch="$z" + release="$r" + fi + done + + echo "${versions[index]}" +} + main() { # arch in the rust target local arch="${1}" \ - kversion=4.19.0-20 + kversion=5.10.0-8 - local debsource="deb http://http.debian.net/debian/ buster main" - debsource="${debsource}\ndeb http://security.debian.org/ buster/updates main" + local debsource="deb http://http.debian.net/debian/ bullseye main" + debsource="${debsource}\ndeb http://security.debian.org/ bullseye-security main" local dropbear="dropbear-bin" local -a deps local kernel= - local libgcc="libgcc1" + local libgcc="libgcc-s1" + local ncurses= # select debian arch and kernel version case "${arch}" in aarch64) arch=arm64 kernel="${kversion}-arm64" + deps=(libcrypt1:"${arch}") ;; armv7) arch=armhf - kernel="${kversion}-armmp" + kernel="5.*-armmp" + deps=(libcrypt1:"${arch}") ;; i686) arch=i386 kernel="${kversion}-686" + deps=(libcrypt1:"${arch}") + ;; + mips) + # mips was discontinued in bullseye, so we have to use buster. + libgcc="libgcc1" + debsource="deb http://http.debian.net/debian/ buster main" + debsource="${debsource}\ndeb http://security.debian.org/ buster/updates main" + kernel="4.*-4kc-malta" + ncurses="=6.1*" ;; - mips|mipsel) - kernel="${kversion}-4kc-malta" + mipsel) + kernel="5.*-4kc-malta" + deps=(libcrypt1:"${arch}") ;; mips64el) - kernel="${kversion}-5kc-malta" + kernel="5.*-5kc-malta" + deps=(libcrypt1:"${arch}") ;; powerpc) # there is no buster powerpc port, so we use jessie @@ -61,9 +123,7 @@ main() { # there is no stable port arch=ppc64 # https://packages.debian.org/en/sid/linux-image-powerpc64 - kversion='5.*' - kernel="${kversion}-powerpc64" - libgcc="libgcc-s1" + kernel='5.*-powerpc64' debsource="deb http://ftp.ports.debian.org/debian-ports unstable main" debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main" # sid version of dropbear requires these dependencies @@ -71,17 +131,18 @@ main() { ;; powerpc64le) arch=ppc64el - kernel="${kversion}-powerpc64le" + kernel="5.*-powerpc64le" + deps=(libcrypt1:"${arch}") ;; s390x) arch=s390x - kernel="${kversion}-s390x" + kernel="5.*-s390x" + deps=(libcrypt1:"${arch}") ;; sparc64) # there is no stable port # https://packages.debian.org/en/sid/linux-image-sparc64 - kernel='*-sparc64' - libgcc="libgcc-s1" + kernel='5.*-sparc64' debsource="deb http://ftp.ports.debian.org/debian-ports unstable main" debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main" # sid version of dropbear requires these dependencies @@ -90,6 +151,7 @@ main() { x86_64) arch=amd64 kernel="${kversion}-amd64" + deps=(libcrypt1:"${arch}") ;; *) echo "Invalid arch: ${arch}" @@ -103,6 +165,19 @@ main() { sharutils \ gnupg + # amd64 has conflicting versions of the packages installed, so + # we need to remove the system installs later. since apt relies + # on these packages, we need to download them and reinstall + # using dpkg later, since we cannot redownload via apt. + local libgcc_packages=("${libgcc}:${arch}" "libstdc++6:${arch}") + if [[ "${arch}" == "amd64" ]]; then + local libgcc_root=/qemu/libgcc + mkdir -p "${libgcc_root}" + pushd "${libgcc_root}" + apt-get -d --no-install-recommends download "${libgcc_packages[@]}" + popd + fi + # Download packages mv /etc/apt/sources.list /etc/apt/sources.list.bak echo -e "${debsource}" > /etc/apt/sources.list @@ -132,6 +207,20 @@ main() { mkdir -p "/qemu/${arch}" chmod 777 /qemu "/qemu/${arch}" + # Need to limit the kernel version and select the best version + # if we have a wildcard. This is because some matches, such as + # `linux-image-4.*-4kc-malta` can match more than 1 package, + # which will prevent further steps from working. + if [[ "$kernel" == *'*'* ]]; then + # Need an exact match for start and end, to avoid debug kernels. + # Afterwards, need to do a complex sort for the best kernel version, + # since the sort is non-trivial and must extract subcomponents. + packages=$(apt-cache search ^linux-image-"$kernel$" --names-only) + names=$(echo "$packages" | cut -d ' ' -f 1) + kversions="${names//linux-image-/}" + kernel=$(max_kernel_version "$kversions") + fi + cd "/qemu/${arch}" apt-get -d --no-install-recommends download \ ${deps[@]+"${deps[@]}"} \ @@ -141,11 +230,40 @@ main() { "libtomcrypt1:${arch}" \ "libgmp10:${arch}" \ "libc6:${arch}" \ - "${libgcc}:${arch}" \ - "libstdc++6:${arch}" \ "linux-image-${kernel}:${arch}" \ - ncurses-base \ + ncurses-base"${ncurses}" \ "zlib1g:${arch}" + + if [[ "${arch}" != "amd64" ]]; then + apt-get -d --no-install-recommends download "${libgcc_packages[@]}" + else + # amd64 has conflicting versions of the packages installed + # this prevents us from downloading them, so we need to + # simply grab the last version from the debian sources. + # we're search for a paragraph with: + # Maintainer: Debian + # but not + # Original-Maintainer: Debian + # + # then, we extract the version record and download **only** + # packages matching that specific version. + local version_info + local version_record + local version + for package in "${libgcc_packages[@]}"; do + version_info=$(apt-cache show "${package}") + version_record=$(echo "${version_info}" | perl -n00e 'print if /^Maintainer: Debian/m') + version=$(echo "${version_record}" | grep 'Version: ' | cut -d ' ' -f 2) + apt-get -d --no-install-recommends download "${package}=${version}" + done + + # now, if we don't remove the system installs, qemu-system won't + # be able to find these libgcc packages after building, since it + # will prefer the system packages, which it can't find later. + # removing these packages needs to occur after download via apt, + # since apt-get relies on libgcc_s1 and libstdc++6. + dpkg -r --force-depends "${libgcc_packages[@]}" + fi cd /qemu # Install packages @@ -256,6 +374,14 @@ EOF find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz cd - + if [[ "${arch}" == "amd64" ]]; then + # need to reinstall these packages, since basic utilities rely on them. + pushd "${libgcc_root}" + dpkg -i --force-depends "${libgcc_root}"/*.deb + popd + rm -rf "${libgcc_root}" + fi + # Clean up rm -rf "/qemu/${root}" "/qemu/${arch}" mv -f /etc/apt/sources.list.bak /etc/apt/sources.list @@ -266,6 +392,11 @@ EOF dpkg --remove-architecture "${arch}" || true apt-get update + # need to reinstall the removed libgcc packages, which are required for apt + if [[ "${arch}" == "amd64" ]]; then + apt-get install --no-install-recommends --assume-yes "${packages[@]}" + fi + purge_packages ls -lh /qemu diff --git a/docker/mingw.sh b/docker/mingw.sh index 7d8815cba..92d6ddd9e 100755 --- a/docker/mingw.sh +++ b/docker/mingw.sh @@ -34,7 +34,7 @@ main() { pushd gcc-mingw-w64-* # We are using dwarf exceptions instead of sjlj - sed -i -e 's/libgcc_s_sjlj-1/libgcc_s_dw2-1/g' debian/gcc-mingw-w64-i686.install + sed -i -e 's/libgcc_s_sjlj-1/libgcc_s_dw2-1/g' debian/gcc-mingw-w64-i686.install.in # Only build i686 packages (disable x86_64) patch -p0 <<'EOF' @@ -96,7 +96,7 @@ EOF threads := posix win32 # Hardening on the host, none on the target -@@ -216,6 +216,10 @@ +@@ -220,6 +220,10 @@ # Enable libatomic CONFFLAGS += \ --enable-libatomic @@ -104,11 +104,16 @@ EOF +CONFFLAGS += \ + --disable-sjlj-exceptions \ + --with-dwarf2 - # Enable experimental::filesystem + # Enable experimental::filesystem and std::filesystem CONFFLAGS += \ --enable-libstdcxx-filesystem-ts=yes EOF + # Need symlinks for specific autoconf versions, since it + # attempts to use autoconf2.69 and autom4te2.69. + ln -s /usr/bin/autoconf /usr/bin/autoconf2.69 + ln -s /usr/bin/autom4te /usr/bin/autom4te2.69 + # Build the modified mingw packages MAKEFLAGS=--silent dpkg-buildpackage -nc -B --jobs=auto @@ -122,6 +127,10 @@ EOF rm -rf "${td}" rm "${0}" + + # Unlink our temporary aliases + unlink /usr/bin/autoconf2.69 + unlink /usr/bin/autom4te2.69 } main "${@}" diff --git a/docker/solaris.sh b/docker/solaris.sh index ac51a6a7b..bb59a2e1c 100755 --- a/docker/solaris.sh +++ b/docker/solaris.sh @@ -16,7 +16,9 @@ main() { install_packages bzip2 \ ca-certificates \ curl \ + dirmngr \ g++ \ + gpg-agent \ make \ patch \ software-properties-common \ diff --git a/src/docker/shared.rs b/src/docker/shared.rs index 7e1459b93..9f76257a3 100644 --- a/src/docker/shared.rs +++ b/src/docker/shared.rs @@ -25,7 +25,7 @@ pub use super::custom::CROSS_CUSTOM_DOCKERFILE_IMAGE_PREFIX; pub const CROSS_IMAGE: &str = "ghcr.io/cross-rs"; // note: this is the most common base image for our images -pub const UBUNTU_BASE: &str = "ubuntu:16.04"; +pub const UBUNTU_BASE: &str = "ubuntu:20.04"; // secured profile based off the docker documentation for denied syscalls: // https://docs.docker.com/engine/security/seccomp/#significant-syscalls-blocked-by-the-default-profile From ec050a3b39ee469d12833a85f27813113518e1ba Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Sat, 16 Jul 2022 13:34:16 -0500 Subject: [PATCH 2/2] Remove Linux image from `mips-unknown-linux-gnu`. --- .changes/591.json | 19 +++++++++++++------ .github/workflows/ci.yml | 2 +- docker/Dockerfile.mips-unknown-linux-gnu | 12 +++--------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.changes/591.json b/.changes/591.json index 1f989b4bc..83b03cab3 100644 --- a/.changes/591.json +++ b/.changes/591.json @@ -1,6 +1,13 @@ -{ - "description": "Update Ubuntu images to 20.04 LTS.", - "type": "changed", - "breaking": true, - "issues": [417, 517, 556, 616] -} +[ + { + "description": "update Ubuntu images to 20.04 LTS.", + "type": "changed", + "breaking": true, + "issues": [417, 517, 556, 616] + }, + { + "description": "remove Linux image from `mips-unknown-linux-gnu`.", + "type": "removed", + "breaking": true + } +] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b06415283..f446bd085 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -163,7 +163,7 @@ jobs: - { target: thumbv7neon-unknown-linux-gnueabihf, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system } - { target: i586-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1 } - { target: i686-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: native qemu-user qemu-system } - - { target: mips-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system } + - { target: mips-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user } - { target: mipsel-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system } - { target: mips64-unknown-linux-gnuabi64, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1 } - { target: mips64el-unknown-linux-gnuabi64, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system } diff --git a/docker/Dockerfile.mips-unknown-linux-gnu b/docker/Dockerfile.mips-unknown-linux-gnu index 36bb118d8..d6c27dc70 100644 --- a/docker/Dockerfile.mips-unknown-linux-gnu +++ b/docker/Dockerfile.mips-unknown-linux-gnu @@ -15,18 +15,12 @@ RUN apt-get install --assume-yes --no-install-recommends \ libc6-dev-mips-cross COPY qemu.sh / -RUN /qemu.sh mips softmmu +RUN /qemu.sh mips -COPY dropbear.sh / -RUN /dropbear.sh - -COPY linux-image.sh / -RUN /linux-image.sh mips - -COPY linux-runner / +COPY qemu-runner / ENV CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc \ - CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_RUNNER="/linux-runner mips" \ + CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_RUNNER="/qemu-runner mips" \ CC_mips_unknown_linux_gnu=mips-linux-gnu-gcc \ CXX_mips_unknown_linux_gnu=mips-linux-gnu-g++ \ BINDGEN_EXTRA_CLANG_ARGS_mips_unknown_linux_gnu="--sysroot=/usr/mips-linux-gnu" \