Skip to content

Commit

Permalink
Switch to musl c lib
Browse files Browse the repository at this point in the history
  • Loading branch information
flxkrmr committed Feb 18, 2024
1 parent 882db65 commit f1bf1db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

[target.arm-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

[target.arm-unknown-linux-musleabihf]
linker = "arm-linux-muslabihf-gcc"
22 changes: 7 additions & 15 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,21 @@ jobs:
- uses: actions/checkout@v3
- name: Run Tests
run: cargo test

- name: Set up Rust for Raspberry Pi cross-compilation
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: arm-unknown-linux-gnueabihf
target: arm-unknown-linux-musleabihf

#- name: Add sources for armhf
# run: sudo sh -c 'cat .github/artifacts/sources.list > /etc/apt/sources.list'

- name: Lets have a look
run: sudo sh -c 'cat /etc/apt/sources.list'

#- name: Prepare for cross compilation
# run: sudo dpkg --add-architecture armhf && sudo apt-get update

- name: Install dependencies for cross-compilation
run: sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-armhf-cross libc6-dev-armhf-cross libsqlite3-dev
run: sudo apt-get install -y gcc-arm-linux-musleabihf

- name: Build binary for Raspberry Pi
run: cargo build --release --target=arm-unknown-linux-gnueabihf
run: cargo build --release --target=arm-unknown-linux-musleabihf

- name: Upload binary
uses: actions/upload-artifact@v2
with:
name: boiler-watch-api
path: target/arm-unknown-linux-gnueabihf/release/boiler-watch-api
name: boiler-watch-api_arm-linux-musleabihf
path: target/arm-unknown-linux-musleabihf/release/boiler-watch-api

0 comments on commit f1bf1db

Please sign in to comment.