diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml index 5b1ee3091b..3f009f63bb 100644 --- a/.github/workflows/on-pr.yml +++ b/.github/workflows/on-pr.yml @@ -115,7 +115,6 @@ jobs: os: [linux, macos, windows] with: os: ${{ matrix.os }} - sanitizers: ${{ matrix.sanitizers }} secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/reusable-build-test.yml b/.github/workflows/reusable-build-test.yml index 7ad7e227ef..075d66f11b 100644 --- a/.github/workflows/reusable-build-test.yml +++ b/.github/workflows/reusable-build-test.yml @@ -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 }} diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index f633ee19f9..94e80b8751 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -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: "" diff --git a/.github/workflows/upload-conan-deps.yml b/.github/workflows/upload-conan-deps.yml index f6262a2f1f..4e81914976 100644 --- a/.github/workflows/upload-conan-deps.yml +++ b/.github/workflows/upload-conan-deps.yml @@ -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') }} diff --git a/BUILD.md b/BUILD.md index 74ad41a2b5..1930c3cefe 100644 --- a/BUILD.md +++ b/BUILD.md @@ -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` diff --git a/conan/profiles/ci b/conan/profiles/ci index 0b1ebf34fb..b8c8bd7af0 100644 --- a/conan/profiles/ci +++ b/conan/profiles/ci @@ -1 +1 @@ - include(./incsanitizers) + include(./sanitizers) diff --git a/conan/profiles/incsanitizers b/conan/profiles/sanitizers similarity index 68% rename from conan/profiles/incsanitizers rename to conan/profiles/sanitizers index 6a8f29dd5d..7c762e5da6 100644 --- a/conan/profiles/incsanitizers +++ b/conan/profiles/sanitizers @@ -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 %} \ No newline at end of file