feat: embed Windows VERSIONINFO in tgrep.exe#85
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Windows build-time resource step so the produced (and later OneBranch-signed) tgrep.exe includes standard VERSIONINFO metadata (ProductName, FileVersion, CompanyName, etc.) visible in Windows Explorer “Properties → Details”.
Changes:
- Add
winresourceas a Windows-only build dependency fortgrep-cli. - Introduce a
tgrep-cli/build.rsbuild script that compiles VERSIONINFO into the Windows binary.
Show a summary per file
| File | Description |
|---|---|
| tgrep-cli/Cargo.toml | Adds Windows-only winresource build dependency to enable resource embedding. |
| tgrep-cli/build.rs | New build script that sets VERSIONINFO fields and compiles them into tgrep.exe. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
Add winresource build dependency and build.rs to embed ProductName, FileDescription, CompanyName, LegalCopyright, InternalName, and OriginalFilename into the Windows binary. FileVersion and ProductVersion are auto-populated from Cargo.toml. Without this, the signed binary shows no product metadata in Windows Properties > Details tab. Reference implementations: - microsoft/vscode cli/build.rs - microsoft/coreutils build.rs - microsoft/python-environment-tools crates/pet/build.rs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2763828 to
b041633
Compare
Move winresource to unconditional build-dependencies so build.rs can compile on non-Windows hosts while still gating resource generation by target OS. Update Cargo.lock for --locked release builds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
shengyfu
approved these changes
Jun 12, 2026
Keep winresource as a Windows-host build dependency and compile the resource embedding code only on Windows hosts. Non-Windows hosts targeting Windows now emit a Cargo warning instead of failing when no resource compiler is available. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
baopingz
approved these changes
Jun 12, 2026
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.
Summary
Add Windows VERSIONINFO resource embedding so that signed grep.exe shows ProductName, FileVersion, CompanyName, etc. in the Windows "Properties → Details" tab.
Problem
After OneBranch signing, grep.exe has a valid Authenticode signature but no product metadata (ProductName, FileVersion, etc. are all blank). This is because Rust binaries don't include Windows VERSIONINFO resources by default.
Solution
Reference
Same pattern used by other Microsoft Rust projects:
All three use OneBranch + onebranch.pipeline.signing@1 with
external_distributionprofile — same as tgrep.Changes
Testing