Show the build's progress during an install, and drop the centre-count note where it does not apply
This commit is contained in:
parent
5bfc558435
commit
dd1764dc99
|
|
@ -288,6 +288,9 @@ center_note() {
|
||||||
local steps="$1" ax="$2"
|
local steps="$1" ax="$2"
|
||||||
[[ -z $steps ]] && return 0
|
[[ -z $steps ]] && return 0
|
||||||
local half=$(( steps / 2 ))
|
local half=$(( steps / 2 ))
|
||||||
|
# Only when it matters: the 500000 default is fine for any travel under a
|
||||||
|
# million counts, and a note demanding a change nobody needs gets acted on.
|
||||||
|
(( half >= 500000 )) || return 0
|
||||||
echo "; NOTE: half this travel is $half counts, so config.ini needs"
|
echo "; NOTE: half this travel is $half counts, so config.ini needs"
|
||||||
echo "; [Motor] ${ax}_center_count = $(kit_center_for "$steps") (or anything above $half)"
|
echo "; [Motor] ${ax}_center_count = $(kit_center_for "$steps") (or anything above $half)"
|
||||||
echo "; The 500000 default would put the negative end at $(( 500000 - half ))."
|
echo "; The 500000 default would put the negative end at $(( 500000 - half ))."
|
||||||
|
|
|
||||||
|
|
@ -865,10 +865,29 @@ if [[ ${DO[preconditions]} == change ]]; then hr preconditions; sudo "$KIT/insta
|
||||||
if [[ ${DO[vimba]} == change ]]; then hr vimba; sudo "$KIT/install.sh" --vimba "$VIMBA_SRC"; done_step vimba; fi
|
if [[ ${DO[vimba]} == change ]]; then hr vimba; sudo "$KIT/install.sh" --vimba "$VIMBA_SRC"; done_step vimba; fi
|
||||||
|
|
||||||
hr "host build"
|
hr "host build"
|
||||||
|
build_start=$SECONDS
|
||||||
|
say "configuring (a first build also downloads the MQTT and dashboard libraries)"
|
||||||
( cd "$REPO" && GIT_REV="$S_SW_REV" cmake -S . -B build -DWITH_MQTT=ON \
|
( cd "$REPO" && GIT_REV="$S_SW_REV" cmake -S . -B build -DWITH_MQTT=ON \
|
||||||
-DWITH_VIMBA=$([[ -d /opt/VimbaX/cti ]] && echo ON || echo OFF) > "$WORK/cmake.log" 2>&1 ) ||
|
-DWITH_VIMBA=$([[ -d /opt/VimbaX/cti ]] && echo ON || echo OFF) > "$WORK/cmake.log" 2>&1 ) ||
|
||||||
{ tail -20 "$WORK/cmake.log" >&2; die "cmake configure failed"; }
|
{ tail -20 "$WORK/cmake.log" >&2; die "cmake configure failed"; }
|
||||||
( cd "$REPO" && cmake --build build -j"$(nproc)" 2>&1 | tail -3 )
|
# Progress, not silence: a first build on a LattePanda takes 10-25 minutes, and a
|
||||||
|
# screen that says nothing for that long reads as a hang - someone pressed Ctrl-C
|
||||||
|
# on staeffelsberg. A line every 5 %, any error as it happens; the whole output
|
||||||
|
# is kept, and its tail shown if the build fails.
|
||||||
|
say "building on $(nproc) cores - a first build takes 10-25 minutes, a rebuild a few"
|
||||||
|
if ! ( cd "$REPO" && cmake --build build -j"$(nproc)" 2>&1 ) | tee "$WORK/build.log" | awk '
|
||||||
|
match($0, /^\[ *[0-9]+%\]/) {
|
||||||
|
p = substr($0, 2, RLENGTH - 3) + 0
|
||||||
|
if (p >= last + 5 || (p == 100 && last != 100)) {
|
||||||
|
printf " %3d%% %s\n", p, substr($0, RLENGTH + 2); last = p; fflush()
|
||||||
|
}
|
||||||
|
next
|
||||||
|
}
|
||||||
|
/[Ee]rror/ { print " " $0; fflush() }'; then
|
||||||
|
tail -30 "$WORK/build.log" >&2
|
||||||
|
die "the build failed (the last lines are above)"
|
||||||
|
fi
|
||||||
|
say "built in $(( (SECONDS - build_start) / 60 )) min $(( (SECONDS - build_start) % 60 )) s"
|
||||||
[[ -x $BIN && -x $FGC_CONFIG ]] || die "the build did not produce the program and fgc-config"
|
[[ -x $BIN && -x $FGC_CONFIG ]] || die "the build did not produce the program and fgc-config"
|
||||||
done_step build
|
done_step build
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue