Repository navigation
fix(proto): cross-compile tools without target emulation - #870
Merged
Merged
Conversation
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.
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.