Etapa G frente Go: 10 recetas Go al corpus (repo 282->292) + fix GOWORK

Aplica el patron de amfora a la escoria Go. Build-yield 11/13:
- raiz: croc/gron/jump/gtrash/walk/qrcp (go build .)
- main en ./cmd/<x>: cheat/dnsx/dyff + miller (binario mlr)
Todos estaticos y corren (mlr 6.18.1, croc v10.4.4, cheat 4.5.0, ...).

fetch.rs: vendor_go_deps ahora setea GOWORK=off (go mod vendor aborta en
modo workspace si el arbol trae go.work).

Diferidas 2 (casos especiales): csvtk (go.mod en subdir, el vendor no corre
en /src) y git-town (go.work multimodulo -> inconsistent vendoring; necesita
go work vendor, no go mod vendor).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-26 05:06:21 -04:00
co-authored by Claude Opus 4.8
parent 4291b2adeb
commit 74d5ab0b78
11 changed files with 227 additions and 0 deletions
+3
View File
@@ -251,6 +251,9 @@ pub fn vendor_go_deps(src: &Path) -> hammer_core::Result<()> {
.args(["mod", "vendor"])
.env("GOFLAGS", "-mod=mod")
.env("GOTOOLCHAIN", "local")
// `go mod vendor` aborta en modo workspace (si el árbol trae go.work). Lo apagamos para
// vendorear contra el go.mod del módulo raíz (que es lo que el build compila).
.env("GOWORK", "off")
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.output()
+20
View File
@@ -0,0 +1,20 @@
# cheat — receta Go (Etapa G frente Go). main en ./cmd/cheat.
name = "cheat"
version = "4.5.0"
[source]
repo = "https://github.com/cheat/cheat"
commit = "cc85a4bdb104474e433313724d9b381bc5f6f6b0"
[build]
compiler = "zig-cc"
target = "x86_64-linux-musl"
link = "static"
[deps]
build = ["go"]
[build.phases]
configure = "true"
compile = "export GOCACHE=/tmp/gocache GOPATH=/tmp/gopath GOTOOLCHAIN=local CGO_ENABLED=0 GOFLAGS=-mod=vendor GOPROXY=off; go build -trimpath -ldflags=-buildid= -o /out/usr/bin/cheat ./cmd/cheat"
install = "true"
+24
View File
@@ -0,0 +1,24 @@
# 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.
# - las deps van con su nombre NIX; remapealas a las recetas del corpus si difieren.
name = "croc"
version = "10.4.4"
[source]
repo = "https://github.com/schollz/croc"
commit = "d225c8514f52b4335142394066b47bb0b70c8452"
[build]
compiler = "zig-cc"
target = "x86_64-linux-musl"
link = "static"
flags = []
[deps]
build = ["go"]
[build.phases]
configure = "true"
compile = "export GOCACHE=/tmp/gocache GOPATH=/tmp/gopath GOTOOLCHAIN=local CGO_ENABLED=0 GOFLAGS=-mod=vendor GOPROXY=off; go build -trimpath -ldflags=-buildid= -o /out/usr/bin/croc ."
install = "true"
+20
View File
@@ -0,0 +1,20 @@
# dnsx — receta Go (Etapa G frente Go). main en ./cmd/dnsx.
name = "dnsx"
version = "1.2.3"
[source]
repo = "https://github.com/projectdiscovery/dnsx"
commit = "fa3b1876a3b20f93b06fc76a0beaa11a9075e80b"
[build]
compiler = "zig-cc"
target = "x86_64-linux-musl"
link = "static"
[deps]
build = ["go"]
[build.phases]
configure = "true"
compile = "export GOCACHE=/tmp/gocache GOPATH=/tmp/gopath GOTOOLCHAIN=local CGO_ENABLED=0 GOFLAGS=-mod=vendor GOPROXY=off; go build -trimpath -ldflags=-buildid= -o /out/usr/bin/dnsx ./cmd/dnsx"
install = "true"
+20
View File
@@ -0,0 +1,20 @@
# dyff — receta Go (Etapa G frente Go). main en ./cmd/dyff.
name = "dyff"
version = "1.12.0"
[source]
repo = "https://github.com/homeport/dyff"
commit = "ea5d770b575967f1bc21eefcae08712d8f755e04"
[build]
compiler = "zig-cc"
target = "x86_64-linux-musl"
link = "static"
[deps]
build = ["go"]
[build.phases]
configure = "true"
compile = "export GOCACHE=/tmp/gocache GOPATH=/tmp/gopath GOTOOLCHAIN=local CGO_ENABLED=0 GOFLAGS=-mod=vendor GOPROXY=off; go build -trimpath -ldflags=-buildid= -o /out/usr/bin/dyff ./cmd/dyff"
install = "true"
+24
View File
@@ -0,0 +1,24 @@
# 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.
# - las deps van con su nombre NIX; remapealas a las recetas del corpus si difieren.
name = "gron"
version = "0.7.1"
[source]
repo = "https://github.com/tomnomnom/gron"
commit = "badf401da553eb41b7ffde4be6a64809ed0ed846"
[build]
compiler = "zig-cc"
target = "x86_64-linux-musl"
link = "static"
flags = []
[deps]
build = ["go"]
[build.phases]
configure = "true"
compile = "export GOCACHE=/tmp/gocache GOPATH=/tmp/gopath GOTOOLCHAIN=local CGO_ENABLED=0 GOFLAGS=-mod=vendor GOPROXY=off; go build -trimpath -ldflags=-buildid= -o /out/usr/bin/gron ."
install = "true"
+24
View File
@@ -0,0 +1,24 @@
# 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.
# - las deps van con su nombre NIX; remapealas a las recetas del corpus si difieren.
name = "gtrash"
version = "0.0.6"
[source]
repo = "https://github.com/umlx5h/gtrash"
commit = "460e0b73615c653eee8941a3dd43fc1465260a3a"
[build]
compiler = "zig-cc"
target = "x86_64-linux-musl"
link = "static"
flags = []
[deps]
build = ["go"]
[build.phases]
configure = "true"
compile = "export GOCACHE=/tmp/gocache GOPATH=/tmp/gopath GOTOOLCHAIN=local CGO_ENABLED=0 GOFLAGS=-mod=vendor GOPROXY=off; go build -trimpath -ldflags=-buildid= -o /out/usr/bin/gtrash ."
install = "true"
+24
View File
@@ -0,0 +1,24 @@
# 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.
# - las deps van con su nombre NIX; remapealas a las recetas del corpus si difieren.
name = "jump"
version = "0.67.0"
[source]
repo = "https://github.com/gsamokovarov/jump"
commit = "0e9fabf0c06a0c4f847081e7138b3478c3959dfd"
[build]
compiler = "zig-cc"
target = "x86_64-linux-musl"
link = "static"
flags = []
[deps]
build = ["go"]
[build.phases]
configure = "true"
compile = "export GOCACHE=/tmp/gocache GOPATH=/tmp/gopath GOTOOLCHAIN=local CGO_ENABLED=0 GOFLAGS=-mod=vendor GOPROXY=off; go build -trimpath -ldflags=-buildid= -o /out/usr/bin/jump ."
install = "true"
+20
View File
@@ -0,0 +1,20 @@
# miller — receta Go (Etapa G frente Go). main en ./cmd/mlr, binario `mlr`.
name = "miller"
version = "6.18.1"
[source]
repo = "https://github.com/johnkerl/miller"
commit = "22bed963460939d2c7482c9469a1ca7ed2ef8ffb"
[build]
compiler = "zig-cc"
target = "x86_64-linux-musl"
link = "static"
[deps]
build = ["go"]
[build.phases]
configure = "true"
compile = "export GOCACHE=/tmp/gocache GOPATH=/tmp/gopath GOTOOLCHAIN=local CGO_ENABLED=0 GOFLAGS=-mod=vendor GOPROXY=off; go build -trimpath -ldflags=-buildid= -o /out/usr/bin/mlr ./cmd/mlr"
install = "true"
+24
View File
@@ -0,0 +1,24 @@
# 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.
# - las deps van con su nombre NIX; remapealas a las recetas del corpus si difieren.
name = "qrcp"
version = "0.11.6"
[source]
repo = "https://github.com/claudiodangelis/qrcp"
commit = "4ed525205106afdf77f21347ee1aa21c385c1b85"
[build]
compiler = "zig-cc"
target = "x86_64-linux-musl"
link = "static"
flags = []
[deps]
build = ["go"]
[build.phases]
configure = "true"
compile = "export GOCACHE=/tmp/gocache GOPATH=/tmp/gopath GOTOOLCHAIN=local CGO_ENABLED=0 GOFLAGS=-mod=vendor GOPROXY=off; go build -trimpath -ldflags=-buildid= -o /out/usr/bin/qrcp ."
install = "true"
+24
View File
@@ -0,0 +1,24 @@
# 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.
# - las deps van con su nombre NIX; remapealas a las recetas del corpus si difieren.
name = "walk"
version = "1.13.0"
[source]
repo = "https://github.com/antonmedv/walk"
commit = "0c1a9c0dce2f1300b7848fa6e8cfd635377289b8"
[build]
compiler = "zig-cc"
target = "x86_64-linux-musl"
link = "static"
flags = []
[deps]
build = ["go"]
[build.phases]
configure = "true"
compile = "export GOCACHE=/tmp/gocache GOPATH=/tmp/gopath GOTOOLCHAIN=local CGO_ENABLED=0 GOFLAGS=-mod=vendor GOPROXY=off; go build -trimpath -ldflags=-buildid= -o /out/usr/bin/walk ."
install = "true"