Skip to content

Commit f0bff65

Browse files
committed
Fix mips build.
As mips is a tier-3 target, it can only be built using the nightly toolchain. Because of the latest changes, we need to update the nightly toolchain. However, the latest toolchain does not play nicely with cargo-cross 0.2.5. This problem has been solved, but not yet released which is why we install it using dev-dependencies.
1 parent 75d824a commit f0bff65

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ jobs:
6767
~/.cargo/git/db/
6868
target/
6969
key: ${{ runner.os }}-cargo-dist-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
70+
-
71+
name: Install dev dependencies
72+
run: nix-shell --command "make dev-dependencies"
7073
-
7174
name: Build distributables
7275
run: nix-shell --command "make dist-${{ matrix.target }}"

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ build-armv7-unknown-linux-musleabihf:
2323

2424
build-mips-unknown-linux-musl:
2525
# mips is a tier-3 target.
26-
rustup toolchain add nightly-2024-05-17-x86_64-unknown-linux-gnu
27-
cross +nightly-2024-05-17 build -Z build-std=panic_abort,std --target mips-unknown-linux-musl --release
26+
rustup toolchain add nightly-2025-02-14-x86_64-unknown-linux-gnu
27+
cross +nightly-2025-02-14 build -Z build-std=panic_abort,std --target mips-unknown-linux-musl --release
2828

2929
build-mipsel-unknown-linux-musl:
3030
# mipsel is a tier-3 target.
31-
rustup toolchain add nightly-2024-05-17-x86_64-unknown-linux-gnu
32-
cross +nightly-2024-05-17 build -Z build-std=panic_abort,std --target mipsel-unknown-linux-musl --release
31+
rustup toolchain add nightly-2025-02-14-x86_64-unknown-linux-gnu
32+
cross +nightly-2025-02-14 build -Z build-std=panic_abort,std --target mipsel-unknown-linux-musl --release
3333

3434
# Build distributable binaries for all targets.
3535
dist: \
@@ -121,3 +121,7 @@ test:
121121
# Enter the devshell.
122122
devshell:
123123
nix-shell
124+
125+
# Dependencies
126+
dev-dependencies:
127+
cargo install cross --git https://github.com/cross-rs/cross --rev c7dee4d008475ce1c140773cbcd6078f4b86c2aa --locked

shell.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ pkgs.mkShell {
66
pkgs.protobuf
77
pkgs.opkg-utils
88
pkgs.jq
9-
pkgs.cargo-cross
9+
# cargo-cross can be used once version > 0.2.5, as 0.2.5 does not work well
10+
# with nightly toolchain. It is for now installed through make dev-dependencies.
11+
# pkgs.cargo-cross
1012
pkgs.cargo-deb
1113
];
14+
shellHook = ''
15+
export PATH=$PATH:~/.cargo/bin
16+
'';
1217
DOCKER_BUILDKIT = "1";
1318
NIX_STORE = "/nix/store";
1419
}

0 commit comments

Comments
 (0)