mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
GameVersion.cpp becomes a configure_file template, so the version strings are a
build input rather than something a CI step seds into the working tree mid-run.
That is what lets a crash report be matched to its exact build's PDB for offline
symbolization.
The two strings get distinct jobs. czVersionString is the machine-readable build
identity: the bare short commit SHA and nothing else. A `git describe` string
cannot serve here -- czVersionString is 16 bytes because it is stored in the
savegame header as SAVED_GAME_HEADER::zGameVersionNumber and strcmp'd on load,
and describe puts the SHA last, so truncation ate exactly the discriminating part
and could make two different commits compare equal. CI passes 9 hex; anything
that would not fit is now a configure error rather than a silent clip.
zBuildInformation is the display string, untruncated, and it is no longer printed
beside czVersionString: that drops the duplication in the version line ("JA2 1.13
V4-555-G6A941C0 2026-07-25 V4-555-G6A941C06") and stops showing a token that is
now machine-only. CI's copy leads with GAME_VERSION, because the version line is
now the only place a player reads which release they are running.
Finish what the sed step's TODO asked for: the workflow pins GAME_BUILD_INFORMATION
and GIT_SHA once, next to the gamedir SHAs it already pins, and hands them to CMake
with -D. Every parallel build job therefore stamps one agreed identity, and the
compile checkout needs no git history at all.
A build nobody identifies is a local build and says so -- czVersionString reads
"local" -- rather than deriving a SHA from HEAD. A derived SHA could not stay
true: nothing re-runs configure once HEAD moves, so an incremental build would
keep whatever it was configured with, and keeping it honest would mean
reconfiguring on every commit. It would also buy nothing, because only packaged
builds are archived with their PDBs; a local build's crash reports are symbolized
against the PDB sitting next to the exe.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
46 lines
1.1 KiB
Plaintext
46 lines
1.1 KiB
Plaintext
#include "types.h"
|
|
#include "GameVersion.h"
|
|
|
|
//
|
|
// Keeps track of the game version
|
|
//
|
|
|
|
#ifdef JA2EDITOR // map editor
|
|
|
|
#ifdef JA2UB
|
|
CHAR16 zProductLabel[64] = { L"JA2 1.13 Unfinished Business - Map Editor" };
|
|
#else
|
|
CHAR16 zProductLabel[64] = { L"JA2 1.13 - Map Editor" };
|
|
#endif
|
|
|
|
#elif defined JA2BETAVERSION // debug
|
|
|
|
#ifdef JA2UB
|
|
CHAR16 zProductLabel[64] = { L"Debug: JA2 1.13 Unfinished Business" };
|
|
#elif defined (JA113DEMO)
|
|
CHAR16 zProductLabel[64] = { L"Debug: JA2 1.13 Demo" };
|
|
#else
|
|
CHAR16 zProductLabel[64] = { L"Debug: JA2 1.13" };
|
|
#endif
|
|
|
|
#elif defined CRIPPLED_VERSION
|
|
|
|
CHAR16 zProductLabel[64] = { L"JA2 113 Beta-0.98" };
|
|
|
|
#else // release
|
|
|
|
#ifdef JA2UB
|
|
CHAR16 zProductLabel[64] = { L"JA2 1.13 Unfinished Business" };
|
|
#elif defined (JA113DEMO)
|
|
CHAR16 zProductLabel[64] = { L"JA2 1.13 Demo" };
|
|
#else
|
|
CHAR16 zProductLabel[64] = { L"JA2 1.13" };
|
|
#endif
|
|
|
|
#endif
|
|
|
|
CHAR8 czVersionString[16] = { "@GIT_SHA@" };
|
|
CHAR16 zBuildInformation[256] = { L"@GAME_BUILD_INFORMATION@" };
|
|
|
|
// SAVE_GAME_VERSION is defined in header, change it there
|