code review changes

Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
This commit is contained in:
Pratik Mankawde
2025-11-05 12:25:29 +00:00
parent e95299dac5
commit 977a087bb3
7 changed files with 49 additions and 35 deletions

View File

@@ -37,7 +37,7 @@ runs:
BUILD_OPTION: ${{ inputs.force_build == 'true' && '*' || 'missing' }} BUILD_OPTION: ${{ inputs.force_build == 'true' && '*' || 'missing' }}
BUILD_TYPE: ${{ inputs.build_type }} BUILD_TYPE: ${{ inputs.build_type }}
LOG_VERBOSITY: ${{ inputs.log_verbosity }} LOG_VERBOSITY: ${{ inputs.log_verbosity }}
CMAKE_SANITIZERS: ${{ inputs.sanitizers }} SANITIZERS: ${{ inputs.sanitizers }}
run: | run: |
echo 'Installing dependencies.' echo 'Installing dependencies.'
mkdir -p "${BUILD_DIR}" mkdir -p "${BUILD_DIR}"

View File

@@ -125,12 +125,6 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
if build_type == 'Release': if build_type == 'Release':
cmake_args = f'{cmake_args} -Dassert=ON' cmake_args = f'{cmake_args} -Dassert=ON'
if os['distro_version'] == 'bookworm':
if sanitizers == 'Address':
cmake_args += ' -fsanitize=address,undefined,float-divide-by-zero,unsigned-integer-overflow'
elif sanitizers == 'Thread':
cmake_args += ' -fsanitize=thread,undefined,float-divide-by-zero,unsigned-integer-overflow'
# We skip all RHEL on arm64 due to a build failure that needs further # We skip all RHEL on arm64 due to a build failure that needs further
# investigation. # investigation.
if os['distro_name'] == 'rhel' and architecture['platform'] == 'linux/arm64': if os['distro_name'] == 'rhel' and architecture['platform'] == 'linux/arm64':
@@ -163,17 +157,39 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
# Add the configuration to the list, with the most unique fields first, # Add the configuration to the list, with the most unique fields first,
# so that they are easier to identify in the GitHub Actions UI, as long # so that they are easier to identify in the GitHub Actions UI, as long
# names get truncated. # names get truncated. Add Address and Thread (both coupled with UB) sanitizers when the distro is bookworm.
configurations.append({ if os['distro_version'] == 'bookworm':
'config_name': config_name, configurations.append({
'cmake_args': cmake_args, 'config_name': config_name,
'cmake_target': cmake_target, 'cmake_args': cmake_args,
'build_only': build_only, 'cmake_target': cmake_target,
'build_type': build_type, 'build_only': build_only,
'os': os, 'build_type': build_type,
'architecture': architecture, 'os': os,
'sanitizers': sanitizers 'architecture': architecture,
}) 'sanitizers': "Address"
})
configurations.append({
'config_name': config_name,
'cmake_args': cmake_args,
'cmake_target': cmake_target,
'build_only': build_only,
'build_type': build_type,
'os': os,
'architecture': architecture,
'sanitizers': "Thread"
})
else:
configurations.append({
'config_name': config_name,
'cmake_args': cmake_args,
'cmake_target': cmake_target,
'build_only': build_only,
'build_type': build_type,
'os': os,
'architecture': architecture,
'sanitizers': "None"
})
return configurations return configurations

View File

@@ -180,6 +180,5 @@
} }
], ],
"build_type": ["Debug", "Release"], "build_type": ["Debug", "Release"],
"cmake_args": ["-Dunity=OFF", "-Dunity=ON"], "cmake_args": ["-Dunity=OFF", "-Dunity=ON"]
"sanitizers": ["None", "Address", "Thread"]
} }

View File

@@ -18,6 +18,5 @@
"cmake_args": [ "cmake_args": [
"-Dunity=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5", "-Dunity=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5",
"-Dunity=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5" "-Dunity=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5"
], ]
"sanitizers": ["None", "Address", "Thread"]
} }

View File

@@ -15,6 +15,5 @@
} }
], ],
"build_type": ["Debug", "Release"], "build_type": ["Debug", "Release"],
"cmake_args": ["-Dunity=OFF", "-Dunity=ON"], "cmake_args": ["-Dunity=OFF", "-Dunity=ON"]
"sanitizers": ["None", "Address", "Thread"]
} }

View File

@@ -1,11 +1 @@
include(./default) include(./incsanitizers)
[settings]
{% set sanitizers = os.getenv("CMAKE_SANITIZERS") %}
[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 %}

View File

@@ -0,0 +1,11 @@
include(./default)
[settings]
{% set sanitizers = os.getenv("SANITIZERS") %}
[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 %}