# cargo-edit 0.13.11 — cargo add/rm/upgrade/set-version. Etapa G, tier CLI Rust. # Caso especial: produce 4 bins (gated por las features default add/rm/upgrade/set-version) y NO # hay un bin `cargo-edit`. El path default del lab usa `cargo rustc -- ` que exige UN único # target ⇒ inservible para multi-bin. Por eso una fase compile custom que REPLICA el setup estático # del lab (wrapper .hammer-zig-cc que reescribe --target + crt-static) pero con `cargo build` (todos # los bins). crt-static va TRAS `cargo rustc --` (sólo el bin top), NUNCA en RUSTFLAGS: ahí alcanza # a los proc-macros (clap_derive) y rustc aborta ("cannot produce proc-macro ... crt-static"). Como # `cargo rustc --` exige un único target, itero los 4 bins. El install lo auto-genera el lab. name = "cargo-edit" version = "0.13.11" license = "Apache-2.0 OR MIT" [source] repo = "https://github.com/killercup/cargo-edit" commit = "98d58b713cb9a7715c01053dbd36cb84f3be1e4f" [build] compiler = "zig-cc" target = "x86_64-linux-musl" link = "static" flags = [] [build.phases] compile = ''' printf '%s\n' '#!/bin/sh' 'for a do' 'case "$a" in --target=*) a=--target=x86_64-linux-musl ;; esac' 'set -- "$@" "$a"' 'shift' 'done' 'exec zig cc -mcpu=baseline "$@"' > "$PWD/.hammer-zig-cc" chmod +x "$PWD/.hammer-zig-cc" RF="-C linker=$PWD/.hammer-zig-cc" rustc -vV | grep -q 'host: .*-alpine-' || RF="$RF -C link-self-contained=no" for b in cargo-add cargo-rm cargo-upgrade cargo-set-version; do CC=gcc CXX=g++ AR=ar RUSTFLAGS="$RF" cargo rustc --release --locked --bin "$b" -- -C target-feature=+crt-static -C relocation-model=static done '''