From 3da0ed810b7b817c8054745bb3453f4eb46b6150 Mon Sep 17 00:00:00 2001 From: Tom Trevethan Date: Mon, 27 Jul 2026 15:07:02 +0100 Subject: [PATCH] functional test fixes and no RUNPATH in linux builds --- ci/test/03_test_script.sh | 8 +-- src/CMakeLists.txt | 56 ++++++++++++------- .../example_elements_code_tutorial.py | 2 +- .../functional/test_framework/mempool_util.py | 4 +- 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh index 4ede8e4311..c1862950fc 100755 --- a/ci/test/03_test_script.sh +++ b/ci/test/03_test_script.sh @@ -162,17 +162,17 @@ if [ "$RUN_CHECK_DEPS" = "true" ]; then fi if [ "$RUN_UNIT_TESTS" = "true" ]; then - DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" CTEST_OUTPUT_ON_FAILURE=ON ctest --stop-on-failure "${MAKEJOBS}" --timeout $(( TEST_RUNNER_TIMEOUT_FACTOR * 60 )) + DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib:${BASE_BUILD_DIR}/lib:${BASE_BUILD_DIR}/src/secp256k1/lib" CTEST_OUTPUT_ON_FAILURE=ON ctest --stop-on-failure "${MAKEJOBS}" --timeout $(( TEST_RUNNER_TIMEOUT_FACTOR * 60 )) fi if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then - DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" "${BASE_OUTDIR}"/bin/test_elements --catch_system_errors=no -l test_suite + DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib:${BASE_BUILD_DIR}/lib:${BASE_BUILD_DIR}/src/secp256k1/lib" "${BASE_OUTDIR}"/bin/test_elements --catch_system_errors=no -l test_suite fi if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then # parses TEST_RUNNER_EXTRA as an array which allows for multiple arguments such as TEST_RUNNER_EXTRA='--exclude "rpc_bind.py --ipv6"' eval "TEST_RUNNER_EXTRA=($TEST_RUNNER_EXTRA)" - LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" test/functional/test_runner.py --ci "${MAKEJOBS}" --tmpdirprefix "${BASE_SCRATCH_DIR}"/test_runner/ --ansi --combinedlogslen=99999999 --timeout-factor="${TEST_RUNNER_TIMEOUT_FACTOR}" "${TEST_RUNNER_EXTRA[@]}" --quiet --failfast + LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib:${BASE_BUILD_DIR}/lib:${BASE_BUILD_DIR}/src/secp256k1/lib" test/functional/test_runner.py --ci "${MAKEJOBS}" --tmpdirprefix "${BASE_SCRATCH_DIR}"/test_runner/ --ansi --combinedlogslen=99999999 --timeout-factor="${TEST_RUNNER_TIMEOUT_FACTOR}" "${TEST_RUNNER_EXTRA[@]}" --quiet --failfast fi if [ "${RUN_TIDY}" = "true" ]; then @@ -206,5 +206,5 @@ fi if [ "$RUN_FUZZ_TESTS" = "true" ]; then # shellcheck disable=SC2086 - LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" test/fuzz/test_runner.py ${FUZZ_TESTS_CONFIG} "${MAKEJOBS}" -l DEBUG "${DIR_FUZZ_IN}" --empty_min_time=60 + LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib:${BASE_BUILD_DIR}/lib:${BASE_BUILD_DIR}/src/secp256k1/lib" test/fuzz/test_runner.py ${FUZZ_TESTS_CONFIG} "${MAKEJOBS}" -l DEBUG "${DIR_FUZZ_IN}" --empty_min_time=60 fi \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bf3bb441dd..836eee441d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -277,9 +277,11 @@ if(ENABLE_WALLET) init/bitcoin-wallet.cpp wallet/wallettool.cpp ) - set_target_properties(elements-wallet PROPERTIES - SKIP_BUILD_RPATH OFF - ) + if(APPLE) + set_target_properties(elements-wallet PROPERTIES + SKIP_BUILD_RPATH OFF + ) + endif() add_windows_resources(elements-wallet bitcoin-wallet-res.rc) target_link_libraries(elements-wallet core_interface @@ -421,9 +423,11 @@ if(BUILD_DAEMON) bitcoind.cpp init/bitcoind.cpp ) - set_target_properties(elementsd PROPERTIES - SKIP_BUILD_RPATH OFF - ) + if(APPLE) + set_target_properties(elementsd PROPERTIES + SKIP_BUILD_RPATH OFF + ) + endif() add_windows_resources(elementsd bitcoind-res.rc) target_link_libraries(elementsd core_interface @@ -438,9 +442,11 @@ if(WITH_MULTIPROCESS AND BUILD_DAEMON) bitcoind.cpp init/bitcoin-node.cpp ) - set_target_properties(elements-node PROPERTIES - SKIP_BUILD_RPATH OFF - ) + if(APPLE) + set_target_properties(elements-node PROPERTIES + SKIP_BUILD_RPATH OFF + ) + endif() target_link_libraries(elements-node core_interface bitcoin_node @@ -482,9 +488,11 @@ target_link_libraries(bitcoin_cli # Elements Core RPC client if(BUILD_CLI) add_executable(elements-cli bitcoin-cli.cpp) - set_target_properties(elements-cli PROPERTIES - SKIP_BUILD_RPATH OFF - ) + if(APPLE) + set_target_properties(elements-cli PROPERTIES + SKIP_BUILD_RPATH OFF + ) + endif() add_windows_resources(elements-cli bitcoin-cli-res.rc) target_link_libraries(elements-cli core_interface @@ -501,9 +509,11 @@ endif() if(BUILD_TX) add_executable(elements-tx bitcoin-tx.cpp) add_windows_resources(elements-tx bitcoin-tx-res.rc) - set_target_properties(elements-tx PROPERTIES - SKIP_BUILD_RPATH OFF - ) + if(APPLE) + set_target_properties(elements-tx PROPERTIES + SKIP_BUILD_RPATH OFF + ) + endif() target_link_libraries(elements-tx core_interface bitcoin_common @@ -518,9 +528,11 @@ endif() if(BUILD_UTIL) add_executable(elements-util bitcoin-util.cpp) add_windows_resources(elements-util bitcoin-util-res.rc) - set_target_properties(elements-util PROPERTIES - SKIP_BUILD_RPATH OFF - ) + if(APPLE) + set_target_properties(elements-util PROPERTIES + SKIP_BUILD_RPATH OFF + ) + endif() target_link_libraries(elements-util core_interface bitcoin_common @@ -550,9 +562,11 @@ if(BUILD_UTIL_CHAINSTATE) # Relevant discussions: # - https://github.com/hebasto/bitcoin/pull/236#issuecomment-2183120953 # - https://github.com/bitcoin/bitcoin/pull/30312#issuecomment-2191235833 - set_target_properties(bitcoin-chainstate PROPERTIES - SKIP_BUILD_RPATH OFF - ) + if(APPLE) + set_target_properties(bitcoin-chainstate PROPERTIES + SKIP_BUILD_RPATH OFF + ) + endif() target_link_libraries(bitcoin-chainstate PRIVATE core_interface diff --git a/test/functional/example_elements_code_tutorial.py b/test/functional/example_elements_code_tutorial.py index 217216fdb6..ea0979d6c1 100755 --- a/test/functional/example_elements_code_tutorial.py +++ b/test/functional/example_elements_code_tutorial.py @@ -45,7 +45,7 @@ class WalletTest(BitcoinTestFramework): assert len(self.nodes[0].listissuances()) == 2 # asset & reisuance token self.nodes[0].generatetoaddress(1, self.nodes[0].getnewaddress(), called_by_framework=True) # confirm the tx - + self.sync_all() issuance_addr = self.nodes[0].gettransaction(issuance_txid)['details'][0]['address'] self.nodes[1].importaddress(issuance_addr) diff --git a/test/functional/test_framework/mempool_util.py b/test/functional/test_framework/mempool_util.py index 56a9b4d262..484669f36c 100644 --- a/test/functional/test_framework/mempool_util.py +++ b/test/functional/test_framework/mempool_util.py @@ -54,10 +54,10 @@ def fill_mempool(test_framework, node, *, tx_sync_fun=None): minrelayfee = node.getnetworkinfo()['relayfee'] tx_batch_size = 1 - num_of_batches = 75 + num_of_batches = 74 # Generate UTXOs to flood the mempool # 1 to create a tx initially that will be evicted from the mempool later - # 75 transactions each with a fee rate higher than the previous one + # 74 transactions each with a fee rate higher than the previous one ephemeral_miniwallet = MiniWallet(node, tag_name="fill_mempool_ephemeral_wallet") test_framework.generate(ephemeral_miniwallet, 1 + num_of_batches * tx_batch_size)