From e4ef80b76e1f605243713d20b2839b16e57f8a5e Mon Sep 17 00:00:00 2001 From: sergio Date: Sun, 5 Jul 2026 05:31:58 -0400 Subject: [PATCH] =?UTF-8?q?Etapa=20G=20(go):=20cosecha=2020=20+=20syft/tra?= =?UTF-8?q?efik=20promovidos=20a=20mano=20(pack=20fallaba:=20patches=20no?= =?UTF-8?q?=20viajaban=20a=20recipes/=20=E2=80=94=20fix=20en=20harvest-go)?= =?UTF-8?q?=20+=20pre-check=20por=20name=20interno=20del=20TOML=20(exporte?= =?UTF-8?q?rs)=20+=20re-cola=20crossplane-cli/fabric-ai/oh-my-posh=20con?= =?UTF-8?q?=20fixes=20(alias=20crossplane,=20./cmd/fabric,=20-o=20oh-my-po?= =?UTF-8?q?sh)=20+=20logs=20por-cola=20en=20build-farm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- recipes/disable-update-check.patch | 11 +++ .../incoming-go}/crossplane-cli.toml | 1 - .../incoming-go}/fabric-ai.toml | 3 +- .../incoming-go}/oh-my-posh.toml | 12 ++- recipes/logs_tests.patch | 99 +++++++++++++++++++ .../syft.toml | 0 .../traefik.toml | 0 scripts/build-farm.sh | 5 +- scripts/farm/harvest-go.sh | 19 +++- 9 files changed, 140 insertions(+), 10 deletions(-) create mode 100644 recipes/disable-update-check.patch rename {tandas/needs-review-weekend => recipes/incoming-go}/crossplane-cli.toml (81%) rename {tandas/needs-review-weekend => recipes/incoming-go}/fabric-ai.toml (79%) rename {tandas/needs-review-weekend => recipes/incoming-go}/oh-my-posh.toml (57%) create mode 100644 recipes/logs_tests.patch rename {tandas/needs-review-weekend => recipes}/syft.toml (100%) rename {tandas/needs-review-weekend => recipes}/traefik.toml (100%) diff --git a/recipes/disable-update-check.patch b/recipes/disable-update-check.patch new file mode 100644 index 00000000..696b6542 --- /dev/null +++ b/recipes/disable-update-check.patch @@ -0,0 +1,11 @@ +--- a/cmd/syft/internal/options/update_check.go ++++ b/cmd/syft/internal/options/update_check.go +@@ -8,7 +8,7 @@ type UpdateCheck struct { + + func DefaultUpdateCheck() UpdateCheck { + return UpdateCheck{ +- CheckForAppUpdate: true, ++ CheckForAppUpdate: false, + } + } + diff --git a/tandas/needs-review-weekend/crossplane-cli.toml b/recipes/incoming-go/crossplane-cli.toml similarity index 81% rename from tandas/needs-review-weekend/crossplane-cli.toml rename to recipes/incoming-go/crossplane-cli.toml index 41b6bcf9..2121de09 100644 --- a/tandas/needs-review-weekend/crossplane-cli.toml +++ b/recipes/incoming-go/crossplane-cli.toml @@ -1,4 +1,3 @@ -# REVIEW 2026-07-05T09:27:46Z: binario instalado='crossplane' ≠ esperado='crank' (detect_go_main eligió otro main); fijar flags=["./cmd/crank"] # Importada de nixpkgs por `hammer import-nix` (Etapa G). PUNTO DE PARTIDA, no final: # - el build usa el lab de hammer (zig-cc / musl estático), NO el stdenv de nix ⇒ revisá # compiler/link/phases y adaptá hasta que compile. diff --git a/tandas/needs-review-weekend/fabric-ai.toml b/recipes/incoming-go/fabric-ai.toml similarity index 79% rename from tandas/needs-review-weekend/fabric-ai.toml rename to recipes/incoming-go/fabric-ai.toml index a3264105..5af2afb8 100644 --- a/tandas/needs-review-weekend/fabric-ai.toml +++ b/recipes/incoming-go/fabric-ai.toml @@ -1,4 +1,3 @@ -# REVIEW 2026-07-05T09:27:46Z: binario instalado='code2context' ≠ esperado='fabric' (detect_go_main eligió otro main); fijar flags=["./cmd/fabric"] # Importada de nixpkgs por `hammer import-nix` (Etapa G). PUNTO DE PARTIDA, no final: # - el build usa el lab de hammer (zig-cc / musl estático), NO el stdenv de nix ⇒ revisá # compiler/link/phases y adaptá hasta que compile. @@ -14,7 +13,7 @@ commit = "a420eaf63c532094eb12bc90c91a227401e96c31" compiler = "zig-cc" target = "x86_64-linux-musl" link = "static" -flags = [] +flags = ["./cmd/fabric"] # buildInputs de nix (no usados con CGO off): go [deps] diff --git a/tandas/needs-review-weekend/oh-my-posh.toml b/recipes/incoming-go/oh-my-posh.toml similarity index 57% rename from tandas/needs-review-weekend/oh-my-posh.toml rename to recipes/incoming-go/oh-my-posh.toml index f529c5ed..b8de2d55 100644 --- a/tandas/needs-review-weekend/oh-my-posh.toml +++ b/recipes/incoming-go/oh-my-posh.toml @@ -1,4 +1,3 @@ -# REVIEW 2026-07-05T09:27:48Z: binario instalado='src' ≠ esperado='oh-my-posh' (detect_go_main eligió otro main); fijar flags=["./cmd/oh-my-posh"] # Importada de nixpkgs por `hammer import-nix` (Etapa G). PUNTO DE PARTIDA, no final: # - el build usa el lab de hammer (zig-cc / musl estático), NO el stdenv de nix ⇒ revisá # compiler/link/phases y adaptá hasta que compile. @@ -20,3 +19,14 @@ subdir = "src" # buildInputs de nix (no usados con CGO off): go [deps] build = ["go"] + +[build.phases] +# = el compile Go generado por el lab, pero con `go build -o`: con el módulo en subdir +# src/, `go install .` nombra el binario por la base del import path ⇒ instalaba "src". +compile = ''' +cd src +export GOCACHE=/src/.gocache GOTMPDIR=/src/.gotmp GOPATH=/tmp/gopath GOTOOLCHAIN=local CGO_ENABLED=0 GOFLAGS=-mod=vendor GOPROXY=off +mkdir -p /src/.gotmp /out/usr/bin +go build -trimpath -ldflags=-buildid= -o /out/usr/bin/oh-my-posh . +''' +install = "true" diff --git a/recipes/logs_tests.patch b/recipes/logs_tests.patch new file mode 100644 index 00000000..9b3cd19d --- /dev/null +++ b/recipes/logs_tests.patch @@ -0,0 +1,99 @@ +diff --git a/pkg/observability/logs/aws_test.go b/pkg/observability/logs/aws_test.go +index 36a970d..b315f8b 100644 +--- a/pkg/observability/logs/aws_test.go ++++ b/pkg/observability/logs/aws_test.go +@@ -21,5 +21,5 @@ func TestNewAWSWrapper(t *testing.T) { + + logger.Logf(logging.Debug, "%s", "foo") + +- assert.Equal(t, " DBG aws_test.go:22 > foo\n", buf.String()) ++ assert.Equal(t, " DBG github.com/traefik/traefik/v3/pkg/observability/logs/aws_test.go:22 > foo\n", buf.String()) + } +diff --git a/pkg/observability/logs/datadog_test.go b/pkg/observability/logs/datadog_test.go +index 41c6df4..47eadad 100644 +--- a/pkg/observability/logs/datadog_test.go ++++ b/pkg/observability/logs/datadog_test.go +@@ -20,5 +20,5 @@ func TestNewDatadogLogger(t *testing.T) { + + logger.Log("foo") + +- assert.Equal(t, " DBG datadog_test.go:21 > foo\n", buf.String()) ++ assert.Equal(t, " DBG github.com/traefik/traefik/v3/pkg/observability/logs/datadog_test.go:21 > foo\n", buf.String()) + } +diff --git a/pkg/observability/logs/elastic_test.go b/pkg/observability/logs/elastic_test.go +index e00604d..16e1304 100644 +--- a/pkg/observability/logs/elastic_test.go ++++ b/pkg/observability/logs/elastic_test.go +@@ -20,5 +20,5 @@ func TestNewElasticLogger(t *testing.T) { + + logger.Errorf("foo") + +- assert.Equal(t, " ERR elastic_test.go:21 > foo\n", buf.String()) ++ assert.Equal(t, " ERR github.com/traefik/traefik/v3/pkg/observability/logs/elastic_test.go:21 > foo\n", buf.String()) + } +diff --git a/pkg/observability/logs/gokit_test.go b/pkg/observability/logs/gokit_test.go +index 791157b..7531651 100644 +--- a/pkg/observability/logs/gokit_test.go ++++ b/pkg/observability/logs/gokit_test.go +@@ -20,5 +20,5 @@ func TestNewGoKitWrapper(t *testing.T) { + + _ = logger.Log("foo") + +- assert.Equal(t, " DBG gokit_test.go:21 > foo\n", buf.String()) ++ assert.Equal(t, " DBG github.com/traefik/traefik/v3/pkg/observability/logs/gokit_test.go:21 > foo\n", buf.String()) + } +diff --git a/pkg/observability/logs/hclog_test.go b/pkg/observability/logs/hclog_test.go +index 02681d7..50fe5e2 100644 +--- a/pkg/observability/logs/hclog_test.go ++++ b/pkg/observability/logs/hclog_test.go +@@ -20,5 +20,5 @@ func TestNewRetryableHTTPLogger(t *testing.T) { + + logger.Info("foo") + +- assert.Equal(t, " INF hclog_test.go:21 > Foo\n", buf.String()) ++ assert.Equal(t, " INF github.com/traefik/traefik/v3/pkg/observability/logs/hclog_test.go:21 > Foo\n", buf.String()) + } +diff --git a/pkg/observability/logs/instana_test.go b/pkg/observability/logs/instana_test.go +index 38b53f2..dc758f0 100644 +--- a/pkg/observability/logs/instana_test.go ++++ b/pkg/observability/logs/instana_test.go +@@ -20,5 +20,5 @@ func TestNewInstanaLogger(t *testing.T) { + + logger.Info("foo") + +- assert.Equal(t, " INF instana_test.go:21 > foo\n", buf.String()) ++ assert.Equal(t, " INF github.com/traefik/traefik/v3/pkg/observability/logs/instana_test.go:21 > foo\n", buf.String()) + } +diff --git a/pkg/observability/logs/log_test.go b/pkg/observability/logs/log_test.go +index 5c80e76..26fd44a 100644 +--- a/pkg/observability/logs/log_test.go ++++ b/pkg/observability/logs/log_test.go +@@ -20,5 +20,5 @@ func TestNoLevel(t *testing.T) { + + logger.Info().Msg("foo") + +- assert.Equal(t, " INF log_test.go:21 > foo\n", buf.String()) ++ assert.Equal(t, " INF github.com/traefik/traefik/v3/pkg/observability/logs/log_test.go:21 > foo\n", buf.String()) + } +diff --git a/pkg/observability/logs/logrus_test.go b/pkg/observability/logs/logrus_test.go +index af3c085..d30889a 100644 +--- a/pkg/observability/logs/logrus_test.go ++++ b/pkg/observability/logs/logrus_test.go +@@ -20,5 +20,5 @@ func TestNewLogrusStdWrapper(t *testing.T) { + + logger.Println("foo") + +- assert.Equal(t, " DBG logrus_test.go:21 > foo\n", buf.String()) ++ assert.Equal(t, " DBG github.com/traefik/traefik/v3/pkg/observability/logs/logrus_test.go:21 > foo\n", buf.String()) + } +diff --git a/pkg/observability/logs/oxy_test.go b/pkg/observability/logs/oxy_test.go +index 5645986..26f915c 100644 +--- a/pkg/observability/logs/oxy_test.go ++++ b/pkg/observability/logs/oxy_test.go +@@ -20,5 +20,5 @@ func TestNewOxyWrapper(t *testing.T) { + + logger.Info("foo") + +- assert.Equal(t, " INF oxy_test.go:21 > foo\n", buf.String()) ++ assert.Equal(t, " INF github.com/traefik/traefik/v3/pkg/observability/logs/oxy_test.go:21 > foo\n", buf.String()) + } diff --git a/tandas/needs-review-weekend/syft.toml b/recipes/syft.toml similarity index 100% rename from tandas/needs-review-weekend/syft.toml rename to recipes/syft.toml diff --git a/tandas/needs-review-weekend/traefik.toml b/recipes/traefik.toml similarity index 100% rename from tandas/needs-review-weekend/traefik.toml rename to recipes/traefik.toml diff --git a/scripts/build-farm.sh b/scripts/build-farm.sh index c5d57b88..aeba93d3 100755 --- a/scripts/build-farm.sh +++ b/scripts/build-farm.sh @@ -27,7 +27,10 @@ HAMMER="${HAMMER:-$ROOT/target/release/hammer}" PROMOTE="${PROMOTE:-1}" JOBS="${JOBS:-$(( $(nproc) - 2 ))}"; [ "$JOBS" -ge 1 ] || JOBS=1 -FARM="$ROOT/work/farm" +# Un subdir POR COLA: el worker-loop corre varias colas en serie por ciclo y con un dir compartido +# la cola siguiente PISA los logs/status de la anterior (imposible diagnosticar fallos de la fase go +# tras la fase clib). basename de $QUEUE ⇒ work/farm/incoming-go/{log,status}, etc. +FARM="$ROOT/work/farm/$(basename "$QUEUE")" rm -rf "$FARM"; mkdir -p "$FARM/log" "$FARM/status" queue=$(ls "$QUEUE"/*.toml 2>/dev/null || true) diff --git a/scripts/farm/harvest-go.sh b/scripts/farm/harvest-go.sh index bdeb4782..132d2d5e 100755 --- a/scripts/farm/harvest-go.sh +++ b/scripts/farm/harvest-go.sh @@ -78,10 +78,15 @@ for f in "$QUEUE"/*.toml; do [ -e "$f" ] || { echo "$(STAMP) cola vacía"; break; } n=$(basename "$f" .toml) + # El artefacto del store se llama por el `name` INTERNO de la receta, que puede diferir del nombre + # del fichero (prometheus-blackbox-exporter.toml → name="blackbox_exporter"); sin esto el pre-check + # nunca los ve y quedan "no-sellados" para siempre. + rn=$(sed -n 's/^name *= *"\(.*\)".*/\1/p' "$f" | head -1); [ -n "$rn" ] || rn="$n" + # Pre-check BARATO: ¿el worker selló algo para este nombre? (tras el rsync el store local lo tiene). # Sin esto, `hammer build` de una receta NO sellada ARRANCARÍA un build local (vendor+compile) y lo - # mataría el timeout ⇒ CPU del hub desperdiciada cada cosecha. Si no hay seal `*-`, salto ya. - ls "$STORE"/*-"$n" >/dev/null 2>&1 || { skipped="$skipped $n"; continue; } + # mataría el timeout ⇒ CPU del hub desperdiciada cada cosecha. Si no hay seal `*-`, salto ya. + ls "$STORE"/*-"$rn" >/dev/null 2>&1 || { skipped="$skipped $n"; continue; } # ¿sellada con el hash ACTUAL? cache-hit instantáneo imprime el hash; un build real (hash distinto, # raro) se pasa del timeout ⇒ skip (no compilamos en el hub). @@ -100,14 +105,14 @@ for f in "$QUEUE"/*.toml; do argo-rollouts) want=kubectl-argo-rollouts ;; step-cli) want=step ;; soft-serve) want=soft ;; go-mockery) want=mockery ;; temporal-cli) want=temporal ;; seaweedfs) want=weed ;; go-migrate) want=migrate ;; jsonnet-bundler) want=jb ;; fabric-ai) want=fabric ;; - crossplane-cli) want=crank ;; - *) want="$n" ;; + crossplane-cli) want=crossplane ;; + *) want="$rn" ;; # def: el name interno de la receta (== binario en la vía Go auto) esac # SMOKE-TEST: el seal debe instalar un binario cuyo nombre == $want. Si instaló otro (un helper: # functional-test, protoc-gen-buf-lint, gosecutil…), detect_go_main eligió mal el main ⇒ NO es la # herramienta correcta aunque "corra" → a REVIEW (no firmamos un binario equivocado). Lección eksctl. - d="$STORE/${H#b3:}-$n" + d="$STORE/${H#b3:}-$rn" allbins=$(find "$d" -type f -path '*/bin/*' -perm -100 2>/dev/null) bin=$(printf '%s\n' "$allbins" | while read -r b; do [ "$(basename "$b")" = "$want" ] && { echo "$b"; break; }; done) if [ -z "$bin" ]; then @@ -131,6 +136,10 @@ for f in "$QUEUE"/*.toml; do echo "$(STAMP) ✓ smoke $n (bin=$bn static=$isstatic): ${out%% *}" mv "$f" "recipes/$n.toml" + # los patches VIAJAN con la receta (lección 4517a98, faltaba acá): pack los lee de recipes/ + for p in $(sed -n 's/^patches *= *\[\(.*\)\]/\1/p' "recipes/$n.toml" | tr -d '",' ); do + [ -f "$QUEUE/$p" ] && cp -n "$QUEUE/$p" "recipes/$p" + done if "$HAMMER" --store "$STORE" pack "recipes/$n.toml" --repo "$REPO" --distro-version "$DISTRO" --build >/dev/null 2>&1; then promoted="$promoted $n" else