macOS build aborts on sed -i calls in Makefile + tools/integration/
Symptom
Building on macOS sequoia (BSD sed) fails on the very first sed -i invocation with errors like:
sed: 1: "<file>": undefined label '<file>'
…or silently uses the file argument as the backup-suffix and corrupts the source tree, depending on which call fires first. GNU sed (Linux default) is happy with sed -i '<expr>' file; BSD sed (macOS default) requires sed -i '' '<expr>' file (explicit empty backup-suffix argument).
Affected files
tools/integration/build_nistcurves_p256.sh was already updated to use sed -i ''. Twelve more sites across three files still use the GNU-only form:
| File | Sites |
|---|
Makefile:112 | 1 (label rewrite during PRG link) |
tools/integration/build_nistcurves_p384.sh | 10 (lines 115-123, 231-233) |
tools/integration/build_nistcurves_p384_bin.sh:133 | 1 (label rewrite) |
Fix
Convert each call site to the BSD-portable form sed -i '' '<expr>' file. GNU sed accepts the empty-string suffix argument as a no-op, so the change preserves Linux compatibility.
Out of scope (already resolved upstream)
While diagnosing this, I also looked at two other macOS-portability issues I had hit historically against c64-https@6c9d2a3 (Phase C.1):
tools/integration/build_x25519.sh had 7× sed -i sites — the script no longer exists on master after the Phase C.1 rollback, so this is moot.tools/uci/test_https_local.py:_load_labels() used to crash on REU-overlay-bank label lines (no : in parts[1]). Master has replaced the inline parser with Labels.from_file() (c64-test-harness ≥0.12.4), which handles both C: and bank-prefixed forms — also moot.
A PR for the remaining 12 sites is incoming.
macOS build aborts on
sed -icalls in Makefile + tools/integration/Symptom
Building on macOS sequoia (BSD
sed) fails on the very firstsed -iinvocation with errors like:…or silently uses the file argument as the backup-suffix and corrupts the source tree, depending on which call fires first. GNU
sed(Linux default) is happy withsed -i '<expr>' file; BSDsed(macOS default) requiressed -i '' '<expr>' file(explicit empty backup-suffix argument).Affected files
tools/integration/build_nistcurves_p256.shwas already updated to usesed -i ''. Twelve more sites across three files still use the GNU-only form:Makefile:112tools/integration/build_nistcurves_p384.shtools/integration/build_nistcurves_p384_bin.sh:133Fix
Convert each call site to the BSD-portable form
sed -i '' '<expr>' file. GNUsedaccepts the empty-string suffix argument as a no-op, so the change preserves Linux compatibility.Out of scope (already resolved upstream)
While diagnosing this, I also looked at two other macOS-portability issues I had hit historically against
c64-https@6c9d2a3(Phase C.1):tools/integration/build_x25519.shhad 7×sed -isites — the script no longer exists on master after the Phase C.1 rollback, so this is moot.tools/uci/test_https_local.py:_load_labels()used to crash on REU-overlay-bank label lines (no:inparts[1]). Master has replaced the inline parser withLabels.from_file()(c64-test-harness ≥0.12.4), which handles bothC:and bank-prefixed forms — also moot.A PR for the remaining 12 sites is incoming.