Repository navigation
Add a readium_nocloud build tag leaving out S3 and GCS - #338
Merged
Merged
Conversation
The core packages (archive, asset, fetcher, util/url) hold the S3 and
Google Cloud Storage support, so importing any of them links the AWS and
Google Cloud SDKs and gRPC, even for programs that only read local files
or HTTP. Building with `-tags readium_nocloud` now leaves them out. HTTP
support is unaffected.
Measured on a program opening an EPUB via
streamer.New(streamer.Config{}).Open(ctx, asset.File(u), ""):
- packages linked: 857 -> 330
- stripped binary: ARMv7 38.5 -> 13.2 MB, amd64 40.9 -> 13.7 MB
- peak RSS (VmHWM): 31 -> 12 MB
CI now also runs `go vet -tags readium_nocloud ./...`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
@ardeshirj Thanks for the contribution, it will be merged shortly. FYI If you're looking to reduce the size further, you can run an executable stripper for the appropriate platform, like |
ardeshirj
added a commit
to ardeshirj/shamsaink
that referenced
this pull request
Nov 16, 2026
…r trim retired Readium merged our build tag (readium/go-toolkit#338) and released it in v0.16.2. Every build takes -tags blitz,readium_nocloud; reader/nocloud.go stops a build without it. The ARMv7 reader is 25.71 MB (25.70 with our trim) and links no AWS, Google Cloud or gRPC module. CI no longer makes or caches the trimmed copy; trim-gotoolkit.sh stays for experiments 02 and 03. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed with the Readium team, here's the build tag as a PR.
Why:
archive,asset,fetcherandutil/urlcontain the S3/GCS support, so importing any of them links the AWS and Google Cloud SDKs and gRPC, even for programs that only read local files or HTTP. With-tags readium_nocloud, the S3/GCS files (archive_*,asset_*,fetcher_*andurl_remote.go) and their tests are excluded. HTTP support is unchanged, and default builds are unaffected.Measured on a program opening an EPUB via
streamer.New(streamer.Config{}).Open(ctx, asset.File(u), ""):Also: a README "Build tags" section, and a CI step that runs
go vet -tags readium_nocloud ./...so the tagged build stays compiling. Thes3Resource/gcsResourceEfficientStreamerassertions moved fromfetcher_http_test.gotofetcher_cloud_test.goso the HTTP tests build with the tag. No CHANGELOG entry, so you can word that yourselves.Motivation: ShamsaInk, an e-ink EPUB reader on ARMv7, currently strips these files with a script.
🤖 Generated with Claude Code