Skip to content

ci: break core archive SCC via per-archive OBJECT libraries (#22/#39) - #63

Merged
frstrtr merged 7 commits into
masterfrom
ci-steward/object-lib
Jun 4, 2026
Merged

ci: break core archive SCC via per-archive OBJECT libraries (#22/#39)#63
frstrtr merged 7 commits into
masterfrom
ci-steward/object-lib

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 4, 2026

Copy link
Copy Markdown
Owner

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)

  • c2pool_hashrate
  • c2pool_merged_mining
  • c2pool_payout
  • c2pool_storage
  • ltc_coin
  • pool (owns pool::parse_net_error in src/pool/node.cpp; reachable only transitively in the five-lib enumeration, so its objects were dropped from the exe link — extending to six is the correct scope)

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.

frstrtr added 7 commits June 3, 2026 22:52
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.
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.

1 participant