Files
rust/.claude-test.sh
T
jason d0b2477dad
Build and Push / build (push) Failing after 3s
🐛 Fix entrypoint hang and lost-interpreter bugs 🐛
- rootfs/usr/local/bin/entrypoint.sh:
  1. The "start all services" gate
     (`if [ "$START_SERVICES" = "yes" ] || [ -z "$1" ]`) always evaluated
     true on a first-run container regardless of $1, because
     START_SERVICES is force-set to "yes" whenever no PID file exists yet.
     Any command passed to `docker run` — `exec ...`, `sh -c ...`,
     `shell`, or an arbitrary program — was swallowed into the
     service-start+monitor branch before reaching the `case "$1"`
     statement that already handles those subcommands, hanging the
     container as a daemon instead of running the given command. Changed
     the condition to `if [ -z "$1" ]` so the daemon branch only fires
     when no command was given at all.
  2. The `*/bin/sh | */bin/bash | bash | sh | shell)` case branch
     unconditionally shifted $1 before `__exec_command "$@"` (a bare
     `exec "$@"`). For `docker run image sh -c 'cmd'` this turned the
     exec into `exec -c cmd` (command not found, exit 127) instead of
     `exec sh -c 'cmd'`. Split the branch: real interpreter names
     (*/bin/sh, */bin/bash, bash, sh) now pass through unshifted; the
     "shell" keyword (not a real interpreter) gets its own branch that
     shifts and prepends "sh" to any remaining args, or falls back to a
     bare `__exec_command` (exec bash -l) when none remain.
  Verified `bash -n` passes. Found and fixed upstream in
  dockersrc/go, confirmed identical in this repo's generated
  entrypoint.sh, and mechanically applied here with the same patch.
2026-07-27 23:16:39 -04:00

29 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
set -x
echo "== rustc =="; rustc --version
echo "== cargo =="; cargo --version
echo "== rustfmt =="; rustfmt --version
echo "== clippy =="; cargo clippy --version
echo "== just =="; just --version
echo "== sccache =="; sccache --version
echo "== cargo-nextest =="; cargo nextest --version
echo "== cargo-audit =="; cargo audit --version
echo "== cargo-binstall =="; cargo binstall --version
echo "== targets installed =="; rustup target list --installed
echo "== nightly + miri =="; rustup run nightly rustc --version; cargo +nightly miri --version
echo "== cross compile aarch64-musl hello world =="
mkdir -p /tmp/hello && cd /tmp/hello
cat > Cargo.toml <<'EOF'
[package]
name = "hello"
version = "0.1.0"
edition = "2021"
EOF
mkdir -p src
echo 'fn main() { println!("hello cross"); }' > src/main.rs
cargo build --release --target aarch64-unknown-linux-musl
file target/aarch64-unknown-linux-musl/release/hello
echo "== rust-workflow help =="
rust-workflow --help 2>&1 | head -20 || echo "rust-workflow not found or errored"
echo "== ALL DONE =="