From 3ed5229eb6557ca72ba4de11b139b9d2c329078c Mon Sep 17 00:00:00 2001 From: Justin W Smith Date: Wed, 29 May 2024 13:49:19 +0000 Subject: [PATCH] Support cross build with aws-lc-rs --- Cross.toml | 38 +++-------------------------------- docker/linux-cross/Dockerfile | 11 ++++++++++ 2 files changed, 14 insertions(+), 35 deletions(-) create mode 100644 docker/linux-cross/Dockerfile diff --git a/Cross.toml b/Cross.toml index aafcef55cff4..3035805387f2 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,45 +1,13 @@ [build] +dockerfile = "./docker/linux-cross/Dockerfile" pre-build = [ - # https://aws.github.io/aws-lc-rs/requirements/linux.html - "apt-get update", - "apt-get install --assume-yes llvm-5.0-dev libclang-5.0-dev clang-5.0", "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable", ". $HOME/.cargo/env", "cargo install --force --locked bindgen-cli && mv $HOME/.cargo/bin/bindgen /usr/bin", - "rustup self uninstall -y", + "rm -rf $HOME/.cargo" ] + [build.env] passthrough = ["RUSTFLAGS"] -[target.x86_64-pc-windows-gnu] -pre-build = [ - # Install NASM for rustls, which deps on aws-lc-rs by default, and it needs NASM - "apt-get update", - "apt-get install --assume-yes llvm-5.0-dev libclang-5.0-dev clang-5.0 nasm", - "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable", - ". $HOME/.cargo/env", - "cargo install --force --locked bindgen-cli && mv $HOME/.cargo/bin/bindgen /usr/bin", - "rustup self uninstall -y", -] - -[target.aarch64-unknown-linux-gnu] -pre-build = [] - -[target.aarch64-unknown-linux-musl] -pre-build = [] - -[target.x86_64-unknown-linux-gnu] -pre-build = [] - -[target.x86_64-unknown-linux-musl] -pre-build = [] - -[target.i686-unknown-linux-gnu] -pre-build = [] - -[target.aarch64-apple-darwin] -pre-build = [] - -[target.x86_64-apple-darwin] -pre-build = [] diff --git a/docker/linux-cross/Dockerfile b/docker/linux-cross/Dockerfile new file mode 100644 index 000000000000..d17c46cb8875 --- /dev/null +++ b/docker/linux-cross/Dockerfile @@ -0,0 +1,11 @@ +ARG CROSS_BASE_IMAGE +FROM $CROSS_BASE_IMAGE + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install --assume-yes --no-install-recommends build-essential cmake nasm llvm-dev libclang-dev clang && \ + git config --global --add safe.directory '*' && \ + rm -rf /tmp/* + +ENV GOCACHE=/tmp