Repository navigation
feat(frankenphp): allow passing extra Go build flags, ldflags and tags - #1269
Merged
Merged
Conversation
FrankenPHP static builds can't otherwise set Go linker variables such as EmbeddedAppPath, nor extra build tags: a second -ldflags or -tags would replace the ones generated here. Add SPC_CMD_VAR_FRANKENPHP_GO_BUILD_FLAGS, SPC_CMD_VAR_FRANKENPHP_GO_LDFLAGS and SPC_CMD_VAR_FRANKENPHP_GO_TAGS, merged into the generated flags on Unix and Windows.
henderkes
approved these changes
Oct 25, 2026
crazywhalecc
approved these changes
Oct 25, 2026
This was referenced Oct 25, 2026
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.
FrankenPHP static builds can't otherwise set Go linker variables such as
EmbeddedAppPath, nor add build tags: a second-ldflagsor-tagswould replace the ones generated here.SPC_CMD_VAR_FRANKENPHP_GO_BUILD_FLAGSis appended to thego buildflags.SPC_CMD_VAR_FRANKENPHP_GO_LDFLAGSis merged into the generated-ldflags. Values can't contain double quotes, like the-Xflags already generated.SPC_CMD_VAR_FRANKENPHP_GO_TAGSis merged into the generated tags.Both the Unix (xcaddy) and Windows (
go build) paths are covered. The defaults, empty, are documented inconfig/env.ini.For instance, FrankenPHP's
build-static.shwill use it to fix the extraction directory of embedded apps:SPC_CMD_VAR_FRANKENPHP_GO_LDFLAGS="-X github.com/dunglas/frankenphp.EmbeddedAppPath=/opt/my-app"