build-test-release / release (push) Successful in 6m40s
Round 17 queue. R1 -- the cooling-fan icon in the Health column read as oversized next to the brain/chip/bolt icons. All four use a square 512x512 viewBox at the same slot size, so the fan only *looked* bigger because the Font Awesome fan glyph fills its box more. Draw the fan at 80% size, centred in its full-size slot, so the slot advance and the per-icon tooltip hit-test (both keyed to the full width) are unchanged and nothing else moves. R6 -- WhatsMiner and other non-Antminer makes showed "?" in the PIC column. A per-board PIC MCU is an Antminer hashboard property with no meaning elsewhere, so the cell now shows nothing for non-Antminer brands; an unknown *Antminer* model still shows "?". Build hygiene (user ask) -- add scripts/clean-old-builds.sh to reclaim the local cargo target dir. The app/CLI ship as release and tests run under --release, so the debug tree, cross-compile trees, and coverage tree are disposable; a stray cargo check had grown the debug tree to 38G and filled the disk. The script drops those, keeps the warm release build, and is meant to run after each release push. SELFTEST PASS; model tests (pic_locked, faults_attribute, health) pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
52 lines
2.1 KiB
Bash
52 lines
2.1 KiB
Bash
#!/usr/bin/env bash
|
|
#
|
|
# Reclaim disk from the local cargo build directory.
|
|
#
|
|
# The app and the miner_probe CLI ship as release builds, and the unit tests run
|
|
# under --release too (see the build notes), so the dev/debug profile tree, any
|
|
# cross-compile target trees, and the coverage tree are all disposable: they only
|
|
# ever reappear if something explicitly rebuilds them, and left alone they grow
|
|
# without bound (a stray `cargo check`/`cargo test` can push the debug tree past
|
|
# 30 GiB on its own). The release tree is kept warm so the next iteration is still
|
|
# incremental; only its throwaway bits are pruned.
|
|
#
|
|
# Run it right after a release push -- the pushed commit is what CI builds and
|
|
# ships, so the local intermediates are spare from that point. Safe to run any
|
|
# time; it never deletes the release build itself.
|
|
#
|
|
# Honours CARGO_TARGET_DIR (the build sets it to ~/.cache/alkane-tk-target).
|
|
set -uo pipefail
|
|
|
|
TARGET="${CARGO_TARGET_DIR:-$HOME/.cache/alkane-tk-target}"
|
|
if [ ! -d "$TARGET" ]; then
|
|
echo "clean-old-builds: no target dir at $TARGET (nothing to do)"
|
|
exit 0
|
|
fi
|
|
|
|
human() { du -sh "$1" 2>/dev/null | cut -f1; }
|
|
before=$(human "$TARGET")
|
|
|
|
# Disposable profile/aux trees -- regenerated on demand, never shipped.
|
|
rm -rf "$TARGET"/debug "$TARGET"/llvm-cov-target "$TARGET"/doc 2>/dev/null
|
|
|
|
# Cross-compile target trees (e.g. armv7-unknown-linux-musleabihf). Rust target
|
|
# triples all carry "-unknown-"; the host release/debug trees do not, so this
|
|
# never touches the warm release build.
|
|
for d in "$TARGET"/*-unknown-*; do
|
|
[ -d "$d" ] && rm -rf "$d"
|
|
done
|
|
|
|
# The incremental caches are rebuild accelerators, not build output -- dropping
|
|
# them costs one slightly-slower rebuild and can free a few GiB.
|
|
rm -rf "$TARGET"/release/incremental 2>/dev/null
|
|
|
|
# If cargo-sweep is installed, additionally drop release artifacts not touched in
|
|
# the last few days (old dependency versions left by past rebuilds), keeping the
|
|
# current build. Optional: install with `cargo install cargo-sweep`.
|
|
if command -v cargo-sweep >/dev/null 2>&1; then
|
|
cargo sweep --time 3 "$TARGET" >/dev/null 2>&1 || true
|
|
fi
|
|
|
|
after=$(human "$TARGET")
|
|
echo "clean-old-builds: $TARGET $before -> $after"
|