Issues / #2054
#2054 update.sh: failed engine build leaves BUILD.json stamped with new source hash — engine never rebuilt (stale binary reports old version)
open · @MrKop-git · 0 commentaires · Sur GitHub
Setup & installNVIDIA / CUDALinux
Description
## `update.sh`: a failed engine build leaves `BUILD.json` stamped with the new source hash — the engine is then never rebuilt
### Environment
- Linux (CachyOS/Arch rolling), CUDA 12 toolkit at `/opt/cuda-12.8`, GTX 1080 Ti (sm_61 → `engine-cuda12`, `"source": "local"`)
- System gcc had just been upgraded 14 → 16 (CUDA 12.8's nvcc rejects gcc > 14 as host compiler)
- Repo at v0.1.43, engine previously built at v0.1.42
### What happened (observable on disk)
1. 2026-10-11 11:44 — engine built fine (0.1.42), `engine-cuda12/strata --version` → `strata 0.1.42`
2. 2026-10-12 11:16 — `git pull` to v0.1.43 (tag verified: `git describe --tags` → `v0.1.43`), then `./update.sh` at 11:20
3. The rebuild failed (nvcc's `#error -- unsupported GNU version! gcc versions later than 14 are not supported`, from the gcc-16 upgrade)
4. Afterwards:
- `engine-cuda12/strata` — **unchanged old binary** (mtime still 2026-10-11 11:44, still reports 0.1.42)
- `engine-cuda12/BUILD.json` — **rewritten at 11:20 with `version: 0.1.43` and the new `src` hash**
5. Every subsequent `./update.sh` printed "engine already built for this PC" and finished with "Strata is updated (**engine 0.1.43**)" while the running binary was still 0.1.42. The mismatch persisted silently across multiple update runs.
(Consistency side note: with `BUILD.json` moved away, `./update.sh` instead reports "engine **0.1.42**" and does nothing — `update_installed_engine()` returns early when the stamp is missing, so there is no state in which the update offers to rebuild.)
### Workaround used
Invoking `build_engine()` directly with `CC=gcc-14 CXX=g++-14 CUDAHOSTCXX=g++-14` rebuilt 0.1.43 correctly.
### Suggested hardening
- Before accepting `meta.get("src") == source_hash(ENGINE_SOURCES)` as "already built", also verify the installed binary's actual version matches `source_version()` (e.g. run `strata --version`, or compare a build-id/version resource). A stale-binary/new-stamp mismatch currently survives forever.
- Consider logging a loud warning when a build attempt fails *after* the stamp strategy could have been affected, and never write the stamp unless the link step succeeded.
### Secondary: host compiler on rolling distros
`host_compiler_defs()` only honors `CC`/`CXX`/`CUDAHOSTCXX` when the user sets them. On Arch-type systems gcc regularly moves ahead of what a given CUDA 12.x nvcc accepts, and the failure is a raw nvcc `#error` inside CMake compiler detection — hard to interpret. It would help a lot if `install_build_tools()` auto-fell-back to an older installed host compiler (e.g. probe `g++-14`, `g++-13`, …) when the default one is newer than the toolkit supports.
Happy to provide full logs of the 11:20 run's output if useful — thanks for a great project, the conversation-cache/session design is lovely.
Sur le site
Liens install, modèles, releases.