Learn some build optimisations from binstall (#416)

This commit is contained in:
Félix Saparelli 2022-09-07 18:00:08 +12:00 committed by GitHub
parent c7c9b30636
commit cf80b8395f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 6 deletions

11
.cargo/config Normal file
View File

@ -0,0 +1,11 @@
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
[target.armv7-unknown-linux-musleabihf]
linker = "arm-linux-musleabihf-gcc"
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"

View File

@ -218,6 +218,7 @@ jobs:
run: |
rustup toolchain install --profile minimal --no-self-update stable
rustup default stable
rustup target add ${{ matrix.target }}
- name: Install cross
if: matrix.cross
@ -225,10 +226,6 @@ jobs:
with:
tool: cross
- name: Install host target
if: "!matrix.cross"
run: rustup target add ${{ matrix.target }}
- name: Build (cargo)
if: "!matrix.cross"
run: cargo build --package watchexec-cli --release --locked --target ${{ matrix.target }}
@ -244,7 +241,7 @@ jobs:
ext=""
[[ "${{ matrix.name }}" == windows-* ]] && ext=".exe"
bin="target/${{ matrix.target }}/release/watchexec${ext}"
objcopy --compress-debug-sections "$bin" || strip "$bin" || true
objcopy --compress-debug-sections "$bin" || true
mkdir "$dst"

View File

@ -11,6 +11,23 @@ members = [
]
[profile.release]
lto = true
debug = 1 # for stack traces
lto = "fat"
codegen-units = 1
strip = "symbols"
[profile.dev.build-override]
opt-level = 0
codegen-units = 1024
debug = false
debug-assertions = false
overflow-checks = false
incremental = false
[profile.release.build-override]
opt-level = 0
codegen-units = 1024
debug = false
debug-assertions = false
overflow-checks = false
incremental = false