libretiny: treat already-patched .ld as success on incremental rebuilds

The idempotency check in _inject_keep returns content unchanged when the
marker is already present, so patched stayed 0 and the fail-hard
RuntimeError fired on every incremental rebuild after the first. Check
for the marker before attempting to patch and count it as success.
This commit is contained in:
J. Nick Koston
2026-04-15 16:47:44 -10:00
parent 21c32966ee
commit 849463b8a5
@@ -86,6 +86,9 @@ def _pre_link(target, source, env):
path = os.path.join(build_dir, name)
with open(path, "r", encoding="utf-8") as fh:
original = fh.read()
if _MARKER in original:
patched += 1
continue
content = original
for fn in _patchers:
content = fn(content)