Skip to content

feat(internal/librarian): add protoc installation support - #6583

Merged
JoeWang1127 merged 33 commits into
mainfrom
feat/install-protoc
Jul 1, 2026
Merged

JoeWang1127 merged 33 commits into
mainfrom
feat/install-protoc

Conversation

@JoeWang1127

@JoeWang1127 JoeWang1127 commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Add the ability to install the protoc compiler from GitHub releases.

The install function downloads the protoc zip archive for the host platform, verifies its checksum, and extracts it to the librarian bin directory.

For #6558

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces support for downloading and installing the protoc compiler. It adds a new Protoc configuration struct, a ZIP extraction utility with Zip Slip protection, and the core installation logic along with corresponding tests. The review feedback focuses on improving cross-platform compatibility, suggesting that the download URL dynamically determine the platform suffix based on the host OS and architecture, that the path filtering handle the .exe extension on Windows using forward slashes, and that the tests mock the platform suffix to remain deterministic.

Comment thread internal/librarian/protoc.go Resolved
Comment thread internal/librarian/protoc.go Resolved
Comment thread internal/librarian/protoc.go Resolved
Comment thread internal/librarian/protoc_test.go Resolved
@JoeWang1127 JoeWang1127 changed the title feat(internal/librarian): install protoc to librarian bin directory feat(internal/librarian): add protoc installation support Jul 1, 2026
@JoeWang1127
JoeWang1127 marked this pull request as ready for review July 1, 2026 01:47
@JoeWang1127
JoeWang1127 requested a review from a team as a code owner July 1, 2026 01:47
@JoeWang1127
JoeWang1127 requested a review from zhumin8 July 1, 2026 01:47
Comment thread internal/librarian/protoc.go Resolved
Comment thread internal/librarian/protoc.go Resolved
Comment thread internal/librarian/protoc.go Resolved
Comment thread internal/librarian/protoc.go Resolved
@noahdietz

Copy link
Copy Markdown
Contributor

Stoked about this! I'm guessing a follow up will introduce the code changes to language packages to use the librarian installed protoc ?

@JoeWang1127

Copy link
Copy Markdown
Contributor Author

Stoked about this! I'm guessing a follow up will introduce the code changes to language packages to use the librarian installed protoc ?

Yes.

We choose to do it now b/c Java wants to release a LTS version, which requires different version of protoc.

@JoeWang1127
JoeWang1127 requested a review from noahdietz July 1, 2026 19:19
Comment thread internal/librarian/protoc.go Resolved
@JoeWang1127
JoeWang1127 requested a review from noahdietz July 1, 2026 20:09

@noahdietz noahdietz left a comment

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.

Just two naming nits, but approving for merge once addressed.

Comment thread internal/librarian/protoc.go Resolved
Comment thread internal/librarian/protoc.go Resolved
@JoeWang1127
JoeWang1127 enabled auto-merge (squash) July 1, 2026 20:18
@JoeWang1127
JoeWang1127 merged commit 6037497 into main Jul 1, 2026
51 checks passed
@JoeWang1127
JoeWang1127 deleted the feat/install-protoc branch July 1, 2026 20:21
sofisl pushed a commit to sofisl/librarian that referenced this pull request Jul 7, 2026
…is#6583)

Add the ability to install the protoc compiler from GitHub releases.

The install function downloads the protoc zip archive for the host
platform, verifies its checksum, and extracts it to the librarian bin
directory.

For googleapis#6558
noahdietz pushed a commit to noahdietz/librarian that referenced this pull request Jul 7, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.25.0](googleapis/librarian@v0.24.0...v0.25.0)
(2026-07-07)


### Features

* **internal/config:** add declarative postprocessing config schema
([googleapis#6651](googleapis#6651))
([12ecef3](googleapis@12ecef3)),
closes [googleapis#6516](googleapis#6516)
* **internal/filesystem:** add MoveAndMergeWithKeep and MoveAndMerge
deprecation TODO
([googleapis#6644](googleapis#6644))
([fe91dda](googleapis@fe91dda)),
closes [googleapis#6516](googleapis#6516)
* **internal/librarian/java:** add comment to fully generated POM
templates ([googleapis#6648](googleapis#6648))
([54f881b](googleapis@54f881b))
* **internal/librarian/java:** add Java README rendering without
snippets ([googleapis#6636](googleapis#6636))
([96e890a](googleapis@96e890a)),
closes [googleapis#6515](googleapis#6515)
* **internal/librarian/java:** add logging-logback to legacy BOMs
([googleapis#6669](googleapis#6669))
([258d1de](googleapis@258d1de))
* **internal/librarian/java:** add README metadata parsing helpers
([googleapis#6595](googleapis#6595))
([c402d4a](googleapis@c402d4a)),
closes [googleapis#6515](googleapis#6515)
* **internal/librarian/java:** add README partials loader
([googleapis#6596](googleapis#6596))
([4babb38](googleapis@4babb38)),
closes [googleapis#6515](googleapis#6515)
* **internal/librarian/java:** pre-validate java libraries bom version
in config ([googleapis#6613](googleapis#6613))
([6fe1ee3](googleapis@6fe1ee3))
* **internal/librarian/java:** source google-cloud-pom-parent in pom.xml
templates ([googleapis#6607](googleapis#6607))
([3c46b73](googleapis@3c46b73))
* **internal/librarian/php:** add skeleton code for PHP client library
generation
([googleapis#6641](googleapis#6641))
([dba27ec](googleapis@dba27ec))
* **internal/librarian:** add `protoc` installation support
([googleapis#6583](googleapis#6583))
([6037497](googleapis@6037497)),
closes [googleapis#6558](googleapis#6558)
* **internal/librarian:** track Go snippet metadata in release-please
([googleapis#6525](googleapis#6525))
([22c3b33](googleapis@22c3b33))
* **nodejs:** read nodejs tools from librarian.yaml config
([googleapis#6649](googleapis#6649))
([0bebff2](googleapis@0bebff2))


### Bug Fixes

* **internal/postprocessing:** add input validation and error handling
in Replace and ReplaceRegex
([googleapis#6661](googleapis#6661))
([1a32aab](googleapis@1a32aab)),
closes [googleapis#6516](googleapis#6516)
* **rust:** do not add empty rust config
([googleapis#6609](googleapis#6609))
([c563304](googleapis@c563304))
* **rust:** tidy empty rust blocks
([googleapis#6618](googleapis#6618))
([dfa0f2d](googleapis@dfa0f2d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
sofisl pushed a commit to sofisl/librarian that referenced this pull request Jul 8, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.25.0](googleapis/librarian@v0.24.0...v0.25.0)
(2026-07-07)


### Features

* **internal/config:** add declarative postprocessing config schema
([googleapis#6651](googleapis#6651))
([12ecef3](googleapis@12ecef3)),
closes [googleapis#6516](googleapis#6516)
* **internal/filesystem:** add MoveAndMergeWithKeep and MoveAndMerge
deprecation TODO
([googleapis#6644](googleapis#6644))
([fe91dda](googleapis@fe91dda)),
closes [googleapis#6516](googleapis#6516)
* **internal/librarian/java:** add comment to fully generated POM
templates ([googleapis#6648](googleapis#6648))
([54f881b](googleapis@54f881b))
* **internal/librarian/java:** add Java README rendering without
snippets ([googleapis#6636](googleapis#6636))
([96e890a](googleapis@96e890a)),
closes [googleapis#6515](googleapis#6515)
* **internal/librarian/java:** add logging-logback to legacy BOMs
([googleapis#6669](googleapis#6669))
([258d1de](googleapis@258d1de))
* **internal/librarian/java:** add README metadata parsing helpers
([googleapis#6595](googleapis#6595))
([c402d4a](googleapis@c402d4a)),
closes [googleapis#6515](googleapis#6515)
* **internal/librarian/java:** add README partials loader
([googleapis#6596](googleapis#6596))
([4babb38](googleapis@4babb38)),
closes [googleapis#6515](googleapis#6515)
* **internal/librarian/java:** pre-validate java libraries bom version
in config ([googleapis#6613](googleapis#6613))
([6fe1ee3](googleapis@6fe1ee3))
* **internal/librarian/java:** source google-cloud-pom-parent in pom.xml
templates ([googleapis#6607](googleapis#6607))
([3c46b73](googleapis@3c46b73))
* **internal/librarian/php:** add skeleton code for PHP client library
generation
([googleapis#6641](googleapis#6641))
([dba27ec](googleapis@dba27ec))
* **internal/librarian:** add `protoc` installation support
([googleapis#6583](googleapis#6583))
([6037497](googleapis@6037497)),
closes [googleapis#6558](googleapis#6558)
* **internal/librarian:** track Go snippet metadata in release-please
([googleapis#6525](googleapis#6525))
([22c3b33](googleapis@22c3b33))
* **nodejs:** read nodejs tools from librarian.yaml config
([googleapis#6649](googleapis#6649))
([0bebff2](googleapis@0bebff2))


### Bug Fixes

* **internal/postprocessing:** add input validation and error handling
in Replace and ReplaceRegex
([googleapis#6661](googleapis#6661))
([1a32aab](googleapis@1a32aab)),
closes [googleapis#6516](googleapis#6516)
* **rust:** do not add empty rust config
([googleapis#6609](googleapis#6609))
([c563304](googleapis@c563304))
* **rust:** tidy empty rust blocks
([googleapis#6618](googleapis#6618))
([dfa0f2d](googleapis@dfa0f2d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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.

2 participants