Sponsored Content
Skip to content

chore: Use CMake components for install - #6485

Merged
legleux merged 6 commits into
developfrom
legleux/use_components
Mar 10, 2026
Merged

chore: Use CMake components for install#6485
legleux merged 6 commits into
developfrom
legleux/use_components

Conversation

@legleux

@legleux legleux commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

High Level Overview of Change

This PR groups xrpl artifacts in different installation groups based on use.

  1. Runtime - executables (xrpld, validator-keys)
  2. Development - libxrpl.a, headers, etc

The CMake target export configuration has been removed also.

Context of Change

Generation of binary packages and Conan packages requires less customization scripts if the installation structure matches the distribution structure.

Removes flaky symlink creation and "works on my machine" hard-coded paths.

runtime_install
├── bin
│   ├── validator-keys
│   └── xrpld
└── etc
    └── xrpld
        ├── validators.txt
        └── xrpld.cfg

development_install (depth truncated for clarity)
├── include
│   └── xrpl
│       ├── basics
│       ├── beast
│       ├── conditions
│       ├── core
│       ├── crypto
│       ├── json
│       ├── ledger
│       ├── net
│       ├── nodestore
│       ├── proto
│       ├── protocol
│       ├── rdb
│       ├── resource
│       ├── server
│       ├── shamap
│       └── tx
└── lib
    ├── libxrpl.a
    └── libxrpl.libpb.a

Remove unconditional installation of 3rd party SDKs

Don't install antithesis-sdk-cpp just because.

Remove rippled/xrpld symlink logic from install targets

This has been fragile and broken things all over the place over the years.
Let this be part of a "to-be-deprecated" binary packaging convenience and let installs from source do what they desire.

if (is_root_project AND TARGET xrpld)
    install(TARGETS xrpld RUNTIME DESTINATION bin COMPONENT runtime)
    set_target_properties(xrpld PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON)
    # sample configs should not overwrite existing files
    # install if-not-exists workaround as suggested by
    # https://cmake.org/Bug/view.php?id=12646
    install(CODE "
    macro (copy_if_not_exists SRC DEST NEWNAME)
      if (NOT EXISTS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${DEST}/\${NEWNAME}\")
        file (INSTALL FILE_PERMISSIONS OWNER_READ OWNER_WRITE DESTINATION \"\${CMAKE_INSTALL_PREFIX}/\${DEST}\" FILES \"\${SRC}\" RENAME \"\${NEWNAME}\")
      else ()
        message (\"-- Skipping : \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${DEST}/\${NEWNAME}\")
      endif ()
    endmacro()
    copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/xrpld-example.cfg\" etc xrpld.cfg)
    copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/validators-example.txt\" etc validators.txt)
  "
  COMPONENT runtime)
    install(CODE "
    set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\")
    include(create_symbolic_link)
    create_symbolic_link(xrpld${suffix} \
       \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/rippled${suffix})
  "
  COMPONENT runtime)
endif ()

Type of Change

  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)

@legleux
legleux requested a review from mathbunnyru March 5, 2026 18:59
@codecov

codecov Bot commented Mar 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.8%. Comparing base (f27d8f3) to head (0b5251f).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #6485   +/-   ##
=======================================
  Coverage     79.8%   79.8%           
=======================================
  Files          862     862           
  Lines        67881   67881           
  Branches      7555    7550    -5     
=======================================
+ Hits         54188   54198   +10     
+ Misses       13693   13683   -10     

see 4 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread cmake/XrplInstall.cmake Outdated
Comment thread cmake/XrplInstall.cmake Outdated
Comment thread cmake/XrplConfig.cmake Outdated
@legleux
legleux force-pushed the legleux/use_components branch from 12df8fd to 2e9eda1 Compare March 6, 2026 20:25

@mathbunnyru mathbunnyru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for merging latest develop, please take a look at comments I left

@legleux
legleux force-pushed the legleux/use_components branch from 2e9eda1 to 1a82819 Compare March 7, 2026 00:43
@legleux
legleux requested a review from mathbunnyru March 7, 2026 00:47
@legleux
legleux force-pushed the legleux/use_components branch from 1a82819 to 9c0ae67 Compare March 7, 2026 03:48
@legleux
legleux force-pushed the legleux/use_components branch from 9c0ae67 to a034694 Compare March 7, 2026 03:57
Comment thread cmake/XrplInstall.cmake
@legleux
legleux enabled auto-merge (squash) March 10, 2026 23:10
@legleux
legleux merged commit eb7c8c6 into develop Mar 10, 2026
1 check passed
@legleux
legleux deleted the legleux/use_components branch March 10, 2026 23:38
@mvadari mvadari added this to the 3.2.0 milestone May 20, 2026
beartec-jpg pushed a commit to beartec-jpg/FalconLedger that referenced this pull request Jun 1, 2026
* chore: Use components for install

* rm CMake export targets

* reformat
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.

3 participants