build: libbitcoin_util unexpected(?)/undocumented dependencies #28548

issue hebasto openend this issue on September 28, 2023
  1. hebasto commented at 12:15 pm on September 28, 2023: member

    According to our design docs:

    libbitcoin_util … should not depend on other internal libraries.

    However, it effectively depends on the following internal libraries:

    1. libbitcoin_crypto, which provides symbols as follows:

      • CSHA256
      • CSHA512
      • CSipHasher
    2. libbitcoin_consensus, which provides symbols as follows:

      • CPubKey::RecoverCompact
    3. libbitcoin_common, which provides symbols as follows:

      • PKHash(const CPubKey&)
      • ArgsManager::AddArg
      • ArgsManager::SelectConfigNetwork
      • DecodeDestination
      • IsValidDestination
      • CKey::SignCompact

    However, libbitcoin_crypto and libbitcoin_common themselves depend on libbitcoin_util.

    The diverging from our design goals does not break builds because at the link stage, all dependent libraries are passed to the linker.

  2. hebasto commented at 12:15 pm on September 28, 2023: member
  3. ryanofsky commented at 1:39 pm on September 28, 2023: contributor

    It’s be helpful to know which compilation units in libbitcoin_util are using the symbols in libbitcoin_consensus and libbitcoin_common, but I’d guess probably that code should just be moved out of libbitcoin_util into one of those libraries.

    I think the libbitcoin_crypto dependencies are probably not a concern. The libraries document doesn’t even mention libbitcoin_crypto, so I it could be added as depenency of libbitcoin_util.

  4. hebasto commented at 1:42 pm on September 28, 2023: member

    It’s be helpful to know which compilation units in libbitcoin_util are using the symbols in libbitcoin_consensus…

    It is the CPubKey::RecoverCompact symbol in message.cpp:https://github.com/bitcoin/bitcoin/blob/6619d6a8dca5a4d8e664a76526ac6bef3eb17831/src/util/message.cpp#L46 Also please see #28549,

  5. hebasto commented at 1:42 pm on September 28, 2023: member

    It’s be helpful to know which compilation units in libbitcoin_util are using the symbols in … libbitcoin_common…

    I’ll provide mode details shortly.

  6. hebasto commented at 3:19 pm on September 28, 2023: member

    It’s be helpful to know which compilation units in libbitcoin_util are using the symbols in … libbitcoin_common…

    I’ll provide mode details shortly.

    • src/chainparamsbase.cpp
    • src/clientversion.cpp
    • src/util/error.cpp
    • src/util/message.cpp
  7. ryanofsky commented at 5:14 pm on May 14, 2024: contributor
    Looks like this issue should be resolved by #29015, which makes util no longer depend on common or consensus libraries. It does still depend on the crypto library, which #29015 handles by just documenting the dependency. Another option could be to move RNG and hashing functionality out of util so it does not depend on the crypto library anymore, but for now there does not seem to be a reason to do this.
  8. willcl-ark commented at 9:08 am on July 1, 2024: member

    Seems that we can close this now that #29015 has been merged.

    Let me know if this is a mistake and this shouldn’t be closed until libbitcoin_util doesn’t depend on libbitcoin_crypto.

  9. willcl-ark closed this on Jul 1, 2024


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 18:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me