Skip to content

cmake: seed BTAS_ASSERT_POLICY once from TA_ASSERT_POLICY - #588

Merged
evaleev merged 1 commit into
masterfrom
feature/btas-assert-policy-seed
Sep 15, 2026
Merged

evaleev merged 1 commit into
masterfrom
feature/btas-assert-policy-seed

Conversation

@evaleev

@evaleev evaleev commented Sep 15, 2026

Copy link
Copy Markdown
Member

Follow-up to #587. The forwarding of TA_ASSERT_POLICY to a BTAS built from source is reduced to the plain CMake idiom for a cached option: if BTAS_ASSERT_POLICY is not in the cache yet, seed it from TA_ASSERT_POLICY (THROW/ABORT/IGNORE map one-to-one), without FORCE. The TA_BTAS_ASSERT_POLICY_FOLLOWS_TA option and the TA_BTAS_ASSERT_POLICY_SEEN marker from #587 are removed.

Rationale: CMake cannot distinguish an explicit -DBTAS_ASSERT_POLICY=X from a cache entry that already holds X, so any scheme that re-derives on reconfigure while honoring explicit overrides can only approximate that, and each approximation in #587 had a corner case. Seeding once is exactly how every cached option behaves: the first configure of a build directory aligns BTAS with TA, an explicit -D (from the user or a parent project) wins, and a later change of TA_ASSERT_POLICY does not re-seed (set BTAS_ASSERT_POLICY explicitly, or use a fresh build directory). INSTALL.md says so.

Verification (configure-only, BTAS 52aadfe54 from source, RelWithDebInfo unless noted):

tree step extra -D TA_ASSERT_POLICY BTAS_ASSERT_POLICY
A 1 THROW THROW (seeded)
A 2 TA_ASSERT_POLICY=TA_ASSERT_IGNORE IGNORE THROW (cached, not re-seeded, as documented)
A 3 BTAS_ASSERT_POLICY=BTAS_ASSERT_IGNORE IGNORE IGNORE (explicit)
fresh 1 TA_ASSERT_POLICY=TA_ASSERT_ABORT ABORT ABORT (seeded)
fresh 1 BTAS_ASSERT_POLICY=BTAS_ASSERT_ABORT THROW ABORT (explicit wins)
fresh 1 CMAKE_BUILD_TYPE=Release BUILD_TESTING=OFF IGNORE IGNORE (seeded)

No FOLLOWS_TA/_SEEN entries remain in any cache. Companion: ValeevGroup/SeQuant#616 uses the same idiom for TA_ASSERT_POLICY and BTAS_ASSERT_POLICY.

…ached option

Replace the TA_BTAS_ASSERT_POLICY_FOLLOWS_TA option and the
TA_BTAS_ASSERT_POLICY_SEEN marker (#587) with the plain CMake idiom: if
BTAS_ASSERT_POLICY is not in the cache yet, seed it from TA_ASSERT_POLICY,
without FORCE. The first configure of a build directory aligns BTAS with
TA, an explicit -DBTAS_ASSERT_POLICY (from the user or a parent project) is
already in the cache and wins, and a later change of TA_ASSERT_POLICY does
not re-seed it (set BTAS_ASSERT_POLICY explicitly, or use a fresh build
directory), which is how every cached option behaves. CMake cannot
distinguish an explicit -D from a stale cache entry, so the removed
machinery could only approximate that, with a corner case per approximation.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are fully reviewed and have no unresolved blocking issues.

Pull request overview

Updates BTAS assertion-policy forwarding to seed BTAS_ASSERT_POLICY once from TA_ASSERT_POLICY, while preserving explicit overrides.

Changes:

  • Removes follow/seen tracking variables.
  • Documents cache and reconfiguration behavior.
File summaries
File Summary
INSTALL.md Documents BTAS assertion-policy cache semantics.
cmake/modules/FindOrFetchBTAS.cmake Implements one-time policy seeding.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@evaleev
evaleev merged commit 1654b57 into master Sep 15, 2026
10 checks passed
@evaleev
evaleev deleted the feature/btas-assert-policy-seed branch September 15, 2026 10:26
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