Repository: bitcoin/bitcoin (language: cpp)

Issue:
./configure error with --experimental-kernel-lib
The new, experimental `bitcoin-chainstate` is default configured off (https://github.com/bitcoin/bitcoin/pull/24304).  Explicitly turning it off works properly on master:

`./configure --disable-experimental-util-chainstate`

> checking whether to build experimental bitcoin-chainstate... no

However, when I add `--without-experimental-kernel-lib` (which is superfluous, since default is to build if we're building libraries and the experimental bitcoin-chainstate executable - it is default to build libraries, but default not to build bitcoin-chainstate, which we've redundantly stated explicitly).

`./configure --disable-experimental-util-chainstate --without-experimental-kernel-lib`

> checking whether to build experimental bitcoin-chainstate... configure: error: experimental bitcoin-chainstate cannot be built without the experimental bitcoinkernel library. Use --with-experimental-kernel-lib

It seems like it is trying to build the bitcoin-chainstate executable for some reason?  I would expect the same output as before:

> checking whether to build experimental bitcoin-chainstate... no

This is easy to reproduce on master.  


Discussion / hints:
It seems the error is dependent on `--without-experimental-kernel-lib`, since:

`./configure --without-experimental-kernel-lib`

Also produces the error:

> checking whether to build experimental bitcoin-chainstate... configure: error: experimental bitcoin-chainstate cannot be built without the experimental bitcoinkernel library. Use --with-experimental-kernel-lib


Fix patch:
diff --git a/configure.ac b/configure.ac
index 1752fda3447b8..1405adf7025e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1695,11 +1695,12 @@ AM_CONDITIONAL([BUILD_BITCOIN_UTIL], [test $build_bitcoin_util = "yes"])
 AC_MSG_RESULT($build_bitcoin_util)
 
 AC_MSG_CHECKING([whether to build experimental bitcoin-chainstate])
-if test "$build_experimental_kernel_lib" = "no"; then
-AC_MSG_ERROR([experimental bitcoin-chainstate cannot be built without the experimental bitcoinkernel library. Use --with-experimental-kernel-lib]);
-else
-  AM_CONDITIONAL([BUILD_BITCOIN_CHAINSTATE], [test $build_bitcoin_chainstate = "yes"])
+if test "$build_bitcoin_chainstate" = "yes"; then
+  if test "$build_experimental_kernel_lib" = "no"; then
+    AC_MSG_ERROR([experimental bitcoin-chainstate cannot be built without the experimental bitcoinkernel library. Use --with-experimental-kernel-lib]);
+  fi
 fi
+AM_CONDITIONAL([BUILD_BITCOIN_CHAINSTATE], [test $build_bitcoin_chainstate = "yes"])
 AC_MSG_RESULT($build_bitcoin_chainstate)
 
 AC_MSG_CHECKING([whether to build libraries])


Test patch: