generated from eclipse-score/module_template
-
Notifications
You must be signed in to change notification settings - Fork 14
Add sanitizer support using GCC toolchain features #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RSingh1511
wants to merge
5
commits into
eclipse-score:main
Choose a base branch
from
RSingh1511:rs/swp-245137
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+212
−0
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e79bcb1
Add sanitizer support using GCC toolchain features
RSingh1511 d2c40e7
Remove TSan from CI due to kernel compatibility issues
RSingh1511 1ede9eb
Fix sanitizer workflow to test //score/... targets
RSingh1511 5bc82b8
Adopt centralized sanitizer infrastructure from score_cpp_policies
RSingh1511 f70f1c0
Add repo-specific suppression files
RSingh1511 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| name: Sanitizers | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
| merge_group: | ||
| types: [checks_requested] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| sanitizer-tests: | ||
| name: Bazel Tests (${{ matrix.sanitizer_config }}) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| sanitizer_config: [asan_ubsan_lsan] | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4.2.2 | ||
| with: | ||
| ref: ${{ github.head_ref || github.event.pull_request.head.ref || github.ref }} | ||
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | ||
|
|
||
| - name: Setup Bazel with shared caching | ||
| uses: bazel-contrib/setup-bazel@0.18.0 | ||
| with: | ||
| bazelisk-version: 1.26.0 | ||
| disk-cache: true | ||
| repository-cache: true | ||
| bazelisk-cache: true | ||
| cache-save: ${{ github.event_name == 'push' }} | ||
|
|
||
| - name: Run sanitizer tests via Bazel | ||
| run: | | ||
| set -euo pipefail | ||
| echo "Running: bazel test --config=${{ matrix.sanitizer_config }} //score/..." | ||
| # Note: Scoped to C/C++ targets only. Rust targets require Rust-specific | ||
| # sanitizer handling and are excluded via tag filters. | ||
| bazel test \ | ||
| --config=${{ matrix.sanitizer_config }} \ | ||
| //score/... \ | ||
| --build_tag_filters=-rust \ | ||
| --test_tag_filters=-rust \ | ||
| --verbose_failures | ||
|
|
||
| - name: Upload Bazel test logs (always) | ||
| if: always() | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: bazel-testlogs-${{ matrix.sanitizer_config }} | ||
| path: bazel-testlogs/**/test.log | ||
| if-no-files-found: warn | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,12 @@ bazel_dep(name = "score_platform", version = "0.5.3", dev_dependency = True) | |
| # Toolchains and extensions | ||
| bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.2.2", dev_dependency = True) | ||
| bazel_dep(name = "score_toolchains_rust", version = "0.4.0", dev_dependency = True) | ||
| bazel_dep(name = "score_cpp_policies", version = "0.0.0", dev_dependency = True) | ||
| git_override( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this is done to verify adoption of score_cpp_policies in logging repo. This should be replaced with correct bazel_dep version and not point to a local branch. |
||
| module_name = "score_cpp_policies", | ||
| commit = "07a78d6", | ||
| remote = "https://github.com/RSingh1511/score_cpp_policies.git", | ||
| ) | ||
|
|
||
| # S-CORE crates | ||
| bazel_dep(name = "score_crates", version = "0.0.6") | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| filegroup( | ||
| name = "repo_suppressions", | ||
| srcs = [ | ||
| "asan.supp", | ||
| "lsan.supp", | ||
| "tsan.supp", | ||
| "ubsan.supp", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| # Suppressions for the AddressSanitizer | ||
| # See: https://clang.llvm.org/docs/AddressSanitizer.html#issue-suppression | ||
| # Every suppression requires a justification. | ||
| # Suppressions that share the same justification may be organized in a single block. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| # Suppressions for the LeakSanitizer | ||
| # See: https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer#suppressions | ||
| # Every suppression requires a justification. | ||
| # Suppressions that share the same justification may be organized in a single block. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| # Suppressions for the ThreadSanitizer | ||
| # See: https://github.com/google/sanitizers/wiki/ThreadSanitizerSuppressions | ||
| # Every suppression requires a justification. | ||
| # Suppressions that share the same justification may be organized in a single block. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| # Suppressions for the UndefinedBehaviorSanitizer | ||
| # See: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#runtime-suppressions | ||
| # Every suppression requires a justification. | ||
| # Suppressions that share the same justification may be organized in a single block. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.