-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build GitHub Releases with tinygo
#665
Comments
I experimented with Most of the bloat in the published binaries comes from the SQL drivers, since the pre-built goose binary aims to support all of them. However, you can reduce the resulting binary size by using the exclusive build tags: https://pressly.github.io/goose/installation/#building-from-source (a bit out-of-date, will update) binary only, no driversgo build \
-ldflags="-s -w" \
-tags='no_postgres no_sqlite3 no_clickhouse no_mssql no_mysql no_vertica no_ydb' \
-o goose ./cmd/goose
3.6M ./goose sqlite driver only (modernc.org/sqlite)# target only sqlite
go build \
-ldflags="-s -w" \
-tags='no_postgres no_clickhouse no_mssql no_mysql no_vertica no_ydb' \
-o goose ./cmd/goose
7.2M ./goose postgres driver only (github.com/jackc/pgx/v5/stdlib)go build \
-ldflags="-s -w" \
-tags='no_sqlite3 no_clickhouse no_mssql no_mysql no_vertica no_ydb' \
-o goose ./cmd/goose
10M ./goose full binary, all drivers
|
Fwiw I'd love to reduce the resulting binary size, which will inevitably grow over time as more drivers are added. I acknowledge it's not great, but I also don't have a good answer for this at the moment. |
Those file sizes are dang huge for something that just reads text files in lexicographical order, connects to a DB, and execs them.
Especially for a tool that is needed as part of ci/cd.
Would you consider building with
tinygo
?(it drops the advanced garbage collector for a much simpler one, but otherwise implements the same API)
Example:
The text was updated successfully, but these errors were encountered: