-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(fix): try to fix cross compilation workflow
- removed Cross.toml - add custom Dockerfile - change workflow to build with custom Dockerfile
- Loading branch information
1 parent
44f005c
commit 820c5c7
Showing
3 changed files
with
95 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# 使用 ubuntu:latest 作为基础镜像 | ||
FROM ubuntu:latest | ||
|
||
# 避免在构建过程中出现交互式提示 | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# 安装必要的软件包和交叉编译工具链 | ||
RUN apt-get update && apt-get install -y \ | ||
software-properties-common \ | ||
&& add-apt-repository ppa:ubuntu-toolchain-r/test \ | ||
&& apt-get update && apt-get install -y \ | ||
build-essential \ | ||
curl \ | ||
git \ | ||
libssl-dev \ | ||
pkg-config \ | ||
cmake \ | ||
gcc-14 \ | ||
g++-14 \ | ||
gcc-14-aarch64-linux-gnu \ | ||
g++-14-aarch64-linux-gnu \ | ||
gcc-14-arm-linux-gnueabihf \ | ||
g++-14-arm-linux-gnueabihf \ | ||
gcc-14-riscv64-linux-gnu \ | ||
g++-14-riscv64-linux-gnu \ | ||
gcc-14-powerpc64-linux-gnu \ | ||
g++-14-powerpc64-linux-gnu \ | ||
gcc-14-i686-linux-gnu \ | ||
g++-14-i686-linux-gnu \ | ||
libc6-dev-i386 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# 设置 GCC 14 为默认版本 | ||
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 \ | ||
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 | ||
|
||
WORKDIR /root | ||
|
||
# 安装 Rust | ||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly | ||
|
||
# 将 Rust 二进制文件添加到 PATH | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# 添加所有目标架构 | ||
RUN rustup target add \ | ||
x86_64-unknown-linux-gnu \ | ||
i686-unknown-linux-gnu \ | ||
aarch64-unknown-linux-gnu \ | ||
armv7-unknown-linux-gnueabihf \ | ||
riscv64gc-unknown-linux-gnu \ | ||
powerpc64-unknown-linux-gnu | ||
|
||
# 配置 Cargo 以使用正确的链接器 | ||
RUN mkdir -p ~/.cargo && echo '\ | ||
[target.aarch64-unknown-linux-gnu]\n\ | ||
linker = "aarch64-linux-gnu-gcc-14"\n\ | ||
[target.armv7-unknown-linux-gnueabihf]\n\ | ||
linker = "arm-linux-gnueabihf-gcc-14"\n\ | ||
[target.riscv64gc-unknown-linux-gnu]\n\ | ||
linker = "riscv64-linux-gnu-gcc-14"\n\ | ||
[target.powerpc64-unknown-linux-gnu]\n\ | ||
linker = "powerpc64-linux-gnu-gcc-14"\n\ | ||
[target.i686-unknown-linux-gnu]\n\ | ||
linker = "i686-linux-gnu-gcc-14"' > ~/.cargo/config.toml | ||
|
||
# 设置默认命令 | ||
CMD ["/bin/bash"] |