fix(setup): verify musl binary starts before reporting install success

install_binary downloaded the release binary, chmod'd it, and printed
"✓ Installed omp" with exit 0 without ever running it. Bun's musl-target
binaries link libstdc++/libgcc dynamically, which stock Alpine/musl systems
lack, so the binary exits 127 with relocation errors while the installer
still claimed success.

Smoke-run `omp --version` after install; on failure print the captured
error, add the `apk add libstdc++ libgcc` remediation for musl targets,
and exit non-zero. Document the Alpine/musl runtime requirement in the
README install section.

Fixes #7545
This commit is contained in:
roboomp
2026-08-03 18:55:10 +00:00
parent 01c1f91ff5
commit 5046438f3b
3 changed files with 28 additions and 0 deletions
+2
View File
@@ -40,6 +40,8 @@ The most capable agent surface that ships. Continuously tuned by real-world use
curl -fsSL https://omp.sh/install | sh
```
> **Alpine / musl:** the prebuilt musl binary links `libstdc++`/`libgcc` dynamically, which stock Alpine does not ship. Install them first: `apk add libstdc++ libgcc`.
**Homebrew**
```sh
+4
View File
@@ -2,6 +2,10 @@
## [Unreleased]
### Fixed
- Fixed `install.sh` reporting success (exit 0) for a musl binary that cannot start: the installer now smoke-runs the downloaded binary and, on failure, prints the captured error plus the `apk add libstdc++ libgcc` remediation for musl targets and exits non-zero. Documented the Alpine/musl runtime requirement in the README ([#7545](https://github.com/can1357/oh-my-pi/issues/7545)).
## [17.2.6] - 2026-08-03
### Added
+22
View File
@@ -267,6 +267,28 @@ install_binary() {
echo "Downloading ${BINARY}..."
curl -fsSL --connect-timeout 10 --speed-limit 1024 --speed-time 30 "$BINARY_URL" -o "${INSTALL_DIR}/omp"
chmod +x "${INSTALL_DIR}/omp"
# Verify the freshly installed binary can actually start before reporting
# success. Bun's musl-target binaries link libstdc++/libgcc dynamically,
# which stock Alpine/musl systems do not ship, so the download succeeds while
# the binary exits 127 with relocation errors. Never claim success for a
# binary that cannot run.
if ! SMOKE_OUTPUT="$("${INSTALL_DIR}/omp" --version 2>&1)"; then
echo ""
echo "✗ omp was downloaded to ${INSTALL_DIR}/omp but cannot start:"
echo "$SMOKE_OUTPUT" | sed 's/^/ /'
if [ "$PLATFORM" = "linux-musl" ]; then
echo ""
echo "The musl build links libstdc++/libgcc dynamically. Install them, then re-run 'omp':"
if command -v apk >/dev/null 2>&1; then
echo " apk add libstdc++ libgcc"
else
echo " (install the libstdc++ and libgcc runtime packages for your distro)"
fi
fi
exit 1
fi
echo ""
echo "✓ Installed omp to ${INSTALL_DIR}/omp"