diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 16:59:30 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 16:59:30 +0000 |
| commit | 3d6373874f3972b776dd48e86321b1f8c78cd23b (patch) | |
| tree | 40dc43bd29bc4c7370ed5c32b1a802cbc1db9c1a | |
| parent | 9886a4680cd669f376eec1bf18da7ad10057dd38 (diff) | |
build: say so when apt-get update fails instead of passing over it
34cb6e6 added `apt-get update;` before the install. The semicolon means
a failed update does not stop the install, which is the behaviour we
want -- one unreachable repository should not block an install the
lists already on disk can satisfy -- but it was punctuation rather than
a decision, and it was silent. The install then failed several seconds
later with "unable to locate package" and nothing tied the two
together.
Kept it non-fatal, made it explicit with `|| echo`, and wrote the
reasoning down next to it. The install itself is still the last command
in the branch, so a failed install is still the target's status.
Measured all four combinations with apt-get shimmed: a failed update
now warns and carries on, a failed install still aborts.
| -rw-r--r-- | Makefile | 9 |
1 files changed, 8 insertions, 1 deletions
| @@ -115,9 +115,16 @@ deps-linux: deps-apt deps-secp256k1 deps-randomx | |||
| 115 | # This tree only includes two boost headers and links no boost library. The | 115 | # This tree only includes two boost headers and links no boost library. The |
| 116 | # apt-get update comes first: a fresh image's package lists are empty, and | 116 | # apt-get update comes first: a fresh image's package lists are empty, and |
| 117 | # install then fails on the first name it cannot find. | 117 | # install then fails on the first name it cannot find. |
| 118 | # | ||
| 119 | # A failed update is deliberately not fatal: one unreachable repository should | ||
| 120 | # not block an install the lists already on disk can satisfy. It does say so, | ||
| 121 | # though -- "unable to locate package" several seconds later is otherwise hard | ||
| 122 | # to connect back to it. The install is the last command in the branch, so its | ||
| 123 | # status is the target's, and that one does abort. | ||
| 118 | deps-apt: | 124 | deps-apt: |
| 119 | @if command -v apt-get >/dev/null 2>&1; then \ | 125 | @if command -v apt-get >/dev/null 2>&1; then \ |
| 120 | $(SUDO) apt-get update; \ | 126 | $(SUDO) apt-get update || \ |
| 127 | echo " warning: apt-get update failed, using the package lists on disk"; \ | ||
| 121 | $(SUDO) apt-get install -y build-essential cmake git pkg-config autoconf \ | 128 | $(SUDO) apt-get install -y build-essential cmake git pkg-config autoconf \ |
| 122 | libtool libssl-dev libdb5.3++-dev libsodium-dev nlohmann-json3-dev \ | 129 | libtool libssl-dev libdb5.3++-dev libsodium-dev nlohmann-json3-dev \ |
| 123 | libboost-dev libglfw3-dev libgl-dev python3-pil clang; \ | 130 | libboost-dev libglfw3-dev libgl-dev python3-pil clang; \ |