build: make UPX packing opt-in via COMPRESS env var#2429
Merged
Conversation
UPX is now disabled by default. Set COMPRESS=1 at build time to restore the previous behavior on Linux.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes the static build pipeline so UPX packing is disabled by default and becomes opt-in via a new COMPRESS environment variable, with CI and documentation updates to match.
Changes:
- Replace
NO_COMPRESSwithCOMPRESSand make UPX packing opt-in inbuild-static.sh. - Update static-builder Dockerfiles and GitHub Actions workflows to stop relying on
NO_COMPRESS. - Refresh static-build documentation across locales to describe
COMPRESS.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| static-builder-musl.Dockerfile | Replaces NO_COMPRESS build arg with COMPRESS for static musl builder. |
| static-builder-gnu.Dockerfile | Replaces NO_COMPRESS build arg with COMPRESS for static GNU builder. |
| build-static.sh | Switches UPX packing logic from default-on (unless NO_COMPRESS) to opt-in (COMPRESS). |
| .github/workflows/static.yaml | Removes NO_COMPRESS usage from static release workflow invocations. |
| .github/workflows/docker.yaml | Removes NO_COMPRESS bake arg injection for Docker image builds. |
| docs/static.md | Documents COMPRESS instead of NO_COMPRESS for static builds. |
| docs/embed.md | Updates embed docs to say UPX packing is optional via COMPRESS=1. |
| docs/tr/embed.md | Same embed doc update (TR). |
| docs/ru/static.md | Documents COMPRESS instead of NO_COMPRESS (RU). |
| docs/ru/embed.md | Updates embed docs to optional UPX packing via COMPRESS=1 (RU). |
| docs/pt-br/static.md | Documents COMPRESS instead of NO_COMPRESS (PT-BR). |
| docs/pt-br/embed.md | Updates embed docs to optional UPX packing via COMPRESS=1 (PT-BR). |
| docs/ja/static.md | Documents COMPRESS instead of NO_COMPRESS (JA). |
| docs/ja/embed.md | Updates embed docs to optional UPX packing via COMPRESS=1 (JA). |
| docs/fr/static.md | Documents COMPRESS instead of NO_COMPRESS (FR). |
| docs/fr/embed.md | Updates embed docs to optional UPX packing via COMPRESS=1 (FR). |
| docs/es/static.md | Documents COMPRESS instead of NO_COMPRESS (ES). |
| docs/es/embed.md | Updates embed docs to optional UPX packing via COMPRESS=1 (ES). |
| docs/cn/static.md | Documents COMPRESS instead of NO_COMPRESS (CN). |
| docs/cn/embed.md | Updates embed docs to optional UPX packing via COMPRESS=1 (CN). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- alpine.Dockerfile: switch the dynamic build to the new COMPRESS semantics; it still defaulted to UPX-packing because it had its own NO_COMPRESS check that the PR missed. - build-static.sh: document COMPRESS in the supported-variables header and note that DEBUG_SYMBOLS takes precedence. - docs/*: clarify that COMPRESS is read as "set to 1" and is ignored when DEBUG_SYMBOLS is set.
caddytest's default 5s http.Client.Timeout covers the whole roundtrip, including body reads. On emulated armv7 the SSE chain (WriteFile -> e-dant/watcher -> mercure -> client) doesn't fit in 5s and the test dies with "Client.Timeout or context cancellation while reading body". Bump to 30s — generous enough for the slow runners (~5-6s actual) while keeping a bounded failure mode if the marker never arrives. Same fix is in #2431; carrying it here so this PR's CI does not trip on the unrelated flake.
Member
Author
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.
Summary
UPX is now disabled by default for the static build. To pack the binary with UPX (Linux only), set
COMPRESS=1at build time. The previousNO_COMPRESSflag is removed; CI invocations and thestatic-builder-{musl,gnu}Dockerfiles were updated accordingly. Docs (all locales) were refreshed.Why drop UPX from the default?
xz-compressing the release asset gives similar savings without any of the runtime downsides.Users who still want a packed binary can opt in explicitly with
COMPRESS=1.