Skip to content

Commit

Permalink
Use stable toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
james58899 committed Mar 16, 2024
1 parent 56bb0ff commit 5104c98
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,14 @@ jobs:
strategy:
matrix:
target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu", "armv7-unknown-linux-gnueabihf"]
env:
CC: clang-18
CXX: clang-18
CFLAGS: "-flto -fuse-ld=lld-18"
CXXFLAGS: "-flto -fuse-ld=lld-18"
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
sudo apt-get install -y crossbuild-essential-arm64 crossbuild-essential-armhf
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get install -y crossbuild-essential-arm64 crossbuild-essential-armhf clang-17 lld-17
- uses: actions/cache@v4
with:
path: |
Expand All @@ -55,16 +50,19 @@ jobs:
- name: Install toolchain
run: |
rustup update
rustup toolchain install nightly
rustup target add --toolchain nightly ${{ matrix.target }}
rustup target add ${{ matrix.target }}
- name: Build
env:
CARGO_HOST_LINKER: "clang-18"
CARGO_HOST_RUSTFLAGS: "-Clink-arg=-fuse-ld=lld-18"
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-18 -Clink-arg=-fuse-ld=lld-18 -Clink-arg=--target=x86_64-unknown-linux-gnu"
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-18 -Clink-arg=-fuse-ld=lld-18 -Clink-arg=--target=aarch64-unknown-linux-gnu"
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-18 -Clink-arg=-fuse-ld=lld-18 -Clink-arg=--target=armv7-unknown-linux-gnueabihf"
run: cargo +nightly -Ztarget-applies-to-host -Zhost-config build --verbose --release --target=${{ matrix.target }}
CC: clang-17
CXX: clang-17
CFLAGS: "-flto -fuse-ld=lld-17"
CXXFLAGS: "-flto -fuse-ld=lld-17"
__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS: "nightly"
CARGO_HOST_RUSTFLAGS: "-Clinker=clang-17 -Clink-arg=-fuse-ld=lld-17"
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-17 -Clink-arg=-fuse-ld=lld-17 -Clink-arg=--target=x86_64-unknown-linux-gnu"
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-17 -Clink-arg=-fuse-ld=lld-17 -Clink-arg=--target=aarch64-unknown-linux-gnu"
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-17 -Clink-arg=-fuse-ld=lld-17 -Clink-arg=--target=armv7-unknown-linux-gnueabihf"
run: cargo -Ztarget-applies-to-host -Zhost-config build --verbose --release --target=${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: hath-rust-${{ matrix.target }}
Expand Down

0 comments on commit 5104c98

Please sign in to comment.