feat: add Windows build and resolve frontend version from GH variable#337
Merged
Conversation
Pull FRONTEND_VERSION from the workflow_dispatch input, then the repo Variable (vars.FRONTEND_VERSION), then a hardcoded fallback — no more manual workflow edits to bump the embedded UI. Also pass FRONTEND_VERSION through to the Docker build so the runtime image stays in sync. Adds a Windows amd64 build that produces buggregator-windows-amd64.exe. VarDumper is the only module unavailable on Windows (no static-php micro.sfx, can't bundle PHP standalone) — the binary embeds a placeholder stub and main.go gates StartPHP on runtime.GOOS so the server still boots. Sentry, SMTP, Monolog, Ray, Inspector, Profiler, HTTP-dump, and SMS all work normally. CI now cross-compiles windows/amd64 in addition to native, so build constraint regressions get caught on PRs.
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.
What
buggregator-windows-amd64.exe).FRONTEND_VERSIONfrom the workflow_dispatch input → repovars.FRONTEND_VERSION→ hardcoded fallback, so the embedded UI version no longer has to be edited inside the workflow file.FRONTEND_VERSIONinto the Docker build-args so the published image picks up the same version.windows/amd64so build-constraint regressions get caught on PRs.Why
FRONTEND_VERSION = 1.32.1but the workflow ignored it (hardcoded1.32.0), so bumping the UI required two commits. Pulling fromvars.FRONTEND_VERSION(with a literal fallback for forks) makes the Variable authoritative and lets the maintainer also override per-run viaworkflow_dispatchinput.box.pharcan't detect Composer on Windows CI (box#1097) andstatic-php-clihas nomicro.sfxfor Windows. The conclusion was correct — we can't bundle the PHP runtime — but it skipped what's still possible: cross-compiling the Go server itself, with VarDumper turned off at runtime.How
Windows build
cmd/buggregator/main.go—runtime.GOOS == "windows"skipsStartPHP()(the call that would try to exec the placeholder binary and exit(1)).Module.TCPServers()already returns nil when the parser isn't running, so :9912 stays unbound. Every other module ingests normally.release.yml— newbuild-windowsjob. Same shape as the unix matrix minus the static-php / micro.sfx step; writes a placeholder byte stub so//go:embed bin/vardumper-parser-windows-amd64.exeresolves, thenCGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build.releasejob now depends onbuild-windowstoo.ci.yml— adds awindows/amd64cross-compile step so build constraint mistakes fail in PR rather than the next release.Frontend version resolution
release.yml— top-levelenv.FRONTEND_VERSIONis nowinputs.frontend_version || vars.FRONTEND_VERSION || '1.32.0'. The fallback string only matters on forks that don't set the Variable.release.yml—workflow_dispatchinput added; lets you build a one-off without bumping the Variable.release.yml— Docker job passesFRONTEND_VERSIONthroughbuild-argsso the runtime container image picks up the same value.Dockerfile—ARG FRONTEND_VERSIONdefault updated to1.32.1to match the current repo Variable.releasejob is now gated ongithub.event_name == 'push' && startsWith(github.ref, 'refs/tags/').workflow_dispatchruns produce artifacts but don't create a GitHub Release.Why not bundle PHP on Windows
static-php-clidistributes pre-builtmicro.sfxfor Linux/macOS only — no Windows variant exists..pharis fragile on Windows runners (box#1097).If a Windows user later needs VarDumper, the practical path is Docker Desktop or WSL — the Linux image already supports both.
Testing
go build ./cmd/buggregator(native) andCGO_ENABLED=0 GOOS=windows GOARCH=amd64 go buildlocally — both produce valid binaries (PE32+ executable (console) x86-64, for MS Windows).go test ./... -count=1— clean across every package.go vet ./...— clean.