Repository: bitcoin-core/HWI (language: python)

Issue:
Update `setup_environment.sh` to use CMake
Now that Bitcoin Core has CMake, it would be good to update `setup_environment.sh` to build Core with it.


Discussion / hints:

Fix patch:
diff --git a/.github/actions/build-bitcoind/action.yml b/.github/actions/build-bitcoind/action.yml
index 0292d7ca4..ed4c5957c 100644
--- a/.github/actions/build-bitcoind/action.yml
+++ b/.github/actions/build-bitcoind/action.yml
@@ -23,7 +23,7 @@ runs:
         ccache --zero-stats
         cd test; ./setup_environment.sh --bitcoind; cd ..
         ccache --show-stats --verbose
-        tar -czf bitcoind.tar.gz test/work/bitcoin/src/bitcoind
+        tar -czf bitcoind.tar.gz test/work/bitcoin/build/src/bitcoind
 
     - uses: actions/cache/save@v4
       if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'


Test patch:
diff --git a/test/run_tests.py b/test/run_tests.py
index cde4b65dc..967f11e03 100755
--- a/test/run_tests.py
+++ b/test/run_tests.py
@@ -60,7 +60,7 @@
 parser.add_argument('--jade-path', dest='jade_path', help='Path to Jade qemu emulator', default='work/jade/simulator')
 
 parser.add_argument('--all', help='Run tests on all existing simulators', default=False, action='store_true')
-parser.add_argument('--bitcoind', help='Path to bitcoind', default='work/bitcoin/src/bitcoind')
+parser.add_argument('--bitcoind', help='Path to bitcoind', default='work/bitcoin/build/src/bitcoind')
 parser.add_argument('--interface', help='Which interface to send commands over', choices=['library', 'cli', 'bindist', 'stdin'], default='library')
 
 parser.add_argument("--device-only", help="Only run device tests", action="store_true")
diff --git a/test/setup_environment.sh b/test/setup_environment.sh
index 6a3f948d3..eca894049 100755
--- a/test/setup_environment.sh
+++ b/test/setup_environment.sh
@@ -444,11 +444,10 @@ if [[ -n ${build_bitcoind} ]]; then
 
     # Build bitcoind. This is super slow, but it is cached so it runs fairly quickly.
     pushd depends
-    make NO_QT=1 NO_QR=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1
+    make NO_QT=1 NO_QR=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1 NO_USDT=1
     popd
 
     # Do the build
-    ./autogen.sh
-    CONFIG_SITE=$PWD/depends/x86_64-pc-linux-gnu/share/config.site ./configure --with-incompatible-bdb --with-miniupnpc=no --without-gui --disable-zmq --disable-tests --disable-bench --with-libs=no --with-utils=no
-    make src/bitcoind
+    cmake -B build --toolchain depends/x86_64-pc-linux-gnu/toolchain.cmake -DBUILD_TESTS=OFF -DBUILD_BENCH=OFF
+    cmake --build build --target bitcoind
 fi