Commit Graph

7 Commits

Author SHA1 Message Date
valknar d2bff00ee2 fix: prevent set -e crash when yq exits non-zero on IONOS
Two issues on IONOS shared hosting (very low ulimit -u):

1. bash 4.4+ propagates the exit code of command substitutions through
   `local var=$(cmd)`. When yq crashes (exit 2) the assignment itself
   returns 2, and set -e kills the script before any log message appears.
   Fixed by adding `|| return 0` to the yq wrapper so it always exits 0.

2. All ref_count comparisons checked for "null"/"0" but not for empty
   string. A yq call that produces no stdout (crashed but returned 0)
   leaves ref_count="", which neither guard caught — the arithmetic loop
   `i < ref_count` silently treated "" as 0 and skipped all references.
   Fixed by adding `[[ -z "$ref_count" ]]` to every ref_count guard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 23:10:55 +02:00
valknar 90f7b58a53 fix: reduce yq forks per reference from 6 to 1, silence git thread errors
parse_reference was calling yq 5-7 times per reference. With 8 refs
that's ~48 fork+exec calls in rapid succession, saturating IONOS's
ulimit -u and causing intermittent empty 'into' fields — libraries then
installed to the wrong .arty/libs/ location instead of their configured
path.

Collapse all field reads into a single yq expression per reference.

Also add 2>/dev/null to git fetch/pull so the "getaddrinfo() thread
failed to start" message (another ulimit hit, in git's DNS resolver)
doesn't spam the output — the warn message still fires on failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 22:59:40 +02:00
valknar 6d692cef57 fix: limit yq Go thread usage on hosts with low ulimit -u
IONOS shared hosting enforces a strict process limit. yq (a Go binary)
tries to spawn several OS threads at startup and crashes with
"failed to create new OS thread (errno=11 EAGAIN)" when the limit is
hit, returning empty stdout. This silently skips all references.

Wrap yq with GOMAXPROCS=1 GOGC=off so the Go runtime uses a single
goroutine-running thread and skips GC goroutines, staying within the
host's ulimit -u.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 22:52:35 +02:00
valknar 3153b6a24d fix: auto-detect terminal color support instead of forcing it
FORCE_COLOR defaulted to 1, emitting ANSI codes unconditionally. On SSH
sessions without a proper TTY or with TERM=dumb this caused color codes
to render text invisible. Now colors are enabled only when stdout is an
interactive terminal; FORCE_COLOR=1 can still override when needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 22:41:51 +02:00
valknar a4f1ba443d fix: route log output to stdout for SSH visibility
All log_* functions were writing to stderr, causing output to be
invisible in SSH sessions where stderr is not forwarded or captured.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 22:33:43 +02:00
valknar 8b4fa0dcb1 fix: replace corrupted bytes and respect remote default branch
Replace broken control characters and U+FFFD replacement characters in
log function labels with ASCII equivalents ([ok], [!], [x]).

Drop the hardcoded "main" default for git_ref so arty deps no longer
fails with "pathspec 'main' did not match" on repos whose default branch
is not named main — git clone already checks out the remote default branch.
A ref: value in arty.yml is still honoured when explicitly set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 22:15:18 +02:00
valknar 25617ce490 feat: add scripts/arty.sh 2026-03-30 19:40:37 +02:00