Skip to content

Update BUILD for conan2#5478

Merged
bthomee merged 23 commits intodevelopfrom
Bronek/doc_conan2_cmake4
Aug 6, 2025
Merged

Update BUILD for conan2#5478
bthomee merged 23 commits intodevelopfrom
Bronek/doc_conan2_cmake4

Conversation

@Bronek
Copy link
Copy Markdown
Collaborator

@Bronek Bronek commented Jun 6, 2025

High Level Overview of Change

Update BUILD.md for Conan 2, add fixes/workarounds for Apple Clang 17, Clang 20 and CMake 4

Context of Change

This also removes (from BUILD.md only) workarounds for compiler versions which we no longer support e.g. Clang 15 and adds compilation flag -Wno-deprecated-declarations to enable building with Clang 20 on Linux.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

@Bronek Bronek force-pushed the Bronek/doc_conan2_cmake4 branch from d6149cf to 2c7673d Compare June 6, 2025 12:37
@Bronek Bronek requested review from bthomee and intelliot June 6, 2025 12:39
@codecov
Copy link
Copy Markdown

codecov bot commented Jun 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.8%. Comparing base (4eae037) to head (11862bd).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5478     +/-   ##
=========================================
- Coverage     78.8%   78.8%   -0.0%     
=========================================
  Files          814     814             
  Lines        71283   71282      -1     
  Branches      8349    8366     +17     
=========================================
- Hits         56172   56152     -20     
- Misses       15111   15130     +19     

see 7 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Bronek Bronek force-pushed the Bronek/doc_conan2_cmake4 branch 2 times, most recently from d779cad to b4f0deb Compare June 6, 2025 16:42
@Bronek Bronek force-pushed the Bronek/doc_conan2_cmake4 branch from b4f0deb to 41bf097 Compare June 6, 2025 16:45
@Bronek Bronek changed the title Update BUILD for conan2 Update BUILD for conan2, clang-20 compatibility fixes Jun 6, 2025
@Bronek Bronek requested a review from legleux June 6, 2025 17:00
@Bronek Bronek force-pushed the Bronek/doc_conan2_cmake4 branch from 28d6f45 to fe3e732 Compare June 6, 2025 19:49
@Bronek Bronek force-pushed the Bronek/doc_conan2_cmake4 branch from fe3e732 to 7342bb9 Compare June 6, 2025 19:51
@@ -0,0 +1,152 @@
grpc_version: 1.54.3
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.

Why are we adding patches for several versions?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Excellent question. Because that's what I happened to grab from conan-center-index. Removed the irrelevant versions in 87b6381

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.

That's a perfect example why I like my solution with tools.build:cxxflags way more ;)

@Bronek Bronek requested a review from mathbunnyru June 9, 2025 19:08
Copy link
Copy Markdown
Contributor

@mathbunnyru mathbunnyru left a comment

Choose a reason for hiding this comment

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

I left some comments in discussions, please take a look


pipx install 'conan<2'
pipx ensurepath
apt install --yes gcc-${GCC_RELEASE} g++-${GCC_RELEASE} python3-pip \
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm guessing you did this in a container due to the lack of sudo but then the Python 3.11 in Debian 12 pip install conan command cries about needing --break-system-packages to install.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, will remember to add this option.

@Bronek Bronek force-pushed the Bronek/doc_conan2_cmake4 branch 4 times, most recently from 821fff8 to 43579f8 Compare June 11, 2025 02:33
@Bronek Bronek force-pushed the Bronek/doc_conan2_cmake4 branch from 43579f8 to e3d3b00 Compare June 11, 2025 02:35
@Bronek Bronek force-pushed the Bronek/doc_conan2_cmake4 branch from 9948695 to 22fee37 Compare July 23, 2025 11:46
@Bronek Bronek mentioned this pull request Jul 23, 2025
9 tasks
@Bronek Bronek dismissed mathbunnyru’s stale review July 23, 2025 17:16

No longer applies

Copy link
Copy Markdown
Collaborator

@ximinez ximinez left a comment

Choose a reason for hiding this comment

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

I left some feedback, but overall, these instructions are fantastic. They got me migrated and up and running much faster than I expected.

BUILD.md Outdated
Comment on lines 272 to 274
```bash
conan export --version 1.1.10 external/snappy
```
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do you know why we don't specify the version of snappy in conanfile.py? We specify a version for (I think) all of the other dependencies. My build scripts pull the required version numbers out of conanfile.py. Not having it means I have to do it by hand, which isn't a big deal, unless we change the version we need.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That's because RocksDB specifies the version it its conanfile.py:

if self.options.with_snappy:
            self.requires("snappy/1.1.10")

See https://github.com/XRPLF/conan-center-index/blob/master/recipes/rocksdb/all/conanfile.py#L79.

BUILD.md Outdated
Comment on lines 191 to 195
**Windows** developers also must select static runtime

```bash
sed -i.bak -e 's|^compiler\.runtime=.*$|compiler.runtime=static|' ~/.conan2/profiles/default
```
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There's a part under "Build and Test" which includes overriding compiler.runtime for Windows. This seems to be completely unnecessary anymore. My Windows builds worked using the default instructions.

conan install .. --output-folder . --build missing --settings build_type=Release --settings compiler.runtime=MT
conan install .. --output-folder . --build missing --settings build_type=Debug --settings compiler.runtime=MTd

In fact, we may be able to get rid of the bit starting with If you are using a Microsoft Visual C++ compiler, entirely.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It seems like Conan is managing to correctly set the runtime if you set the build_type. I might have to look again (and again).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I am wondering if we really need to use static runtime on Windows; the default is dynamic for good reasons (on Windows, shared libraries are much closer to executables than they are on Linux, and they have their own memory management - obviously within process VM space)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We switch to dynamic runtime for Windows to support updated protobuf and grpc versions here: #5589. In that PR I've removed this section.


[1]: https://github.com/thejohnfreeman/rippled-docker/blob/master/ubuntu-22.04/install.sh

If you use different Linux distribution, hope the instruction above can guide
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How about we just point to the CI Dockerfiles instead of adding the instructions here? That way contributors can see what there system needs to build rippled, they can even use the images directly if they'd like, and we don't need to keep the instructions here in sync.

@Bronek Bronek marked this pull request as ready for review August 4, 2025 15:29
@Bronek Bronek requested a review from ximinez August 4, 2025 15:30
Copy link
Copy Markdown
Collaborator

@ximinez ximinez left a comment

Choose a reason for hiding this comment

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

Updates look good.

@bthomee
Copy link
Copy Markdown
Collaborator

bthomee commented Aug 5, 2025

@Bronek ready to merge?

@Bronek Bronek added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label Aug 6, 2025
@bthomee bthomee enabled auto-merge (squash) August 6, 2025 10:09
@bthomee bthomee merged commit dbeb841 into develop Aug 6, 2025
3 checks passed
@bthomee bthomee deleted the Bronek/doc_conan2_cmake4 branch August 6, 2025 10:18
This was referenced Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants