fix(argo): force-checkout in ensure-binary to handle dirty Cargo.lock

The cargo-target-cuda PVC persists `$BUILD` across runs. cargo build
mutates Cargo.lock, so the next run's `git checkout $SHA` fails with
"Your local changes to the following files would be overwritten by
checkout: Cargo.lock". Same pattern alpha-perception-template uses
(`git checkout --force $SHA; git clean -fd`) handles this cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-05-19 18:17:35 +02:00
parent ba2850b448
commit 1a9cf80b8e

View File

@@ -216,7 +216,13 @@ spec:
echo "=== Cache MISS: compiling fxt-backtest for $SHORT_SHA ==="
if [ -d "$BUILD/.git" ]; then
cd "$BUILD"; git fetch origin; git checkout "$SHA"
# Same pattern as alpha-perception-template.yaml: prior
# cargo build mutates Cargo.lock (and sometimes other
# generated files); --force checkout overwrites them,
# `git clean -fd` drops untracked. Without this, the
# second SHA's checkout fails on dirty working tree.
cd "$BUILD"; git fetch origin
git checkout --force "$SHA"; git clean -fd
else
git clone --filter=blob:none "$REPO" "$BUILD"
cd "$BUILD"; git checkout "$SHA"