Skip to content

Commit 2acbaed

Browse files
justsmthzonyitoo
authored andcommitted
Support cross build with aws-lc-rs
1 parent 7de93f7 commit 2acbaed

File tree

2 files changed

+14
-35
lines changed

2 files changed

+14
-35
lines changed

Cross.toml

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,13 @@
11
[build]
2+
dockerfile = "./docker/linux-cross/Dockerfile"
23
pre-build = [
3-
# https://aws.github.io/aws-lc-rs/requirements/linux.html
4-
"apt-get update",
5-
"apt-get install --assume-yes llvm-5.0-dev libclang-5.0-dev clang-5.0",
64
"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable",
75
". $HOME/.cargo/env",
86
"cargo install --force --locked bindgen-cli && mv $HOME/.cargo/bin/bindgen /usr/bin",
9-
"rustup self uninstall -y",
7+
"rm -rf $HOME/.cargo"
108
]
119

10+
1211
[build.env]
1312
passthrough = ["RUSTFLAGS"]
1413

15-
[target.x86_64-pc-windows-gnu]
16-
pre-build = [
17-
# Install NASM for rustls, which deps on aws-lc-rs by default, and it needs NASM
18-
"apt-get update",
19-
"apt-get install --assume-yes llvm-5.0-dev libclang-5.0-dev clang-5.0 nasm",
20-
"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable",
21-
". $HOME/.cargo/env",
22-
"cargo install --force --locked bindgen-cli && mv $HOME/.cargo/bin/bindgen /usr/bin",
23-
"rustup self uninstall -y",
24-
]
25-
26-
[target.aarch64-unknown-linux-gnu]
27-
pre-build = []
28-
29-
[target.aarch64-unknown-linux-musl]
30-
pre-build = []
31-
32-
[target.x86_64-unknown-linux-gnu]
33-
pre-build = []
34-
35-
[target.x86_64-unknown-linux-musl]
36-
pre-build = []
37-
38-
[target.i686-unknown-linux-gnu]
39-
pre-build = []
40-
41-
[target.aarch64-apple-darwin]
42-
pre-build = []
43-
44-
[target.x86_64-apple-darwin]
45-
pre-build = []

docker/linux-cross/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ARG CROSS_BASE_IMAGE
2+
FROM $CROSS_BASE_IMAGE
3+
4+
ARG DEBIAN_FRONTEND=noninteractive
5+
6+
RUN apt-get update && \
7+
apt-get install --assume-yes --no-install-recommends build-essential cmake nasm llvm-dev libclang-dev clang && \
8+
git config --global --add safe.directory '*' && \
9+
rm -rf /tmp/*
10+
11+
ENV GOCACHE=/tmp

0 commit comments

Comments
 (0)