diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile.amd64 similarity index 100% rename from .devcontainer/Dockerfile rename to .devcontainer/Dockerfile.amd64 diff --git a/.devcontainer/Dockerfile.arm64 b/.devcontainer/Dockerfile.arm64 new file mode 100644 index 0000000000..2666138ee0 --- /dev/null +++ b/.devcontainer/Dockerfile.arm64 @@ -0,0 +1,27 @@ +FROM mcr.microsoft.com/devcontainers/rust:dev-1-bookworm +RUN dpkg --add-architecture amd64 \ + && sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/* \ + && apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get install -y --no-install-recommends \ + libaom-dev libdav1d-dev libaom-dev:amd64 libdav1d-dev:amd64 \ + libclang-dev libgit2-dev libcurl4-openssl-dev libfuzzer-14-dev \ + gcc-x86-64-linux-gnu libc6-dev-amd64-cross nasm dav1d qemu-user \ + meson ninja-build \ + && rm -rf /var/lib/apt/lists/* \ + && sed -i '304s/union/& aom_codec_cfg/' /usr/include/aom/aom_codec.h \ + && sed -i '122s/union/& aom_pkt_union/' /usr/include/aom/aom_encoder.h \ + && sed -i '122s/struct/& aom_frame_pkt/' /usr/include/aom/aom_encoder.h +RUN rustup target add x86_64-unknown-linux-gnu +RUN export CARGO_PROFILE_RELEASE_STRIP=true \ + && cargo install -q cargo-c --version "0.9.27+cargo-0.74.0" \ + && cargo install -q cargo-criterion --version "1.1.0" \ + && cargo install -q cargo-fuzz --version "0.11.2" \ + && rm -rf /usr/local/cargo/registry +ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=qemu-x86_64 +ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS=-Clinker=x86_64-linux-gnu-gcc +ENV PKG_CONFIG_ALLOW_CROSS_x86_64_unknown_linux_gnu=1 +ENV PKG_CONFIG_PATH_x86_64_unknown_linux_gnu=/usr/lib/x64_64-linux-gnu/pkgconfig +ENV PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu=/ +ENV CUSTOM_LIBFUZZER_PATH=/usr/lib/llvm-14/lib/libFuzzer.a +LABEL dev.containers.source=https://github.com/xiph/rav1e +LABEL dev.containers.id=rav1e \ No newline at end of file diff --git a/.devcontainer/build.json b/.devcontainer/build-amd64.json similarity index 58% rename from .devcontainer/build.json rename to .devcontainer/build-amd64.json index 5875b1e3dc..28c69077f8 100644 --- a/.devcontainer/build.json +++ b/.devcontainer/build-amd64.json @@ -1,6 +1,6 @@ { "name": "rav1e-devcontainer", "build": { - "dockerfile": "Dockerfile" + "dockerfile": "Dockerfile.amd64" } } \ No newline at end of file diff --git a/.devcontainer/build-arm64.json b/.devcontainer/build-arm64.json new file mode 100644 index 0000000000..25f4517f15 --- /dev/null +++ b/.devcontainer/build-arm64.json @@ -0,0 +1,6 @@ +{ + "name": "rav1e-devcontainer", + "build": { + "dockerfile": "Dockerfile.arm64" + } +} \ No newline at end of file diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index f5f47b1e61..41d425debe 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -28,5 +28,11 @@ jobs: IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME VERSION=latest IMAGE_TAG=${IMAGE_ID,,}:$VERSION - devcontainer build --image-name $IMAGE_TAG --push \ - --workspace-folder $PWD --config .devcontainer/build.json \ No newline at end of file + devcontainer build --image-name $IMAGE_TAG-amd64 --platform linux/amd64 --push \ + --workspace-folder $PWD --config .devcontainer/build-amd64.json + devcontainer build --image-name $IMAGE_TAG-arm64 --platform linux/arm64 --push \ + --workspace-folder $PWD --config .devcontainer/build-arm64.json + docker manifest create $IMAGE_TAG \ + --amend $IMAGE_TAG-amd64 \ + --amend $IMAGE_TAG-arm64 + docker push $IMAGE_TAG \ No newline at end of file