From 724ce2cdc5aceecaae1f3c43dcaa2307428d1e44 Mon Sep 17 00:00:00 2001 From: Quintus Leung Date: Mon, 2 Jun 2025 00:05:02 +0100 Subject: [PATCH] Add .cargo/config.toml for better deb build. --- .cargo/config.toml | 15 +++++++++++++++ .github/workflows/release.yml | 10 ---------- 2 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..d92ca22 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,15 @@ +[source.crates-io] +index = "https://github.com/rust-lang/crates.io-index" # I set the source to the official github index + +[http] +proxy = "" # leaving this as a blank string resets proxy to default + +[target.aarch64-unknown-linux-gnu] +arch = "arm64" +linker = "aarch64-linux-gnu-gcc" +rustflags = ["-C", "target-feature=+crt-static"] + +[target.armv7-unknown-linux-gnueabihf] +arch = "armhf" +linker = "/opt/rpi_tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc" +rustflags = ["-C", "target-feature=+crt-static"] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3ed62fe..f783c2b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -138,16 +138,6 @@ jobs: rustup target add ${{ matrix.target }} rustup -q update - - name: Configure linker for cross-compilation (for ARM) - if: matrix.linker != '' && matrix.linker != null - run: | - mkdir -p .cargo - echo '[target.${{ matrix.target }}]' > .cargo/config.toml - echo 'linker = "${{ matrix.linker }}"' >> .cargo/config.toml - echo 'rustflags = ${{ matrix.rustflags }}' >> .cargo/config.toml - echo "Configured .cargo/config.toml for ${{ matrix.target }}:" - cat .cargo/config.toml - - name: Build Debian package for ${{ matrix.arch }} if: matrix.arch != 'armhf' && matrix.arch != 'arm64' run: dpkg-buildpackage -b -d -uc -us --host-arch ${{ matrix.arch }}