Skip to content

[PROF-15194] Drive Resource.rc VERSIONINFO from version.h#63

Merged
chrisnas merged 1 commit into
mainfrom
r1viollet/version-rc-from-header
Jun 23, 2026
Merged

[PROF-15194] Drive Resource.rc VERSIONINFO from version.h#63
chrisnas merged 1 commit into
mainfrom
r1viollet/version-rc-from-header

Conversation

@r1viollet

@r1viollet r1viollet commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Description

Drive the four VS_VERSION_INFO fields in src/dd-win-prof/Resource.rc (FILEVERSION, PRODUCTVERSION, and the string FileVersion / ProductVersion) from src/dd-win-prof/version.h instead of literals. rc.exe runs the C preprocessor, so Resource.rc now #includes version.h and uses the existing DLL_VERSION_MAJOR/MINOR/PATCH/BUILD and DLL_VERSION_STRING macros directly.

Also added a top-of-file comment warning against editing these fields through the Visual Studio resource editor (the GUI re-serializes macros into literals and would re-introduce the drift).

Motivation

Resource.rc had four hard-coded values that drifted from version.h across past releases — v0.1.0 shipped 0,1,0,0 while version.h was already bumped, v0.2.0 shipped 0,2,0,0 while version.h still said 0,1,0,0. The release workflow's check-version.ps1 only parses version.h, so the drift was invisible to CI. Inspecting dd-win-prof.dll's File Properties → Details on a v0.3.0 release would have shown 0.2.0.0.

Spotted by Codex review on #62.

Ticket: PROF-15194 (parent epic: PROF-14955).

Testing

  • Built successfully on Windows
  • dd-win-prof.dll File Properties → Details shows 0.3.0.0 (matching current version.h)
  • Local repro: bump version.h in a throwaway commit, rebuild, confirm the DLL's properties follow

Checklist

  • Code follows existing style
  • No breaking changes (resource metadata only)

The four VS_VERSION_INFO fields (FILEVERSION, PRODUCTVERSION, and the
FileVersion / ProductVersion strings) were hard-coded literals,
independent of version.h. As a result the DLL's File Properties drifted
from version.h across past releases in both directions: v0.1.0 shipped
'0,1,0,0' while version.h was already bumped; v0.2.0 shipped '0,2,0,0'
while version.h still said '0,1,0,0'. The release workflow's
check-version.ps1 only parses version.h so the drift was invisible.

rc.exe runs the C preprocessor; let Resource.rc #include version.h and
expand DLL_VERSION_MAJOR/MINOR/PATCH/BUILD and DLL_VERSION_STRING
directly. Add a top-of-file comment warning against editing these
fields via the VS resource editor (the GUI re-serializes macros into
literals).
@r1viollet
r1viollet marked this pull request as ready for review June 23, 2026 10:15
@r1viollet
r1viollet requested a review from chrisnas as a code owner June 23, 2026 10:15

@chrisnas chrisnas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@chrisnas
chrisnas merged commit 9e7cccd into main Jun 23, 2026
6 checks passed
@chrisnas
chrisnas deleted the r1viollet/version-rc-from-header branch June 23, 2026 10:19
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