Skip to content

macOS: sed -i portability blocks build (Makefile + nistcurves p384 staging) #34

Description

@JC-000

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:

FileSites
Makefile:1121 (label rewrite during PRG link)
tools/integration/build_nistcurves_p384.sh10 (lines 115-123, 231-233)
tools/integration/build_nistcurves_p384_bin.sh:1331 (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):

  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.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions