Add .cargo/config.toml for better deb build.

This commit is contained in:
Quintus Leung
2025-06-02 00:05:02 +01:00
parent 45cf17b755
commit 724ce2cdc5
2 changed files with 15 additions and 10 deletions
+15
View File
@@ -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"]
-10
View File
@@ -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 }}