Skip to content

fix(proto): cross-compile tools without target emulation - #870

Merged
antoinetoussaint-byte merged 14 commits into
mainfrom
fix/proto-native-tool-build
Oct 28, 2026
Merged

antoinetoussaint-byte merged 14 commits into
mainfrom
fix/proto-native-tool-build

Conversation

@antoinetoussaint-byte

@antoinetoussaint-byte antoinetoussaint-byte commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Publishing the proto companion compiles every Go tool under ARM64 emulation; Buf alone took over 21 minutes in the current publisher. Compile on BUILDPLATFORM and cross-compile static plugins for TARGETARCH. Keep a separate target-platform Go distribution for the runtime so goimports and Swagger execute the correct compiler.

Classification: a fix in Core's companion Dockerfile, reusing Docker's native build/target platforms and Go's cross-compiler. No new build system or generator entry point: Codefly still owns every build, publication and generation command. Removes an unused builder Python venv and an empty grpc_* copy; Python generation continues through the existing pinned runtime venv.

Prebuilt upstream binaries were inspected rather than assumed safe: Buf 1.73.0 ships Go 1.26.8 and x/net 0.58.0 with fixable findings, and other plugin downloads carry older vulnerable Go toolchains. This change retains the current Go compiler and all existing generator versions; it does not claim to fix every plugin's transitive dependency finding.

Bumps proto to 0.0.22 and Core to 0.19.14 for immutable publication. The agent protocol is unchanged; no agent fleet rebuild is required. Documentation: companions/proto/README.md describes native cross-compilation and the prebuilt-binary constraint; docs/runbooks/bump-protobuf-es.md keeps its tested Dockerfile citation accurate.

Validation: full go test ./... passed with exit 0; companions, internal/ciguard and version-tag checks also passed. The local ARM-to-amd64 build compiled Buf in about 70 seconds, then failed because the shared Docker store ran out of space. The original emulated publisher took over 21 minutes for Buf alone. Hosted multi-architecture builds passed for all six companions. The proto amd64 and arm64 builds executed the runtime Go architecture check, Buf, protoc-gen-go, protoc-gen-go-grpc and Swagger successfully; the complete proto build including cache export took 7m42s (https://github.com/codefly-dev/core/actions/runs/40769961769/job/123104619309). A full proto_companion_required run on 0.0.22 still needs the built image and is not claimed yet. Registry publication is a separate gate after merge.

@antoinetoussaint-byte
antoinetoussaint-byte merged commit 455d739 into main Oct 28, 2026
17 checks passed
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