Bitcoin-Core

在 macos 上啟動單個功能測試時出錯

  • September 1, 2022

為了成為比特幣核心開發人員,我開始熟悉功能測試套件。

我正在嘗試使用此命令執行單個測試。

python feature_shutdown.py

我收到這樣的錯誤。在此錯誤中,我注意到未創建目錄。 ’@abs_top_builddir@/src/bitcoind@EXEEXT@’

這種行為有人熟悉嗎?似乎沒有正確插入字元串。

2022-09-01T03:01:04.768000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
 File "/Users/user/git/bitcoin/test/functional/test_framework/test_framework.py", line 132, in main
   self.setup()
 File "/Users/user/git/bitcoin/test/functional/test_framework/test_framework.py", line 295, in setup
   self.setup_network()
 File "/Users/user/git/bitcoin/test/functional/test_framework/test_framework.py", line 389, in setup_network
   self.setup_nodes()
 File "/Users/user/git/bitcoin/test/functional/test_framework/test_framework.py", line 414, in setup_nodes
   self.start_nodes()
 File "/Users/user/git/bitcoin/test/functional/test_framework/test_framework.py", line 547, in start_nodes
   node.start(extra_args[i], *args, **kwargs)
 File "/Users/user/git/bitcoin/test/functional/test_framework/test_node.py", line 211, in start
   self.process = subprocess.Popen(self.args + extra_args, env=subp_env, stdout=stdout, stderr=stderr, cwd=cwd, **kwargs)
 File "/Users/user/opt/anaconda3/envs/bitcoin/lib/python3.6/subprocess.py", line 729, in __init__
   restore_signals, start_new_session)
 File "/Users/user/opt/anaconda3/envs/bitcoin/lib/python3.6/subprocess.py", line 1364, in _execute_child
   raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '@abs_top_builddir@/src/bitcoind@EXEEXT@': '@abs_top_builddir@/src/bitcoind@EXEEXT@'
2022-09-01T03:01:04.825000Z TestFramework (INFO): Stopping nodes
2022-09-01T03:01:04.825000Z TestFramework (WARNING): Not cleaning up dir /var/folders/cj/1w9q8rc55v99_ynzxz46c3dr0000gn/T/bitcoin_func_test_2u9b62xc
2022-09-01T03:01:04.825000Z TestFramework (ERROR): Test failed. Test logging available at /var/folders/cj/1w9q8rc55v99_ynzxz46c3dr0000gn/T/bitcoin_func_test_2u9b62xc/test_framework.log
2022-09-01T03:01:04.826000Z TestFramework (ERROR): 
2022-09-01T03:01:04.826000Z TestFramework (ERROR): Hint: Call /Users/user/git/bitcoin/test/functional/combine_logs.py '/var/folders/cj/1w9q8rc55v99_ynzxz46c3dr0000gn/T/bitcoin_func_test_2u9b62xc' to consolidate all logs
2022-09-01T03:01:04.826000Z TestFramework (ERROR): 
2022-09-01T03:01:04.826000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2022-09-01T03:01:04.826000Z TestFramework (ERROR): @PACKAGE_BUGREPORT@
2022-09-01T03:01:04.826000Z TestFramework (ERROR): ```

Thank you for your time.

在您的test/文件夾中,您應該有一個config.iniconfig.ini.in文件。你config.ini應該看起來像:

BUILDDIR=/Users/username/code/bitcoin
EXEEXT=

而根據日誌消息,它可能是:

BUILDDIR=@abs_top_builddir@
EXEEXT=@EXEEXT@

如果是這種情況,則配置過程可能出現問題。最簡單的潛在解決方法是重新執行./configure並查看是否可以解決?

python3.6有點老了。試試python3.10

注意:使用自製軟體

brew search python 將顯示可用 python 版本的列表

嘗試:

釀造安裝 python@3

附加說明:

brew install qt 不正確!

brew install qt@5 是正確的!

你必須先解除安裝qt!:)

然後

釀造安裝 qt@5

引用自:https://bitcoin.stackexchange.com/questions/115106