carlos / platform Public

carlos binary doubled to 74.5 MB: the EC2 SDK client via internal/awsinv closed

The linux-arm64 carlos binary grew from 36.5 MB (40b6f50c) to 74.5 MB stripped (origin/main 43da77c2), measured with the same toolchain (go1.26.5, -s -w).

Cause: the AWS SDK's symbols went from 6.0 MB to 23.5 MB. The EC2 client alone is 14.3 MB, now linked into the main binary through internal/awsinv (#267 credentials and inventory work). IAM, route53, acm and sns add more.

The binary is what every box downloads and stages, and plan 4's version store keeps several builds per box. Worth trimming: either move the inventory into a separate tool or build-tagged command, or replace the few EC2 calls with direct signed requests.

Found during the zero-downtime dev-box checks. Not blocking anything.

Fixed: squash-merged to main from fix-binary-size-275. linux/arm64 -s -w went from 77.7 MB to 45.8 MB (CI measured 45,809,826 bytes).

Cause. html/template puts the linker into its method-retention mode, which keeps every exported method of any concrete type stored in an interface. awsinv, alerting, memwatch, route53dns and steering stored AWS SDK clients (EC2, IAM, ACM, Route53, SNS, CloudWatch and others) in narrow interfaces. That kept all of their methods: EC2 alone was 14 MB, including RunInstances and TerminateInstances, which nothing calls.

Fix. Those sites now store method values (func fields), so the same calls run but the methods nothing calls are no longer kept. S3 and STS stay whole, because the SDK converts them to interfaces internally and wrapping them saved nothing.

Guard. .amadan/ci.d/20-cross@5 now measures the stripped linux/arm64 binary and fails above 52,000,000 bytes, naming this cause. The guard itself was reviewed by Astra: it fails closed if the binary can't be read. Census: census-ruling-275, envelope-only (platform-1e).