Sponsored Content
Skip to content

fix: Gate -mcmodel flags to x86_64 in sanitizer builds - #7049

Merged
bthomee merged 5 commits into
developfrom
pratik/Fix-snappy-build-issues
Apr 30, 2026
Merged

fix: Gate -mcmodel flags to x86_64 in sanitizer builds#7049
bthomee merged 5 commits into
developfrom
pratik/Fix-snappy-build-issues

Conversation

@pratikmankawde

@pratikmankawde pratikmankawde commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Gate -mcmodel=large (ASAN) and -mcmodel=medium (TSAN) behind x86_64 architecture checks in both the Conan sanitizer profile and CMake sanitizer module, fixing ARM64 ASAN/TSAN CI builds.

Context of Change

The debian-bookworm-gcc-15-arm64-debug-asan CI job fails during the Conan dependency build phase (snappy) with:

cc1plus: sorry, unimplemented: code model 'large' with '-fPIC'

https://github.com/XRPLF/rippled/actions/runs/25019997726/job/73277846482

The CMake module (XrplSanitizers.cmake) already had an is_amd64 guard on the ASAN path but not on the TSAN path. The Conan profile (conan/profiles/sanitizers) had no architecture check at all, causing the flags to propagate to all dependency builds on all architectures.

Testing

Testing on CI by running build with config: debian-bookworm-gcc-15-arm64-debug-asan
Working build: https://github.com/XRPLF/rippled/actions/runs/25121180695/job/73622146413?pr=7049

Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>

@xrplf-ai-reviewer xrplf-ai-reviewer Bot 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.

No issues.

Review by Claude Opus 4.6 · Prompt: V15

Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>

@xrplf-ai-reviewer xrplf-ai-reviewer Bot 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.

Clean fix — no concerns.

Review by Claude Opus 4.6 · Prompt: V15

Comment thread .github/scripts/strategy-matrix/generate.py
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
@pratikmankawde pratikmankawde added the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Apr 29, 2026
@pratikmankawde
pratikmankawde marked this pull request as draft April 29, 2026 16:29

@xrplf-ai-reviewer xrplf-ai-reviewer Bot 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.

Had a look at this

TEMP filter at line 236 will silently skip all CI builds except one ARM64 config — must be removed before merging.


Review by ReviewBot 🤖

Review by Claude Opus 4.6 · Prompt: V15

Comment thread .github/scripts/strategy-matrix/generate.py Outdated
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
@pratikmankawde
pratikmankawde marked this pull request as ready for review April 29, 2026 17:44
@pratikmankawde pratikmankawde removed the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Apr 29, 2026
@codecov

codecov Bot commented Apr 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.1%. Comparing base (f7275b7) to head (38e338d).
⚠️ Report is 7 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #7049   +/-   ##
=======================================
  Coverage     82.1%   82.1%           
=======================================
  Files         1010    1010           
  Lines        75994   75994           
  Branches      7388    7377   -11     
=======================================
+ Hits         62355   62357    +2     
+ Misses       13639   13637    -2     

see 5 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 on lines +156 to +160
if(is_amd64)
message(STATUS " Using medium code model (-mcmodel=medium)")
list(APPEND SANITIZERS_COMPILE_FLAGS "-mcmodel=medium")
list(APPEND SANITIZERS_RELOCATION_FLAGS "-mcmodel=medium")
endif()

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.

In the profile I now see {% set model_code = "-mcmodel=large" %} or {% set model_code = "-mcmodel=medium" %} only for x64 depending on whether address or thread sanitization is requested.

In these if-else statements, why is the mcmodel also explicitly being set? It feels like duplication. Can't the model_code set in the profile be made available here so you can just append it to SANITIZERS_COMPILE_FLAGS and SANITIZERS_RELOCATION_FLAGS, if set?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The profile sets the flags for all dependencies, and then the flags set in XrplSanitizers.cmake are for xrpld.
I think we have had a discussion about de-duplicating this setup before. That can be done in a dedicated initiative.

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 did, and since I keep noticing it let's spend some time on deduplication.

@pratikmankawde
pratikmankawde requested a review from bthomee April 30, 2026 10:59

@xrplf-ai-reviewer xrplf-ai-reviewer Bot 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.

No issues.

Review by Claude Opus 4.6 · Prompt: V15

Comment on lines +156 to +160
if(is_amd64)
message(STATUS " Using medium code model (-mcmodel=medium)")
list(APPEND SANITIZERS_COMPILE_FLAGS "-mcmodel=medium")
list(APPEND SANITIZERS_RELOCATION_FLAGS "-mcmodel=medium")
endif()

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 did, and since I keep noticing it let's spend some time on deduplication.

@pratikmankawde pratikmankawde 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 Apr 30, 2026
@bthomee
bthomee added this pull request to the merge queue Apr 30, 2026
Merged via the queue into develop with commit c6053f5 Apr 30, 2026
3 checks passed
@bthomee
bthomee deleted the pratik/Fix-snappy-build-issues branch April 30, 2026 13:51
marek-foss-neti pushed a commit to marek-foss-neti/rippled that referenced this pull request May 5, 2026
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
beartec-jpg pushed a commit to beartec-jpg/FalconLedger that referenced this pull request Jun 1, 2026
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
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.

3 participants