Skip to content

fix(ci): align Windows generator pins - #4697

Closed
januththedev wants to merge 1 commit into
bufbuild:mainfrom
januththedev:fix/windows-generator-pins
Closed

januththedev wants to merge 1 commit into
bufbuild:mainfrom
januththedev:fix/windows-generator-pins

Conversation

@januththedev

Copy link
Copy Markdown

Fixes #4696.

Align Windows CI with the canonical protoc-gen-go and Connect generator versions from the make configuration. This removes the duplicated stale pins that caused Windows to test a different toolchain.

Validation:

  • Windows/canonical version consistency check passed
  • bash -n etc/windows/test.bash passed
  • git diff --check passed

@CLAassistant

CLAassistant commented Sep 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Januth Nimnal seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@januththedev
januththedev marked this pull request as ready for review September 25, 2026 08:16
@januththedev

Copy link
Copy Markdown
Author

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

Januth Nimnal seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

OK i have Completed the sign in process

Comment thread etc/windows/test.bash Outdated
Comment on lines +6 to +7
PROTOC_GEN_GO_VERSION="v1.36.12"
CONNECT_VERSION="v1.21.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets read these from the makefiles so theres a single source of truth:

# Read versions from makego dependency.
mk_var() {
  sed -n "s/^$1 ?= //p" "make/go/$2"
}

PROTOC_VERSION="$(mk_var PROTOC_VERSION dep_protoc.mk)"
PROTOC_GEN_GO_VERSION="$(mk_var PROTOC_GEN_GO_VERSION dep_protoc_gen_go.mk)"
CONNECT_VERSION="$(mk_var CONNECT_VERSION dep_protoc_gen_connect_go.mk)"
for var in PROTOC_VERSION PROTOC_GEN_GO_VERSION CONNECT_VERSION; do
  if [ -z "${!var}" ]; then
    echo "error: could not read ${var} from make/go" >&2
    exit 1
  fi
done

@januththedev

Copy link
Copy Markdown
Author

Good suggestion — and it retires the actual bug rather than just re-syncing the numbers. Pushed 8e7f4d89a, which replaces the three hardcoded pins with your mk_var approach.

One deviation from your snippet: I resolve repo_root from BASH_SOURCE and use an absolute path, rather than cd-ing to the repository root. My first attempt did cd up to read the makefiles and cd back, and that would have broken the script — go install ./cmd/buf and go test ./... further down are relative to the repository root, so leaving the working directory at etc/windows would have made them fail. Reading the makefiles by absolute path keeps the rest of the script's cwd assumptions untouched:

# Read versions from make/go dependency so this script and the Makefile agree.
# Resolved without changing the working directory: the commands below are
# relative to the repository root.
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
mk_var() {
  sed -n "s/^$1 ?= //p" "${repo_root}/make/go/$2"
}

PROTOC_VERSION="$(mk_var PROTOC_VERSION dep_protoc.mk)"
PROTOC_GEN_GO_VERSION="$(mk_var PROTOC_GEN_GO_VERSION dep_protoc_gen_go.mk)"
CONNECT_VERSION="$(mk_var CONNECT_VERSION dep_protoc_gen_connect_go.mk)"
for var in PROTOC_VERSION PROTOC_GEN_GO_VERSION CONNECT_VERSION; do
  if [ -z "${!var}" ]; then
    echo "error: could not read ${var} from make/go" >&2
    exit 1
  fi
done

I kept your for var in ... guard verbatim, so a missing or renamed variable fails loudly instead of silently producing an empty version.

Verification: bash -n passes, and running the extraction from an unrelated working directory resolves 35.1 / v1.36.12 / v1.21.0 — the same values that were hardcoded, so this PR's alignment is preserved and the duplication is gone.

This supersedes the "update the stale pins" framing of my original description; the substance is now that test.bash no longer keeps its own copy of the three versions at all. I still can't run the Windows job from here, so that's still worth a CI run.

@emcfarlane

Copy link
Copy Markdown
Contributor

@januththedev thanks for looking into this. I think you forgot to push the latest changes.

@januththedev
januththedev force-pushed the fix/windows-generator-pins branch from 18657d5 to 8e7f4d8 Compare October 2, 2026 15:00
@januththedev

Copy link
Copy Markdown
Author

You were right — I pushed to the wrong branch. The mk_var change went to fix/ci-windows-pins while the PR tracks fix/windows-generator-pins, so it never appeared here. Pushed to the right branch; the PR head is now 8e7f4d8.

The change itself is as described above, with the one deviation: repo_root is resolved from BASH_SOURCE and used as an absolute path, because my first attempt cd-ed to read the makefiles and cd-ing back would have broken go install ./cmd/buf and go test ./... further down, which are relative to the repository root. Verified bash -n passes and the three variables resolve to 35.1 / v1.36.12 / v1.21.0 from an unrelated working directory.

@emcfarlane

Copy link
Copy Markdown
Contributor

Thanks for raising the issue. Fixed in #4712

@emcfarlane emcfarlane closed this Oct 2, 2026
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.

Windows CI installs stale protobuf generator versions

3 participants