File tree Expand file tree Collapse file tree 4 files changed +83
-1
lines changed
Expand file tree Collapse file tree 4 files changed +83
-1
lines changed Original file line number Diff line number Diff line change 2424 contents : read
2525 steps :
2626 - uses : actions/checkout@v4
27+ - name : Install build dependencies
28+ run : |
29+ sudo apt-get update
30+ sudo apt-get install -y \
31+ build-essential \
32+ pkg-config \
33+ libssl-dev \
34+ libclang-dev \
35+ clang \
36+ llvm-dev \
37+ gcc-multilib \
38+ g++-multilib
2739 - uses : dtolnay/rust-toolchain@stable
2840 - uses : Swatinem/rust-cache@v2
2941 with :
3749 docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64
3850 docker buildx create --use --name cross-builder
3951 - name : Build and push image
40- run : make docker-build-push
52+ run : |
53+ export LIBCLANG_PATH=/usr/lib/llvm-18/lib
54+ export BINDGEN_EXTRA_CLANG_ARGS="-I/usr/include"
55+ export CC_x86_64_unknown_linux_gnu=x86_64-linux-gnu-gcc
56+ export CXX_x86_64_unknown_linux_gnu=x86_64-linux-gnu-g++
57+ export AR_x86_64_unknown_linux_gnu=x86_64-linux-gnu-ar
58+ export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc
59+ export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
60+ export AR_aarch64_unknown_linux_gnu=aarch64-linux-gnu-ar
61+ export PKG_CONFIG_ALLOW_CROSS=1
62+ make docker-build-push
Original file line number Diff line number Diff line change 1+ [build ]
2+ # Custom Docker images with proper build environment for native dependencies
3+
4+ [target .x86_64-unknown-linux-gnu ]
5+ dockerfile = " Dockerfile.cross-x86_64"
6+
7+ [target .aarch64-unknown-linux-gnu ]
8+ dockerfile = " Dockerfile.cross-aarch64"
9+
10+ [build .env ]
11+ passthrough = [
12+ " RUST_LOG" ,
13+ " CARGO_TERM_COLOR" ,
14+ ]
Original file line number Diff line number Diff line change 1+ FROM ghcr.io/cross-rs/cross:main
2+
3+ # Install ARM64 cross-compilation toolchain
4+ RUN apt-get update && \
5+ apt-get install -y \
6+ gcc-aarch64-linux-gnu \
7+ g++-aarch64-linux-gnu \
8+ libc6-dev-arm64-cross \
9+ pkg-config-aarch64-linux-gnu \
10+ build-essential \
11+ clang \
12+ libclang-dev && \
13+ rm -rf /var/lib/apt/lists/*
14+
15+ # Set up environment variables for ARM64 cross-compilation
16+ # Keep host compiler for build scripts, only set target-specific variables
17+ ENV CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc
18+ ENV CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
19+ ENV AR_aarch64_unknown_linux_gnu=aarch64-linux-gnu-ar
20+ ENV STRIP_aarch64_unknown_linux_gnu=aarch64-linux-gnu-strip
21+ ENV PKG_CONFIG_aarch64_unknown_linux_gnu=aarch64-linux-gnu-pkg-config
22+ ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
23+ ENV BINDGEN_EXTRA_CLANG_ARGS="-I/usr/aarch64-linux-gnu/include -I/usr/include"
24+ ENV CFLAGS_aarch64_unknown_linux_gnu="-I/usr/aarch64-linux-gnu/include -I/usr/include"
25+ ENV CPPFLAGS_aarch64_unknown_linux_gnu="-I/usr/aarch64-linux-gnu/include -I/usr/include"
26+ ENV JEMALLOC_SYS_WITH_LG_PAGE=16
27+ ENV PKG_CONFIG_ALLOW_CROSS=1
Original file line number Diff line number Diff line change 1+ FROM ghcr.io/cross-rs/cross:main
2+
3+ # Install additional build tools and headers
4+ RUN apt-get update && \
5+ apt-get install -y \
6+ build-essential \
7+ pkg-config \
8+ libclang-dev \
9+ clang && \
10+ rm -rf /var/lib/apt/lists/*
11+
12+ # Set up environment variables for x86_64 cross-compilation
13+ ENV CC_x86_64_unknown_linux_gnu=x86_64-linux-gnu-gcc
14+ ENV CXX_x86_64_unknown_linux_gnu=x86_64-linux-gnu-g++
15+ ENV AR_x86_64_unknown_linux_gnu=x86_64-linux-gnu-ar
16+ ENV STRIP_x86_64_unknown_linux_gnu=x86_64-linux-gnu-strip
17+ ENV BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_linux_gnu="-I/usr/include -I/usr/include/x86_64-linux-gnu"
18+ ENV CFLAGS_x86_64_unknown_linux_gnu="-I/usr/include -I/usr/include/x86_64-linux-gnu"
19+ ENV CPPFLAGS_x86_64_unknown_linux_gnu="-I/usr/include -I/usr/include/x86_64-linux-gnu"
You can’t perform that action at this time.
0 commit comments