-
Notifications
You must be signed in to change notification settings - Fork 350
Open
Description
Summary
The Supabase CLI binary is significantly larger than necessary due to several heavyweight dependencies that are used for minimal functionality. I've identified three dependencies that collectively add ~50MB to the binary while providing very little actual value.
Analysis
| Dependency | Transitive Deps | Used For | Proposed Solution |
|---|---|---|---|
github.com/containers/common |
130+ | Single error constant (ErrNetworkExists) |
Inline stub |
github.com/ethereum/go-ethereum |
50+ | secp256k1.S256() curve |
Use decred/dcrd/dcrec/secp256k1 directly |
github.com/docker/compose/v2 |
195+ | service.Pull() for image pulling |
Direct Docker API calls |
Measurements
Testing with Go 1.22+ on Linux amd64:
| Metric | Before | After | Reduction |
|---|---|---|---|
| Binary size | ~96 MB | ~48 MB | 50% |
| Indirect deps in go.sum | 396 | 309 | 87 packages |
| Build time | ~3m | ~2m | ~33% |
Notable removed transitive dependencies
k8s.io/api,k8s.io/client-go(pulled in via compose)github.com/aws/aws-sdk-go-v2/*github.com/docker/buildxgithub.com/moby/buildkit
Proposed PRs
I'd like to submit this as three separate PRs, ordered by risk/complexity:
- Replace
containers/commonwith stub - Trivial change, ~15 lines - Replace
go-ethereumwith lightweight stub - Small change, ~30 lines - Replace
docker/compose/v2with direct Docker API - Medium change, ~50 lines
Questions for maintainers
Before I submit PRs:
- Is there a reason
docker/compose/v2is preferred over direct Docker API calls? Any planned features that would require it? - Are there other uses of these dependencies I might have missed?
- Any concerns with the
decred/dcrd/dcrec/secp256k1library as a replacement for go-ethereum's curve implementation?
Happy to discuss the approach or provide more details.
Metadata
Metadata
Assignees
Labels
No labels