Skip to content

Reliable way to disable UPX compression in static builds #2408

@andreybolonin

Description

@andreybolonin
Image

Is your feature request related to a problem? Please describe.

When building static binaries for FrankenPHP (especially on ARM64/Apple Silicon) with embedded applications, the UPX compression stage can take an unreasonable amount of time (sometimes over 60 minutes for large binaries).

Currently, it is very difficult to disable this stage. Attempting to use environment variables like SKIP_UPX=1 often fails because the internal static-php-cli (spc) tool downloads its own UPX binary to a specific path and ignores system-wide overrides or environment flags in certain versions.

Describe the solution you'd like

A top-level flag: Add a clearly documented flag to build-static.sh (e.g., ./build-static.sh --no-upx) that is guaranteed to be passed down to the underlying spc tool.

Environment Variable consistency: Ensure that an environment variable like FRANKENPHP_SKIP_UPX=1 is respected throughout the entire build process.

Documentation: Add a section to the "Static Builds" documentation titled "Disabling UPX Compression" explaining why and how to do it for faster development cycles.

Describe alternatives you've considered

Mocking the UPX binary via ln -sf /bin/true /usr/local/bin/upx (fails because spc downloads its own binary to a local pkgroot path).

Using sed to surgically remove UPX calls from build-static.sh (hacky and fragile).

Waiting for the compression to finish (takes 1 hour+ on a single CPU core for large embedded apps).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions