Skip to content

Commit c2d373f

Browse files
committed
chore(registry): delete dead native Makefile targets, make patch-vendor failure-idempotent
1 parent 85b9d59 commit c2d373f

2 files changed

Lines changed: 11 additions & 28 deletions

File tree

registry/native/Makefile

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ STUB_COMMANDS := \
3939

4040
.PHONY: all commands wasm wasm-opt-check host test clean patch-std patch-check vendor patch-vendor vendor-patch-check size-report install c-wasm codex
4141

42-
all: wasm host
42+
all: wasm
4343

4444
# Build EVERYTHING that lands in COMMANDS_DIR: all Rust commands (+ codex when
4545
# the fork is present), then the opted-in C commands (curl, wget, sqlite3, zip,
@@ -295,37 +295,12 @@ size-report:
295295
echo "Unique crates: $$TOTAL"
296296

297297
# Install standalone binaries to a custom directory
298-
install:
299-
@if [ -z "$(DESTDIR)" ]; then \
300-
echo "Usage: make install DESTDIR=/path/to/commands"; \
301-
exit 1; \
302-
fi
303-
@if [ ! -d "$(COMMANDS_DIR)" ]; then \
304-
echo "Error: $(COMMANDS_DIR) not found. Run 'make wasm' first."; \
305-
exit 1; \
306-
fi
307-
@mkdir -p $(DESTDIR)
308-
@cp -a $(COMMANDS_DIR)/* $(DESTDIR)/
309-
@echo "Installed to $(DESTDIR)"
310298

311299
# Build C programs to WASM (downloads wasi-sdk if needed)
312-
c-wasm:
313-
$(MAKE) -C c programs
314300

315-
host:
316-
@if [ -f host/package.json ]; then \
317-
echo "Building JS host runtime..."; \
318-
cd host && npm run build; \
319-
else \
320-
echo "Error: host/package.json not found"; \
321-
exit 1; \
322-
fi
323301

324302
test:
325303
cargo test --workspace
326-
@if [ -f host/package.json ]; then \
327-
cd host && npm test; \
328-
fi
329304

330305
clean:
331306
cargo clean

registry/native/scripts/patch-vendor.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,16 @@ for CRATE_DIR in $CRATE_DIRS; do
117117
patch -p1 -d "$VENDOR_CRATE" < "$PATCH" > /dev/null 2>&1
118118
echo "reapplied"
119119
else
120-
echo "FAIL (does not apply)"
121-
FAILED=$((FAILED + 1))
120+
# Mixed state (e.g. an interrupted earlier run left some
121+
# hunks applied): apply the remaining hunks, tolerating
122+
# already-applied ones; fail only on genuine rejects.
123+
OUT=$(patch -p1 -N -r /dev/null -d "$VENDOR_CRATE" < "$PATCH" 2>&1); RC=$?
124+
if [ $RC -le 1 ] && ! echo "$OUT" | grep -q "FAILED"; then
125+
echo "converged (mixed state)"
126+
else
127+
echo "FAIL (does not apply)"
128+
FAILED=$((FAILED + 1))
129+
fi
122130
fi
123131
;;
124132
reverse)

0 commit comments

Comments
 (0)