Skip to content

build: Remove HAVE_CONSENSUS_LIB#29

Closed
Extheoisah wants to merge 1 commit into
bitcoin-fresheyes-master-29123from
TheCharlatan-fresheyes-noconsensus-29123
Closed

build: Remove HAVE_CONSENSUS_LIB#29
Extheoisah wants to merge 1 commit into
bitcoin-fresheyes-master-29123from
TheCharlatan-fresheyes-noconsensus-29123

Conversation

@Extheoisah
Copy link
Copy Markdown
Owner

The script/bitcoinconsensus module defines the public interface for the bitcoinconsensus library. Even though this module is only required by the tests and the bitcoinconsensus library, it is currently compiled into the static internal libbitcoin_consensus library, and therefore used by a bunch of build targets that do not require it.

Since it is always part of the internal library, the HAVE_CONSENSUS_LIB define used by the tests is essentially
meaningless, since the module is always available. This can be verified on master by removing the HAVE_CONSENSUS_LIB checks in the tests, configuring with --with-libs=no, and running make check.

Improve all of this by including the bitcoinconsensus module only where it is required and removing the HAVE_CONSENSUS_LIB define.

An alternative to this patch was discussed in hebasto#41: Actually linking the test binaries with the external consensus library if it is available. This has the disadvantage though that if the dynamic consensus library is built, it has to be available for the test binaries to load whenever and wherever they are being run.

The `script/bitcoinconsensus` module defines the public interface for
the `bitcoinconsensus` library. Even though this module is only required
by the tests and the `bitcoinconsensus` library, it is currently
compiled into the static internal `libbitcoin_consensus` library, and
therefore used by a bunch of build targets that do not require it.

Since it is always part of the internal library, the
`HAVE_CONSENSUS_LIB` define used by the tests is essentially
meaningless, since the module is always available. This can be verified
on master by removing the `HAVE_CONSENSUS_LIB` checks in the tests,
configuring with `--with-libs=no`, and running `make check`.
@Extheoisah Extheoisah closed this Mar 18, 2024
@Extheoisah Extheoisah deleted the TheCharlatan-fresheyes-noconsensus-29123 branch March 18, 2024 06:06
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