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

BUILD.md: ensure build_type and CMAKE_BUILD_TYPE match #5274

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

intelliot
Copy link
Collaborator

High Level Overview of Change

Running these will result in an error:

conan install .. --output-folder . --build missing --settings build_type=Debug

cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -Dxrpld=ON -Dtests=ON ..

cmake --build .

The build instructions provided 2 conan install lines with different build_type settings, but the "obvious" cmake line used only 1 of them.

Context of Change

In addition to me, I have seen at least 2 other engineers run into this exact same error.

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

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.1%. Comparing base (33e1c42) to head (8123571).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5274     +/-   ##
=========================================
- Coverage     78.1%   78.1%   -0.0%     
=========================================
  Files          790     790             
  Lines        67556   67556             
  Branches      8158    8159      +1     
=========================================
- Hits         52785   52784      -1     
- Misses       14771   14772      +1     

see 3 files with indirect coverage changes

Impacted file tree graph

BUILD.md Outdated
Comment on lines 227 to 232
```
conan install .. --output-folder . --build missing --settings build_type=Release
conan install .. --output-folder . --build missing --settings build_type=Debug
```

To build Debug, set `build_type=Debug` (instead of Release) and in the next step, set `-DCMAKE_BUILD_TYPE=Debug`

Copy link
Collaborator

Choose a reason for hiding this comment

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

How about including both conan install commands?

conan install .. --output-folder . --build missing --settings build_type=Release
conan install .. --output-folder . --build missing --settings build_type=Debug

or even nerdier

for type in Release Debug
do
  conan install .. --output-folder . --build missing --settings build_type=${type}
done

Most developers should be able to build rippled with either setting, and this has them ready for both. If they don't want both, it's more obvious (IMHO) to leave a command out than it is to add a second one if they do. Worst case, they waste the extra time and disk space for something they don't need, but the time is only wasted once.

Copy link
Collaborator Author

@intelliot intelliot Feb 4, 2025

Choose a reason for hiding this comment

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

ok. I moved this line up, since it's what I missed the first time:

    Pass the CMake variable [`CMAKE_BUILD_TYPE`][build_type]
    and make sure it matches the `build_type` setting you chose in the previous
    step.

BUILD.md Outdated Show resolved Hide resolved
intelliot and others added 2 commits February 4, 2025 12:46
Co-authored-by: Ed Hennis <ed@ripple.com>
Comment on lines +263 to +265
Pass the CMake variable [`CMAKE_BUILD_TYPE`][build_type]
and make sure it matches the `build_type` setting you chose in the previous
step.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure how nitpicky I want to be about this. If you build both configurations, as the example above shows, conan is smart enough to combine the outputs in the toolchain file, and you can successfully build with either value in CMAKE_BUILD_TYPE. In other words, you don't necessarily have to wipe the build directory in between to choose one conan config or the other.

I think this is clear enough as-is, but consider:

Suggested change
Pass the CMake variable [`CMAKE_BUILD_TYPE`][build_type]
and make sure it matches the `build_type` setting you chose in the previous
step.
Pass the CMake variable [`CMAKE_BUILD_TYPE`][build_type]
and make sure it matches the one of the `build_type` settings
you chose in the previous step.

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