-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Description
First off, thanks so much for the addition of the flake.nix to the repo. It's been a monumental piece of work that I absolutely rely on.
However, I've noticed that the package built from the flake.nix takes up over 4GB of space.
Below is an AI generated report that may be helpful.
Summary
The OpenCode package is 4.0 GiB, which is excessive. Investigation shows that all platform-specific optional dependencies are being bundled instead of just the required platform.
Environment
- OpenCode version: v1.0.119
- Package manager: Bun
- Platform: Linux x64
- Installation: Via Nix flake from
github:sst/opencode
Issue Details
The OpenCode Nix store package is 4.0 GiB:
$ nix path-info -Sh github:sst/opencode
/nix/store/q3p8pk2qk3ydsi2fdvnjl6raiydwdgyi-opencode-1.0.119 4.0 GiBNearly all of this size (4.2GB) comes from node_modules/.bun/ containing platform-specific binaries for all platforms instead of just Linux x64.
Breakdown of Bloat
Platform-specific binaries (only Linux x64 needed, but all platforms included):
-
SST binaries: ~470MB total (6 platforms)
sst-darwin-arm64: 77Msst-darwin-x64: 82Msst-linux-arm64: 75Msst-linux-x64: 80M ✅ (only one needed)sst-win32-arm64: 75Msst-win32-x64: 81M
-
Cloudflare Workerd: ~500MB total (5 platforms)
@cloudflare/workerd-darwin-64: 99M@cloudflare/workerd-darwin-arm64: 95M@cloudflare/workerd-linux-64: 112M ✅ (only one needed)@cloudflare/workerd-linux-arm64: 116M@cloudflare/workerd-windows-64: 80M
-
Pagefind: ~390MB total (6 platforms)
@pagefind/darwin-arm64: 63M@pagefind/darwin-x64: 63M@pagefind/freebsd-x64: 66M@pagefind/linux-arm64: 65M@pagefind/linux-x64: 66M ✅ (only one needed)@pagefind/windows-x64: 63M
-
Turbo: ~200MB total (6 platforms)
turbo-darwin-64: 31Mturbo-darwin-arm64: 27Mturbo-linux-64: 33M ✅ (only one needed)turbo-linux-arm64: 29Mturbo-windows-64: 39Mturbo-windows-arm64: 39M
Other large dependencies:
@ibm/plexfonts: 203MBaws-sdk: 101MBcloudflare: 53MBthree: 32MB
Total: 1,898 packages in node_modules/.bun/