ci: break core archive SCC via per-archive OBJECT libraries (#22/#39) - #63
Merged
Conversation
Flip the 9 first-party STATIC archives in the core link SCC (core, pool,
sharechain, ltc, ltc_coin, c2pool_storage, c2pool_payout, c2pool_hashrate,
c2pool_merged_mining) to OBJECT libraries, replacing the GNU-ld-only
LINK_GROUP:RESCAN band-aid with a linker-agnostic shape (MSVC/AppleClang).
Break the core<->{payout,hashrate,merged_mining} cycle acyclically: core
propagates those three as INTERFACE deps so every consumer pools their
objects (core/web_server.o references their symbols), while they no longer
link core (header-only access via the global src/ include) -- CMake rejects
non-STATIC SCC cycles. c2pool_difficulty stays a STATIC leaf outside the SCC
with its core link dropped so its archive does not absorb core OBJECT files.
core_util/btclibs stay STATIC. Retire all 4 LINK_GROUP:RESCAN sites; OBJECT
transitive propagation lets consumers fall back to core+ltc. Source-level
dissolution of core web_server deps deferred to V37.
The OBJECT-lib boundary (de25cd2) added a keyword-signature target_link_libraries(core INTERFACE ...) in src/c2pool/CMakeLists.txt while src/core/CMakeLists.txt still used the plain signature, which CMake rejects (all uses on a target must be all-keyword or all-plain). Convert core core_util/btclibs and Boost/yaml/json/leveldb link calls to PUBLIC, matching the OBJECT-library propagation intent (consumers pool cores objects and need its usage requirements).
The five-lib enumeration (c2pool_hashrate, c2pool_merged_mining, c2pool_payout, c2pool_storage, ltc_coin) was incomplete: pool owns pool::parse_net_error (src/pool/node.cpp) and is reachable only transitively, so its objects did not propagate into the exe/test links. Name pool directly alongside the other OBJECT sets on c2pool, c2pool_enhanced, test_ltc_node, ltc_pool_test per the ratified direct-naming pattern. CMake-only; no coin-tree or source changes. Canonical Conan build links 100% green.
…plete type (#22/#39) Two cross-platform compile failures on PR #63 (neither is LINK_GROUP:RESCAN): Windows (C1083 leveldb/db.h in c2pool_storage): the c2pool_storage OBJECT lib compiles storage/sharechain_storage.cpp which pulls core/leveldb_store.hpp -> <leveldb/db.h>, but it deliberately does not link core (SCC break), so the leveldb include dir never reached it. On Conan/MSVC that dir propagates only via the leveldb::leveldb imported target. Add ${LEVELDB_LIBRARIES} to c2pool_storage so it carries the usage requirement itself (Linux found db.h on the default system path, hence the platform-specific failure). macOS (incomplete type core::INetwork at socket.hpp:174): make_socket() dynamic_casts to INetwork* and calls weak_from_this(), both requiring a complete type, but socket.hpp only forward-declared it (full def was in factory.hpp, which includes socket.hpp — a cycle). Extract INetwork into core/inetwork.hpp, included by socket.hpp and factory.hpp. AppleClang/MSVC diagnose the incomplete non- dependent type at template-parse time where GCC tolerated it.
…#39) macOS arm64 link failed: undefined Boost.Log symbols (open_record, push_record_move, get_logging_enabled, trivial::logger::get) from payout_manager.cpp.o and merged_mining.cpp.o. Both TUs include <core/log.hpp> (LOG_* -> Boost.Log trivial). Their OBJECT libs deliberately do not link core (SCC break), so they no longer inherit cores PUBLIC Boost::log/Boost::log_setup. They fell back to the legacy ${Boost_LIBRARIES} variable, which does not reliably resolve the log component through ld64 static archives on AppleClang arm64; GCC/MSVC tolerated it. Fix: name Boost::log/Boost::log_setup imported targets explicitly on c2pool_payout and c2pool_merged_mining, same fix class as the ratified c2pool_storage/leveldb usage-requirement carry. CMake-only, no coin tree touched. Linux x86_64 re-verified green.
sharechain_storage.cpp.o was the remaining arm64 undefined-symbol source
(run 26944904869). It includes <core/log.hpp> (LOG_* -> Boost.Log trivial)
but the OBJECT-SCC break means c2pool_storage does not link core, so it
fell back to legacy ${Boost_LIBRARIES} which ld64 will not resolve. Name
Boost::log + Boost::log_setup explicitly, same carry pattern already
applied to c2pool_payout and c2pool_merged_mining.
…JECT libs (#22/#39) Both libs use Boost.Log internally (tracker.cpp, adjustment_engine.cpp) but do not link core after the OBJECT-lib SCC break, so ld64 on AppleClang arm64 fails to resolve Boost.Log symbols. Carry Boost::log + Boost::log_setup explicitly, same pattern as c2pool_storage/c2pool_payout/c2pool_merged_mining.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves the core static-archive strong-connectivity cycle (#22/#39) by converting the cyclic core archives into per-archive OBJECT libraries and direct-naming each OBJECT set on the final exe/test link lines (OBJECT objects do not propagate transitively through an intermediate OBJECT lib, so each must be named where it is consumed).
OBJECT-SCC set (6 libs)
Scope
CMake-only. No coin-tree or source changes. Eight CMakeLists.txt touched; full-SCC direct-naming pattern (canonical per PR #54).
Validation
Canonical Conan 2 build links 100% green across all targets (no undefined references; all executables built).
Merge gate
Merge is operator-gated — do not merge without explicit push approval.