Skip to content

Commit

Permalink
feat: passing -Z directly to cross, enables mips-*-musl* targets
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Nov 25, 2024
1 parent 796a190 commit c80d317
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 20 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/build-nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,22 @@ jobs:
toolchain: stable
- target: aarch64-unknown-linux-musl
toolchain: stable
- target: mips-unknown-linux-gnu
toolchain: nightly
- target: mipsel-unknown-linux-musl
toolchain: nightly
- target: mipsel-unknown-linux-gnu
toolchain: nightly
- target: mipsel-unknown-linux-musl
toolchain: nightly
- target: mips64-unknown-linux-gnuabi64
toolchain: nightly
- target: mips64-unknown-linux-muslabi64
toolchain: nightly
- target: mips64el-unknown-linux-gnuabi64
toolchain: nightly
- target: mips64el-unknown-linux-muslabi64
toolchain: nightly

steps:
- uses: actions/checkout@v4
Expand All @@ -34,7 +48,7 @@ jobs:
rustup override set ${{ matrix.platform.toolchain }}
- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross.git
run: cargo install cross

- name: Build ${{ matrix.platform.target }}
timeout-minutes: 120
Expand All @@ -61,10 +75,11 @@ jobs:
fi
compile_nightly="-n"
compile_features="-Z build-std=std,panic_abort,proc_macro"
fi
cd build
./build-release -t ${{ matrix.platform.target }} $compile_features $compile_compress $compile_nightly
./build-release -t ${{ matrix.platform.target }} $compile_features $compile_compress $compile_nightly $compile_features
- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,20 @@ jobs:
toolchain: stable
- target: mips-unknown-linux-gnu
toolchain: nightly
- target: mipsel-unknown-linux-musl
toolchain: nightly
- target: mipsel-unknown-linux-gnu
toolchain: nightly
- target: mipsel-unknown-linux-musl
toolchain: nightly
- target: mips64-unknown-linux-gnuabi64
toolchain: nightly
- target: mips64-unknown-linux-muslabi64
toolchain: nightly
- target: mips64el-unknown-linux-gnuabi64
toolchain: nightly
- target: mips64el-unknown-linux-muslabi64
toolchain: nightly

steps:
- uses: actions/checkout@v4
Expand All @@ -66,7 +74,7 @@ jobs:
rustup override set ${{ matrix.platform.toolchain }}
- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross.git
run: cargo install cross

- name: Build ${{ matrix.platform.target }}
timeout-minutes: 120
Expand All @@ -86,10 +94,11 @@ jobs:
fi
compile_nightly="-n"
compile_features="-Z build-std=std,panic_abort,proc_macro"
fi
cd build
./build-release -t ${{ matrix.platform.target }} $compile_features $compile_compress $compile_nightly
./build-release -t ${{ matrix.platform.target }} $compile_features $compile_compress $compile_nightly $compile_features
- name: Upload Github Assets
uses: softprops/action-gh-release@v2
Expand Down
33 changes: 17 additions & 16 deletions Cross.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ passthrough = ["RUSTFLAGS"]

# MIPS targets are dropped to Tier 3
# https://github.com/rust-lang/compiler-team/issues/648
[target.mips-unknown-linux-gnu]
build-std = ["std", "panic_abort", "proc_macro"]
[target.mips-unknown-linux-musl]
build-std = ["std", "panic_abort", "proc_macro"]
[target.mips64-unknown-linux-gnuabi64]
build-std = ["std", "panic_abort", "proc_macro"]
[target.mips64-unknown-linux-muslabi64]
build-std = ["std", "panic_abort", "proc_macro"]
[target.mips64el-unknown-linux-gnuabi64]
build-std = ["std", "panic_abort", "proc_macro"]
[target.mips64el-unknown-linux-muslabi64]
build-std = ["std", "panic_abort", "proc_macro"]
[target.mipsel-unknown-linux-gnu]
build-std = ["std", "panic_abort", "proc_macro"]
[target.mipsel-unknown-linux-musl]
build-std = ["std", "panic_abort", "proc_macro"]
# FIXME: build-std with sequence is supported only on git
# [target.mips-unknown-linux-gnu]
# build-std = ["std", "panic_abort", "proc_macro"]
# [target.mips-unknown-linux-musl]
# build-std = ["std", "panic_abort", "proc_macro"]
# [target.mips64-unknown-linux-gnuabi64]
# build-std = ["std", "panic_abort", "proc_macro"]
# [target.mips64-unknown-linux-muslabi64]
# build-std = ["std", "panic_abort", "proc_macro"]
# [target.mips64el-unknown-linux-gnuabi64]
# build-std = ["std", "panic_abort", "proc_macro"]
# [target.mips64el-unknown-linux-muslabi64]
# build-std = ["std", "panic_abort", "proc_macro"]
# [target.mipsel-unknown-linux-gnu]
# build-std = ["std", "panic_abort", "proc_macro"]
# [target.mipsel-unknown-linux-musl]
# build-std = ["std", "panic_abort", "proc_macro"]

0 comments on commit c80d317

Please sign in to comment.