Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd: move dev/snapshots and common to cli sublibraries #2574

Merged
merged 6 commits into from
Dec 12, 2024

Conversation

canepat
Copy link
Member

@canepat canepat commented Dec 10, 2024

  • support "cli" sublibraries in silkworm_library
  • reorg cmd/common as infra/cli
  • move module-specific options to db/cli, node/cli, rpc/cli and sentry/cli
  • move dev/snapshots sources to db/cli (executable is still defined in cmd)

@canepat canepat added snapshots Framework for BitTorrent-based snapshots maintenance Some maintenance work (fix, refactor, rename, test...) labels Dec 10, 2024
@canepat canepat requested a review from battlmonstr December 10, 2024 10:44
@canepat canepat marked this pull request as ready for review December 10, 2024 10:44
Copy link
Contributor

@battlmonstr battlmonstr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great job 👍 , see comments

cmake/common/targets.cmake Outdated Show resolved Hide resolved
cmd/CMakeLists.txt Outdated Show resolved Hide resolved
cmd/CMakeLists.txt Outdated Show resolved Hide resolved
cmd/CMakeLists.txt Outdated Show resolved Hide resolved
cmd/dev/CMakeLists.txt Outdated Show resolved Hide resolved
silkworm/db/cmd/CMakeLists.txt Outdated Show resolved Hide resolved
silkworm/infra/CMakeLists.txt Outdated Show resolved Hide resolved
@battlmonstr
Copy link
Contributor

ASAN failure is not related to this PR, it was broken on master since #2561

@canepat canepat force-pushed the ci/snapshots_from_cmd_to_silkworm branch from 69205f5 to 0616349 Compare December 11, 2024 14:04
@canepat canepat force-pushed the ci/snapshots_from_cmd_to_silkworm branch from fd99b89 to 8d67bea Compare December 11, 2024 14:22
@canepat canepat requested a review from battlmonstr December 11, 2024 14:49
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.20%. Comparing base (c326201) to head (8d67bea).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2574      +/-   ##
==========================================
- Coverage   51.56%   51.20%   -0.36%     
==========================================
  Files         762      771       +9     
  Lines       51724    52092     +368     
  Branches     8023     8047      +24     
==========================================
+ Hits        26669    26672       +3     
- Misses      22750    23121     +371     
+ Partials     2305     2299       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@battlmonstr battlmonstr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see 1 comment, otherwise LGTM 👍

Comment on lines 59 to 62
# cli subdirectories with CMakeLists.txt belong to silkworm_*_cli libraries
if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "/cli$")
list(FILTER SRC EXCLUDE REGEX "\/cli\/")
endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be placed right after list_filter_dirs(SRC SUB_LIBS) line, otherwise TEST_SRC will get "cli/*" sources included. Perhaps we should rename the initial SRC to ALL_SRC, and then set(SRC ${ALL_SRC}) to avoid this confusion. Sorry for this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved it.

@battlmonstr battlmonstr changed the title cmd: move snapshots utility main and options cmd: refactor cmd common to cli sublibraries Dec 12, 2024
@battlmonstr battlmonstr added snapshots Framework for BitTorrent-based snapshots and removed snapshots Framework for BitTorrent-based snapshots labels Dec 12, 2024
@battlmonstr battlmonstr changed the title cmd: refactor cmd common to cli sublibraries cmd: refactor dev/snapshots and cmd/common to cli sublibraries Dec 12, 2024
@battlmonstr battlmonstr changed the title cmd: refactor dev/snapshots and cmd/common to cli sublibraries cmd: move dev/snapshots and cmd/common to cli sublibraries Dec 12, 2024
@battlmonstr battlmonstr changed the title cmd: move dev/snapshots and cmd/common to cli sublibraries cmd: move dev/snapshots and common to cli sublibraries Dec 12, 2024
@battlmonstr battlmonstr enabled auto-merge (squash) December 12, 2024 08:04
@battlmonstr
Copy link
Contributor

@canepat dev/snapshots.cpp is moved to db/cli, but add_executable(snapshots) is still in dev/CMakeLists.txt. Is there anything that prevents moving it to db/cli/CMakeLists.txt ? One thing that comes to my mind is that cmake/run_smoke_tests.cmake COMMANDS search logic needs to be extended by recursing into cli subdirectories in addition to cmd. This can be done in a follow-up PR.

@battlmonstr battlmonstr merged commit b0bb7a0 into master Dec 12, 2024
10 of 14 checks passed
@battlmonstr battlmonstr deleted the ci/snapshots_from_cmd_to_silkworm branch December 12, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Some maintenance work (fix, refactor, rename, test...) snapshots Framework for BitTorrent-based snapshots
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants