fixes sanitizer arg not available in build-test

Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
This commit is contained in:
Pratik Mankawde
2025-11-05 15:14:29 +00:00
parent ada523071f
commit b150feaab6
7 changed files with 10 additions and 11 deletions

View File

@@ -115,7 +115,6 @@ jobs:
os: [linux, macos, windows]
with:
os: ${{ matrix.os }}
sanitizers: ${{ matrix.sanitizers }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -23,11 +23,6 @@ on:
required: false
type: string
default: "minimal"
sanitizers:
description: "The sanitizers to enable ('Address+UndefinedBehaviour' or 'Thread+UndefinedBehaviour')."
required: false
type: string
default: ""
secrets:
CODECOV_TOKEN:
description: "The Codecov token to use for uploading coverage reports."
@@ -59,6 +54,6 @@ jobs:
runs_on: ${{ toJSON(matrix.architecture.runner) }}
image: ${{ contains(matrix.architecture.platform, 'linux') && format('ghcr.io/xrplf/ci/{0}-{1}:{2}-{3}-sha-{4}', matrix.os.distro_name, matrix.os.distro_version, matrix.os.compiler_name, matrix.os.compiler_version, matrix.os.image_sha) || '' }}
config_name: ${{ matrix.config_name }}
sanitizers: ${{ inputs.sanitizers }}
sanitizers: ${{ matrix.sanitizers }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -21,7 +21,7 @@ on:
type: string
sanitizers:
description: "The sanitizers to enable ('Address+UndefinedBehaviour' or 'Thread+UndefinedBehaviour')."
required: false
required: true
type: string
default: ""

View File

@@ -95,6 +95,7 @@ jobs:
# Set the verbosity to "quiet" for Windows to avoid an excessive
# amount of logs. For other OSes, the "verbose" logs are more useful.
log_verbosity: ${{ runner.os == 'Windows' && 'quiet' || 'verbose' }}
sanitizers: ${{ matrix.sanitizers }}
- name: Log into Conan remote
if: ${{ github.repository_owner == 'XRPLF' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}

View File

@@ -365,7 +365,7 @@ tools.build:cxxflags=['-DBOOST_ASIO_DISABLE_CONCEPTS']
profile in the `conan install` command.
```
SANITIZERS=Address conan install .. --output-folder . --profile incsanitizers --build missing --settings build_type=Debug
SANITIZERS=Address conan install .. --output-folder . --profile sanitizers --build missing --settings build_type=Debug
```
Available options for SANITIZERS: `Address` and `Thread`

View File

@@ -1 +1 @@
include(./incsanitizers)
include(./sanitizers)

View File

@@ -2,10 +2,14 @@ include(./default)
[settings]
{% set sanitizers = os.getenv("SANITIZERS") %}
{% if sanitizers == "Address" or sanitizers == "Thread" %}
user.package:sanitizers={{ sanitizers }}
tools.info.package_ids:confs+=["user.package:sanitizers"]
{% endif %}
[conf]
{% if sanitizers == "Address" %}
tools.build:cxxflags+=['-fsanitize=address,undefined,float-divide-by-zero,unsigned-integer-overflow']
{% elif sanitizers == "Thread" %}
tools.build:cxxflags+=['-fsanitize=thread,undefined,float-divide-by-zero,unsigned-integer-overflow']
{% endif %}
{% endif %}