fix: stop version.h dropping zero-valued version components - #113
Closed
skilledwolf wants to merge 1 commit into
Closed
fix: stop version.h dropping zero-valued version components#113skilledwolf wants to merge 1 commit into
skilledwolf wants to merge 1 commit into
Conversation
version.h.in declared ALPS_VERSION_MAJOR/MINOR/PATCH with cmakedefine, which emits "/* #undef NAME */" when the substituted value is false-y. CMake counts 0 as false-y, so any x.y.0 release generated a header with that component silently missing. 2.4.0 would have tripped it. Use a plain #define for every macro the build unconditionally sets. Keep cmakedefine only for ALPS_XML_ALTERNATE_DIR, which the build never sets and parser/xslt_path.C guards with #ifdef. Also add ALPS_VERSION_NUMBER/ALPS_VERSION_NUM() for preprocessor version comparisons (BOOST_VERSION packing), and drop two macros: ALPS_SVN_REVISION, which expanded a variable unset since the SVN migration and was always #undef, and ALPS_SRCDIR, which baked the build machine's source path into an installed header for one line of pconfig output. Refs #95 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
skilledwolf
force-pushed
the
fix/version-header-macros
branch
from
July 25, 2026 00:20
bcda23a to
1b70453
Compare
Collaborator
Author
|
Folding this into #114, which single-sources the version from Rationale: on its own this PR was a 2-file fix with no user-visible change, and the Branch |
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.
version.h.indeclared the version components withcmakedefine, which emits/* #undef NAME */when the substituted value is false-y. CMake counts0as false-y, so anyx.y.0release generates an installed header with that component silently missing. We're atv2.3.4-beta.2, so 2.4.0 would have tripped it.#definefor every macro the build unconditionally sets.cmakedefinestays only forALPS_XML_ALTERNATE_DIR, which the build never sets andparser/xslt_path.Cguards with#ifdef.ALPS_VERSION_NUMBER/ALPS_VERSION_NUM()for preprocessor version checks, packed likeBOOST_VERSION.ALPS_SVN_REVISION(expanded@ALPS_WC_REVISION@, unset since the SVN migration, always#undef) andALPS_SRCDIR(baked the build machine's source path into an installed header for one line ofpconfigoutput).Verified by generating the header at 2.4.0 and 2.3.4 and compiling against each.
set(ALPS_SRCDIR ...)is left inCMakeLists.txton purpose — that file is contested by #107/#110/#112, and the follow-up rewrites the block.Refs #95. Scoped to the two files no other open PR touches, so it can merge independently of the #107 → #111 → #112 stack.