Skip to content

Commit

Permalink
tasks: Properly convert sanitizers to meson
Browse files Browse the repository at this point in the history
  • Loading branch information
rgacogne committed Oct 15, 2024
1 parent 76f2179 commit 7a57f5e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-and-test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
needs: get-runner-container-image
strategy:
matrix:
sanitizers: [ubsan+asan, tsan]
sanitizers: [asan+ubsan, tsan]
features: [least, full]
exclude:
- sanitizers: tsan
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
strategy:
matrix:
builder: [autotools, meson]
sanitizers: [ubsan+asan, tsan]
sanitizers: [asan+ubsan, tsan]
features: [least, full]
exclude:
- sanitizers: tsan
Expand Down Expand Up @@ -532,7 +532,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
sanitizers: [ubsan+asan, tsan]
sanitizers: [asan+ubsan, tsan]
dist_name: [debian]
pdns_repo_version: ['48']
container:
Expand Down Expand Up @@ -578,7 +578,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
sanitizers: [ubsan+asan, tsan]
sanitizers: [asan+ubsan, tsan]
dist_name: [debian]
pdns_repo_version: ['48']
container:
Expand Down Expand Up @@ -627,7 +627,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
sanitizers: [ubsan+asan, tsan]
sanitizers: [asan+ubsan, tsan]
threads: [1, 2, 3, 4, 8]
mthreads: [2048]
shards: [1, 2, 1024]
Expand Down Expand Up @@ -672,7 +672,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
sanitizers: [ubsan+asan, tsan]
sanitizers: [asan+ubsan, tsan]
container:
image: "${{ needs.get-runner-container-image.outputs.id }}:${{ needs.get-runner-container-image.outputs.tag }}"
env:
Expand Down
17 changes: 16 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,22 @@ def ci_docs_add_ssh(c, ssh_key, host_key):
def get_sanitizers(meson=False):
sanitizers = os.getenv('SANITIZERS', '')
if meson:
return f'-D b_sanitize={sanitizers}' if sanitizers != '' else ''
subst = {
'tsan': 'thread',
'asan': 'address',
'ubsan': 'undefined'
}
meson_sanitizers = ''
sanitizers = sanitizers.split('+')
for sanitizer in sanitizers:
if sanitizer in subst:
if meson_sanitizers != '':
meson_sanitizers = meson_sanitizers + ','
meson_sanitizers = meson_sanitizers + subst[sanitizer]
else:
meson_sanitizers = meson_sanitizers + sanitizer

return f'-D b_sanitize={meson_sanitizers}' if meson_sanitizers != '' else ''
if sanitizers != '':
sanitizers = sanitizers.split('+')
sanitizers = ['--enable-' + sanitizer for sanitizer in sanitizers]
Expand Down

0 comments on commit 7a57f5e

Please sign in to comment.