From 395bcb12182c582becbf9f6689046af4798436b8 Mon Sep 17 00:00:00 2001 From: prabod Date: Thu, 10 Sep 2026 18:10:58 +1000 Subject: [PATCH] install: remove stale versioned dylibs on upgrade MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The clean-install step removed `libbaseRT.dylib` but not `libbaseRT..dylib`. That was harmless while the macOS bundle shipped one flat library — but 0.2.4 ships a VERSIONED library plus two symlinks (libbaseRT.0.2.4.dylib <- libbaseRT.0.dylib <- libbaseRT.dylib), and the bare name matches only the last of those. So every upgrade from 0.2.4 on leaves the previous release's real library behind: a full-size orphan nothing points at, accumulating one per upgrade. Observed on a live install carrying both libbaseRT.0.2.0.dylib and libbaseRT.0.2.4.dylib. Benign today because the symlinks resolve correctly, but it is a loaded gun for any future change to the install name. `libbaseRT*.dylib` now, matching the treatment `libbaseRT.so*` already had. Verified both directions against a dirty install seeded with 0.2.0 and 0.2.3 libraries: the old script leaves all three stacked up, the fixed one keeps exactly libbaseRT.0.2.4.dylib and its two symlinks. --- install.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5ee8092..f4e87a6 100755 --- a/install.sh +++ b/install.sh @@ -91,8 +91,14 @@ curl -fSL --progress-bar "$url" -o "$tmp/bundle.tar.gz" # (the bundle is flat: libbaseRT.{dylib,so}, baseRT.metallib on macOS, basert, # basert-*, include/), so an unrelated file in a custom INSTALL_DIR is left alone. mkdir -p "$INSTALL_DIR" +# libbaseRT*.dylib, not libbaseRT.dylib: since 0.2.4 the macOS bundle ships a +# VERSIONED library plus two symlinks (libbaseRT.0.2.4.dylib <- libbaseRT.0.dylib +# <- libbaseRT.dylib), and the bare name matched only the last of those. Every +# upgrade then left the previous release's real library behind — an orphan of +# the full binary size that nothing points at, and a loaded gun for any future +# change to the install name. (The .so pattern was already globbed.) rm -f "$INSTALL_DIR"/basert "$INSTALL_DIR"/basert-* "$INSTALL_DIR"/baseRT_* \ - "$INSTALL_DIR"/libbaseRT.dylib "$INSTALL_DIR"/libbaseRT.so* "$INSTALL_DIR"/baseRT.metallib + "$INSTALL_DIR"/libbaseRT*.dylib "$INSTALL_DIR"/libbaseRT.so* "$INSTALL_DIR"/baseRT.metallib rm -rf "$INSTALL_DIR"/include tar -xzf "$tmp/bundle.tar.gz" -C "$INSTALL_DIR"