Skip to content

Conversation

@dmkozh
Copy link
Contributor

@dmkozh dmkozh commented Dec 19, 2025

Description

Fix build without tests.

I'm not sure how this worked before, but we had a few unguarded test-only methods that now finally started to actually cause compilation errors.

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

Copilot AI review requested due to automatic review settings December 19, 2025 00:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses compilation errors that occur when building stellar-core without test support by properly guarding test-only methods and functions with #ifdef BUILD_TESTS preprocessor directives.

  • Guards test-only virtual methods (getMutableEnvelope, clearCached, isTestTx) in TransactionTestFrame to match the base class interface
  • Reorganizes function definitions and declarations in TxTests.h and TxTests.cpp to separate test-only overloads from production code
  • Removes unused #include "config.h" from Backtrace.cpp
  • Fixes lambda capture in LoadGeneratorTests.cpp to properly capture the frameSize variable

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/util/Backtrace.cpp Removes unused config.h include
src/transactions/test/TransactionTestFrame.h Guards test-only methods (getMutableEnvelope, clearCached, isTestTx) with #ifdef BUILD_TESTS and relocates isTestTx method
src/transactions/test/TransactionTestFrame.cpp Guards implementations of getMutableEnvelope and clearCached with #ifdef BUILD_TESTS and relocates clearCached implementation
src/test/TxTests.h Guards test-only function overloads (parallel Soroban variants) with #ifdef BUILD_TESTS
src/test/TxTests.cpp Reorganizes closeLedger and closeLedgerOn function definitions to separate test-only variants from production code
src/simulation/test/LoadGeneratorTests.cpp Adds frameSize to lambda capture list to fix undefined reference

@dmkozh dmkozh force-pushed the build_fix2 branch 2 times, most recently from 73e3a44 to d64a10c Compare December 19, 2025 01:12
sisuresh
sisuresh previously approved these changes Dec 19, 2025
@dmkozh dmkozh enabled auto-merge December 19, 2025 01:16
@dmkozh dmkozh disabled auto-merge December 19, 2025 01:41
@dmkozh dmkozh enabled auto-merge December 19, 2025 01:56
@dmkozh dmkozh added this pull request to the merge queue Dec 19, 2025
Merged via the queue into stellar:master with commit ff86d0d Dec 19, 2025
39 checks passed
@dmkozh dmkozh deleted the build_fix2 branch December 19, 2025 02:52
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