Skip to content

PackageBuilder: honour OBJCOPY env and use llvm-strip under ZigToolchain#1171

Closed
henderkes wants to merge 1 commit into
v3from
v3c/package-builder-toolchain-strip
Closed

PackageBuilder: honour OBJCOPY env and use llvm-strip under ZigToolchain#1171
henderkes wants to merge 1 commit into
v3from
v3c/package-builder-toolchain-strip

Conversation

@henderkes
Copy link
Copy Markdown
Collaborator

extractDebugInfo() now picks up OBJCOPY from the environment (falling back to plain objcopy), so cross builds that ship their own objcopy (e.g. llvm-objcopy via zig) don't have to inject it into PATH or shim the binary name.

stripBinary() asks ApplicationContext for the active toolchain and, when it's ZigToolchain, runs the llvm-strip shipped under PKG_ROOT_PATH/llvm-tools/bin instead of the system strip — system strip doesn't understand zig-produced archives and bitcode sections. Other toolchains keep using plain strip.

ApplicationContext::tryGet() wraps get() in a try/catch and returns null on failure, so callers can ask "is this resolvable right now" without PHP-DI's has() lying about autowirable-but-unconstructable classes.

What does this PR do?

Checklist before merging

  • If you modified *.php or *.yml, run them locally to ensure your changes are valid:
    • composer cs-fix
    • composer analyse
    • composer test
    • bin/spc dev:lint-config

extractDebugInfo() now picks up OBJCOPY from the environment (falling
back to plain `objcopy`), so cross builds that ship their own objcopy
(e.g. llvm-objcopy via zig) don't have to inject it into PATH or
shim the binary name.

stripBinary() asks ApplicationContext for the active toolchain and,
when it's ZigToolchain, runs the llvm-strip shipped under
PKG_ROOT_PATH/llvm-tools/bin instead of the system strip — system
strip doesn't understand zig-produced archives and bitcode sections.
Other toolchains keep using plain `strip`.

ApplicationContext::tryGet() wraps get() in a try/catch and returns
null on failure, so callers can ask "is this resolvable right now"
without PHP-DI's has() lying about autowirable-but-unconstructable
classes.
@henderkes henderkes closed this May 24, 2026
@henderkes henderkes deleted the v3c/package-builder-toolchain-strip branch May 24, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant