Skip to content

A 22 MiB compiled binary is tracked in git at lambda/autoscale-orchestrator/autoscale-orchestrator #637

Closed

Description

@scttfrdmn

Found while working #625: running go build ./... in that module to verify a go mod tidy rewrote a tracked binary, and the change landed in a commit as a 23 MB diff. I restored it to main's bytes rather than fold the cleanup into that PR.

The state

$ git ls-files lambda/ | while read f; do file "$f" | grep -q ELF && echo "$f"; done
lambda/autoscale-orchestrator/autoscale-orchestrator   # 22.4 MiB

It is the only tracked lambda binary. Every other lambda's build output is ignored:

# Lambda build artifacts
lambda/*/bootstrap
lambda/*/function.zip
lambda/*.zip
lambda/*/*.zip          # added in #635
# Lambda compiled binaries (named after their function)
lambda/alert-evaluator/alert-evaluator
…

lambda/autoscale-orchestrator/autoscale-orchestrator is absent from that list, so it is tracked and mutable.

Why it matters

  • Anyone who builds in that directory dirties the repo, and git add -A then commits a 22 MB binary. That is a trap for exactly the routine action (go build ./...) that CI itself performs on every lambda module.
  • It is already in history, so every clone pays for it. Removing it from HEAD stops the bleeding but does not shrink the repo; that would need a history rewrite, which is almost certainly not worth it.
  • A committed binary is unverifiable: nothing ties those bytes to a commit, and scripts/check-release-version.sh exists precisely because a binary that reports the wrong thing is hard to notice.

Suggested

  1. git rm --cached lambda/autoscale-orchestrator/autoscale-orchestrator and add it to .gitignore alongside the other named binaries — or better, generalise the pattern so a new lambda cannot reintroduce the problem (the existing list is per-function and has to be extended by hand each time).
  2. If some deploy step reads that path, point it at a build instead; worth checking before deleting, since the file being tracked at all suggests something may have depended on it.
  3. Optionally a test asserting no tracked file under lambda/ is an ELF/Mach-O binary — the same shape as the other repo gates, and it would have caught this.

Low urgency, but it is a live footgun: I triggered it by accident doing something entirely ordinary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions