diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-04 05:59:40 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-04 05:59:40 +0000 |
| commit | 152c859b18b222a7c11a82b5485110e902267d40 (patch) | |
| tree | 1ceadf421609a2e58da81103165a2fb7085387de /Makefile | |
| parent | e4f898c4a6b9900553c64b9804889b5fdae3e55f (diff) | |
| parent | b810d86752ddb2674118f737582c924bb9eb74c1 (diff) | |
Merge branch 'deploy/all-2026-08-24' into 'deploy/soak-2026-08-21'
deploy: land MRs 1-12 and upstream 1.2.20, as shipped in relay component
See merge request !13
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 117 |
1 files changed, 94 insertions, 23 deletions
| @@ -11,10 +11,10 @@ | |||
| 11 | ROOT := $(shell pwd) | 11 | ROOT := $(shell pwd) |
| 12 | NPROC := $(shell nproc 2>/dev/null || echo 2) | 12 | NPROC := $(shell nproc 2>/dev/null || echo 2) |
| 13 | SUDO := $(shell [ "$$(id -u)" = "0" ] && echo "" || echo "sudo") | 13 | SUDO := $(shell [ "$$(id -u)" = "0" ] && echo "" || echo "sudo") |
| 14 | # Not "1.2.19". This tree is upstream v1.2.19 plus our own hardening commits and | 14 | # Not "1.2.20". This tree is upstream v1.2.20 plus our own hardening commits and |
| 15 | # a hand-merged payout ledger, so a binary built here must not be mistakable for | 15 | # a hand-merged payout ledger, so a binary built here must not be mistakable for |
| 16 | # the upstream release of that number -- it names every release artifact. | 16 | # the upstream release of that number -- it names every release artifact. |
| 17 | VERSION := 1.2.19+sec | 17 | VERSION := 1.2.20+sec |
| 18 | 18 | ||
| 19 | # ---- Pinned third-party sources ------------------------------------------- | 19 | # ---- Pinned third-party sources ------------------------------------------- |
| 20 | # | 20 | # |
| @@ -37,6 +37,12 @@ VERSION := 1.2.19+sec | |||
| 37 | # resolves the object by its own hash). Bump deliberately, and rebuild and | 37 | # resolves the object by its own hash). Bump deliberately, and rebuild and |
| 38 | # resync before shipping the result. | 38 | # resync before shipping the result. |
| 39 | # | 39 | # |
| 40 | # The check has to decide the exit status, so each recipe below joins its | ||
| 41 | # commands with && the whole way to the closing echo. Ending that chain with a | ||
| 42 | # `;` meant a failed `test` only skipped the build steps: the echo still ran, | ||
| 43 | # the target still exited 0, and make announced a pinned dependency that | ||
| 44 | # nothing had verified. | ||
| 45 | # | ||
| 40 | # RandomX pin is the commit this tree has been building and syncing against | 46 | # RandomX pin is the commit this tree has been building and syncing against |
| 41 | # (post-v2.0.1 master, 2026-05-24) -- identical to upstream's pin. | 47 | # (post-v2.0.1 master, 2026-05-24) -- identical to upstream's pin. |
| 42 | # | 48 | # |
| @@ -59,6 +65,32 @@ APPIMAGETOOL_SHA256 := ed4ce84f0d9caff66f50bcca6ff6f35aae54ce8135408b3fa33abfc3c | |||
| 59 | 65 | ||
| 60 | # ---- Linux ---------------------------------------------------------------- | 66 | # ---- Linux ---------------------------------------------------------------- |
| 61 | 67 | ||
| 68 | # RandomX used to build in $(HOME)/RandomX, and deps-randomx would rm -rf that | ||
| 69 | # path whenever the library was missing -- deleting a tree the build did not | ||
| 70 | # create and does not own (issue #27; a hand-managed pinned checkout there is | ||
| 71 | # what this machine's miners build against). The default is now in-tree, like | ||
| 72 | # secp256k1-build. A host that deliberately keeps RandomX elsewhere can set | ||
| 73 | # RANDOMX_DIR=... explicitly; the recipe below will still never delete a | ||
| 74 | # directory that lacks the marker file this build writes after a successful | ||
| 75 | # build. Exported so src/Makefile's own RANDOMX_DIR ?= picks the same tree. | ||
| 76 | # | ||
| 77 | # Every use of it below is quoted, and the recipe rejects a value that cannot | ||
| 78 | # name exactly one directory before it reaches anything destructive. Unquoted, | ||
| 79 | # the marker guard could be stepped around: a value holding a glob that matches | ||
| 80 | # two directories made `[ -d $(RANDOMX_DIR) ]` a two-argument test, which dies | ||
| 81 | # with "unexpected operator" instead of answering, so the && short-circuited, | ||
| 82 | # the guard was skipped, and the rm -rf below ran against every match. A value | ||
| 83 | # holding a space or a `&&` broke the outer test the same way and reported | ||
| 84 | # "already built". Whitespace and glob characters are refused outright rather | ||
| 85 | # than merely quoted, because src/Makefile interpolates this same value into | ||
| 86 | # -I$(RANDOMX_DIR)/src and -L$(RANDOMX_DIR)/build unquoted, where neither can | ||
| 87 | # survive. A relative value is refused rather than silently made absolute: it | ||
| 88 | # would mean two different directories to this Makefile and to src/Makefile, | ||
| 89 | # whose cwd is src/, and a command-line assignment reaches the sub-make through | ||
| 90 | # MAKEFLAGS, where it outranks anything exported from here. | ||
| 91 | RANDOMX_DIR ?= $(ROOT)/randomx-build | ||
| 92 | export RANDOMX_DIR | ||
| 93 | |||
| 62 | linux: deps-linux | 94 | linux: deps-linux |
| 63 | $(MAKE) -C src -f Makefile -j$(NPROC) | 95 | $(MAKE) -C src -f Makefile -j$(NPROC) |
| 64 | strip src/bitflash | 96 | strip src/bitflash |
| @@ -78,21 +110,35 @@ linux-node: deps-linux | |||
| 78 | 110 | ||
| 79 | deps-linux: deps-apt deps-secp256k1 deps-randomx | 111 | deps-linux: deps-apt deps-secp256k1 deps-randomx |
| 80 | 112 | ||
| 113 | # libboost-dev, not libboost-system-dev: Boost.System has been header-only | ||
| 114 | # since 1.69 and Ubuntu 26.04 (resolute) no longer ships the -system package. | ||
| 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 | ||
| 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. | ||
| 81 | deps-apt: | 124 | deps-apt: |
| 82 | @if command -v apt-get >/dev/null 2>&1; then \ | 125 | @if command -v apt-get >/dev/null 2>&1; then \ |
| 126 | $(SUDO) apt-get update || \ | ||
| 127 | echo " warning: apt-get update failed, using the package lists on disk"; \ | ||
| 83 | $(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 \ |
| 84 | libtool libssl-dev libdb5.3++-dev libsodium-dev nlohmann-json3-dev \ | 129 | libtool libssl-dev libdb5.3++-dev libsodium-dev nlohmann-json3-dev \ |
| 85 | libboost-system-dev libglfw3-dev libgl-dev python3-pil clang; \ | 130 | libboost-dev libglfw3-dev libgl-dev libsqlite3-dev \ |
| 131 | python3-pil clang; \ | ||
| 86 | else \ | 132 | else \ |
| 87 | echo "Not an apt system — install: g++ cmake git autoconf libtool"; \ | 133 | echo "Not an apt system — install: g++ cmake git autoconf libtool"; \ |
| 88 | echo " libssl libdb++ libsodium nlohmann-json boost glfw3 opengl python3-pil"; \ | 134 | echo " libssl libdb++ libsodium nlohmann-json boost glfw3 opengl sqlite3 python3-pil"; \ |
| 89 | fi | 135 | fi |
| 90 | 136 | ||
| 91 | deps-secp256k1: | 137 | deps-secp256k1: |
| 92 | @if [ ! -f /usr/local/lib/libsecp256k1.a ]; then \ | 138 | @if [ ! -f /usr/local/lib/libsecp256k1.a ]; then \ |
| 93 | echo "==> building libsecp256k1"; \ | 139 | echo "==> building libsecp256k1"; \ |
| 94 | rm -rf $(ROOT)/secp256k1-build; \ | 140 | rm -rf $(ROOT)/secp256k1-build && \ |
| 95 | git init -q $(ROOT)/secp256k1-build; \ | 141 | git init -q $(ROOT)/secp256k1-build && \ |
| 96 | cd $(ROOT)/secp256k1-build && \ | 142 | cd $(ROOT)/secp256k1-build && \ |
| 97 | git remote add origin $(SECP256K1_REPO) && \ | 143 | git remote add origin $(SECP256K1_REPO) && \ |
| 98 | git fetch -q --depth 1 origin $(SECP256K1_COMMIT) && \ | 144 | git fetch -q --depth 1 origin $(SECP256K1_COMMIT) && \ |
| @@ -102,26 +148,41 @@ deps-secp256k1: | |||
| 102 | cd $(ROOT)/secp256k1-build && ./autogen.sh && \ | 148 | cd $(ROOT)/secp256k1-build && ./autogen.sh && \ |
| 103 | ./configure --enable-module-schnorrsig --enable-module-extrakeys \ | 149 | ./configure --enable-module-schnorrsig --enable-module-extrakeys \ |
| 104 | --disable-shared --with-pic --disable-benchmark --disable-tests && \ | 150 | --disable-shared --with-pic --disable-benchmark --disable-tests && \ |
| 105 | make -j$(NPROC) && $(SUDO) make install && $(SUDO) ldconfig; \ | 151 | make -j$(NPROC) && $(SUDO) make install && $(SUDO) ldconfig && \ |
| 106 | echo "==> libsecp256k1 done"; \ | 152 | echo "==> libsecp256k1 done"; \ |
| 107 | else \ | 153 | else \ |
| 108 | echo "==> libsecp256k1 already installed"; \ | 154 | echo "==> libsecp256k1 already installed"; \ |
| 109 | fi | 155 | fi |
| 110 | 156 | ||
| 111 | deps-randomx: | 157 | deps-randomx: |
| 112 | @if [ ! -f $(HOME)/RandomX/build/librandomx.a ]; then \ | 158 | @ws="$$(printf ' \t')"; \ |
| 159 | case "$(RANDOMX_DIR)" in \ | ||
| 160 | "") echo "ERROR: RANDOMX_DIR is empty"; exit 1 ;; \ | ||
| 161 | /) echo "ERROR: RANDOMX_DIR is /, refusing"; exit 1 ;; \ | ||
| 162 | *[$$ws]*) echo "ERROR: RANDOMX_DIR contains whitespace: $(RANDOMX_DIR)"; exit 1 ;; \ | ||
| 163 | *[*?[]*) echo "ERROR: RANDOMX_DIR contains a glob character: $(RANDOMX_DIR)"; exit 1 ;; \ | ||
| 164 | /*) ;; \ | ||
| 165 | *) echo "ERROR: RANDOMX_DIR must be an absolute path: $(RANDOMX_DIR)"; exit 1 ;; \ | ||
| 166 | esac | ||
| 167 | @if [ ! -f "$(RANDOMX_DIR)/build/librandomx.a" ]; then \ | ||
| 168 | if [ -d "$(RANDOMX_DIR)" ] && [ ! -f "$(RANDOMX_DIR)/.bitflash-built" ]; then \ | ||
| 169 | echo "ERROR: $(RANDOMX_DIR) exists but was not created by this build"; \ | ||
| 170 | echo " refusing to rm -rf it -- remove it yourself or set RANDOMX_DIR"; \ | ||
| 171 | exit 1; \ | ||
| 172 | fi; \ | ||
| 113 | echo "==> building RandomX"; \ | 173 | echo "==> building RandomX"; \ |
| 114 | rm -rf $(HOME)/RandomX; \ | 174 | rm -rf "$(RANDOMX_DIR)" && \ |
| 115 | git init -q $(HOME)/RandomX; \ | 175 | git init -q "$(RANDOMX_DIR)" && \ |
| 116 | cd $(HOME)/RandomX && \ | 176 | cd "$(RANDOMX_DIR)" && \ |
| 117 | git remote add origin $(RANDOMX_REPO) && \ | 177 | git remote add origin $(RANDOMX_REPO) && \ |
| 118 | git fetch -q --depth 1 origin $(RANDOMX_COMMIT) && \ | 178 | git fetch -q --depth 1 origin $(RANDOMX_COMMIT) && \ |
| 119 | git checkout -q --detach FETCH_HEAD && \ | 179 | git checkout -q --detach FETCH_HEAD && \ |
| 120 | test "$$(git rev-parse HEAD)" = "$(RANDOMX_COMMIT)" && \ | 180 | test "$$(git rev-parse HEAD)" = "$(RANDOMX_COMMIT)" && \ |
| 121 | echo "==> RandomX pinned at $(RANDOMX_COMMIT)" && \ | 181 | echo "==> RandomX pinned at $(RANDOMX_COMMIT)" && \ |
| 122 | mkdir -p $(HOME)/RandomX/build; \ | 182 | mkdir -p "$(RANDOMX_DIR)/build" && \ |
| 123 | cd $(HOME)/RandomX/build && cmake .. -DCMAKE_BUILD_TYPE=Release && \ | 183 | cd "$(RANDOMX_DIR)/build" && cmake .. -DCMAKE_BUILD_TYPE=Release && \ |
| 124 | make -j$(NPROC) randomx; \ | 184 | make -j$(NPROC) randomx && \ |
| 185 | touch "$(RANDOMX_DIR)/.bitflash-built" && \ | ||
| 125 | echo "==> RandomX done"; \ | 186 | echo "==> RandomX done"; \ |
| 126 | else \ | 187 | else \ |
| 127 | echo "==> RandomX already built"; \ | 188 | echo "==> RandomX already built"; \ |
| @@ -172,13 +233,22 @@ img = ico.convert('RGBA'); \ | |||
| 172 | img.save(d + '/bitflash.png'); \ | 233 | img.save(d + '/bitflash.png'); \ |
| 173 | import shutil; shutil.copy(d + '/bitflash.png', \ | 234 | import shutil; shutil.copy(d + '/bitflash.png', \ |
| 174 | d + '/usr/share/icons/hicolor/256x256/apps/bitflash.png')" | 235 | d + '/usr/share/icons/hicolor/256x256/apps/bitflash.png')" |
| 175 | @for lib in libsodium.so.23 libdb_cxx-5.3.so libglfw.so.3; do \ | 236 | @for lib in libsodium.so.23 libdb_cxx-5.3.so libsqlite3.so.0 libglfw.so.3; do \ |
| 176 | path=$$(ldconfig -p | grep " $$lib " | awk '{print $$NF}' | head -1); \ | 237 | path=$$(ldconfig -p | grep " $$lib " | awk '{print $$NF}' | head -1); \ |
| 177 | [ -z "$$path" ] && path=$$(find /usr/lib /lib -name "$$lib" 2>/dev/null | head -1); \ | 238 | [ -z "$$path" ] && path=$$(find /usr/lib /lib -name "$$lib" 2>/dev/null | head -1); \ |
| 178 | [ -n "$$path" ] && cp -L "$$path" $(APPDIR)/usr/lib/ && echo " bundled $$lib" || echo " missing $$lib"; \ | 239 | [ -n "$$path" ] && cp -L "$$path" $(APPDIR)/usr/lib/ && echo " bundled $$lib" || echo " missing $$lib"; \ |
| 179 | done | 240 | done |
| 241 | # appimagetool's output used to be piped through grep ... || true, which | ||
| 242 | # discarded its exit status: the target succeeded and announced "Built:" | ||
| 243 | # even when no AppImage existed. Run the tool bare so its status decides, | ||
| 244 | # then require the artefact to exist, be non-empty, and be newer than the | ||
| 245 | # binary it was packaged from before saying so. | ||
| 180 | @ARCH=x86_64 $(APPIMAGETOOL) --no-appstream $(APPDIR) \ | 246 | @ARCH=x86_64 $(APPIMAGETOOL) --no-appstream $(APPDIR) \ |
| 181 | $(ROOT)/Bitflash-$(VERSION)-x86_64.AppImage 2>&1 | grep -E "^Built|^Error" || true | 247 | $(ROOT)/Bitflash-$(VERSION)-x86_64.AppImage |
| 248 | @test -s $(ROOT)/Bitflash-$(VERSION)-x86_64.AppImage || \ | ||
| 249 | { echo "ERROR: Bitflash-$(VERSION)-x86_64.AppImage missing or empty"; exit 1; } | ||
| 250 | @test $(ROOT)/Bitflash-$(VERSION)-x86_64.AppImage -nt src/bitflash || \ | ||
| 251 | { echo "ERROR: Bitflash-$(VERSION)-x86_64.AppImage is not newer than src/bitflash"; exit 1; } | ||
| 182 | @echo "Built: Bitflash-$(VERSION)-x86_64.AppImage" | 252 | @echo "Built: Bitflash-$(VERSION)-x86_64.AppImage" |
| 183 | 253 | ||
| 184 | # ---- Windows (MSYS2 UCRT64) ----------------------------------------------- | 254 | # ---- Windows (MSYS2 UCRT64) ----------------------------------------------- |
| @@ -190,14 +260,15 @@ deps-windows: | |||
| 190 | mingw-w64-ucrt-x86_64-glfw \ | 260 | mingw-w64-ucrt-x86_64-glfw \ |
| 191 | mingw-w64-ucrt-x86_64-openssl \ | 261 | mingw-w64-ucrt-x86_64-openssl \ |
| 192 | mingw-w64-ucrt-x86_64-db \ | 262 | mingw-w64-ucrt-x86_64-db \ |
| 263 | mingw-w64-ucrt-x86_64-sqlite3 \ | ||
| 193 | mingw-w64-ucrt-x86_64-libsodium \ | 264 | mingw-w64-ucrt-x86_64-libsodium \ |
| 194 | mingw-w64-ucrt-x86_64-nlohmann-json \ | 265 | mingw-w64-ucrt-x86_64-nlohmann-json \ |
| 195 | mingw-w64-ucrt-x86_64-boost \ | 266 | mingw-w64-ucrt-x86_64-boost \ |
| 196 | mingw-w64-ucrt-x86_64-cmake \ | 267 | mingw-w64-ucrt-x86_64-cmake \ |
| 197 | autoconf automake libtool | 268 | autoconf automake libtool |
| 198 | @if [ ! -f deps/lib/libsecp256k1.a ]; then \ | 269 | @if [ ! -f deps/lib/libsecp256k1.a ]; then \ |
| 199 | rm -rf secp256k1-build; \ | 270 | rm -rf secp256k1-build && \ |
| 200 | git init -q secp256k1-build; \ | 271 | git init -q secp256k1-build && \ |
| 201 | cd secp256k1-build && \ | 272 | cd secp256k1-build && \ |
| 202 | git remote add origin $(SECP256K1_REPO) && \ | 273 | git remote add origin $(SECP256K1_REPO) && \ |
| 203 | git fetch -q --depth 1 origin $(SECP256K1_COMMIT) && \ | 274 | git fetch -q --depth 1 origin $(SECP256K1_COMMIT) && \ |
| @@ -208,23 +279,23 @@ deps-windows: | |||
| 208 | ./configure --prefix=$(ROOT)/deps \ | 279 | ./configure --prefix=$(ROOT)/deps \ |
| 209 | --enable-module-schnorrsig --enable-module-extrakeys \ | 280 | --enable-module-schnorrsig --enable-module-extrakeys \ |
| 210 | --disable-shared --with-pic --disable-benchmark --disable-tests && \ | 281 | --disable-shared --with-pic --disable-benchmark --disable-tests && \ |
| 211 | make install; \ | 282 | make install && \ |
| 212 | echo "==> secp256k1 done"; \ | 283 | echo "==> secp256k1 done"; \ |
| 213 | else \ | 284 | else \ |
| 214 | echo "==> secp256k1 already built"; \ | 285 | echo "==> secp256k1 already built"; \ |
| 215 | fi | 286 | fi |
| 216 | @if [ ! -f RandomX/build/librandomx.a ]; then \ | 287 | @if [ ! -f RandomX/build/librandomx.a ]; then \ |
| 217 | rm -rf RandomX; \ | 288 | rm -rf RandomX && \ |
| 218 | git init -q RandomX; \ | 289 | git init -q RandomX && \ |
| 219 | cd RandomX && \ | 290 | cd RandomX && \ |
| 220 | git remote add origin $(RANDOMX_REPO) && \ | 291 | git remote add origin $(RANDOMX_REPO) && \ |
| 221 | git fetch -q --depth 1 origin $(RANDOMX_COMMIT) && \ | 292 | git fetch -q --depth 1 origin $(RANDOMX_COMMIT) && \ |
| 222 | git checkout -q --detach FETCH_HEAD && \ | 293 | git checkout -q --detach FETCH_HEAD && \ |
| 223 | test "$$(git rev-parse HEAD)" = "$(RANDOMX_COMMIT)" && \ | 294 | test "$$(git rev-parse HEAD)" = "$(RANDOMX_COMMIT)" && \ |
| 224 | echo "==> RandomX pinned at $(RANDOMX_COMMIT)" && \ | 295 | echo "==> RandomX pinned at $(RANDOMX_COMMIT)" && \ |
| 225 | mkdir -p $(ROOT)/RandomX/build; \ | 296 | mkdir -p $(ROOT)/RandomX/build && \ |
| 226 | cd $(ROOT)/RandomX/build && cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release && \ | 297 | cd $(ROOT)/RandomX/build && cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release && \ |
| 227 | make randomx; \ | 298 | make randomx && \ |
| 228 | echo "==> RandomX done"; \ | 299 | echo "==> RandomX done"; \ |
| 229 | else \ | 300 | else \ |
| 230 | echo "==> RandomX already built"; \ | 301 | echo "==> RandomX already built"; \ |