Repository navigation
Fix ASan runtime discovery and component loader paths #8721
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
Merged
sa-faizal
merged 3 commits into
main
from
users/safaizal/asan-runtime-discovery-20261003
Oct 8, 2026
Merged
Changes from all commits
Commits
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
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 |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |
| THEROCK_DIR = SCRIPT_DIR.parent.parent.parent | ||
| sys.path.append(str(THEROCK_DIR / "build_tools" / "github_actions")) | ||
| from amdgpu_family_matrix import is_asan | ||
| from configure_asan_env import get_asan_runtime_path | ||
|
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. Not an issue, just an observation. asan env is getting imported in release job also |
||
|
|
||
| # Base Paths | ||
| THEROCK_BIN_DIR = os.getenv("THEROCK_BIN_DIR") | ||
|
|
@@ -97,29 +98,7 @@ | |
|
|
||
| def get_asan_runtime_library(): | ||
| """Return the clang AddressSanitizer runtime path.""" | ||
| machine = platform.machine() | ||
| if machine in ("x86_64", "AMD64"): | ||
| arch = "x86_64" | ||
| elif machine == "aarch64": | ||
| arch = "aarch64" | ||
| else: | ||
| raise RuntimeError(f"Unsupported ASan runtime architecture: {machine}") | ||
|
|
||
| asan_lib = f"libclang_rt.asan-{arch}.so" | ||
| result = subprocess.run( | ||
| [str(THEROCK_CLANG_PLUS_PATH), f"-print-file-name={asan_lib}"], | ||
| check=True, | ||
| capture_output=True, | ||
| text=True, | ||
| env=environ_vars, | ||
| ) | ||
| resolved = result.stdout.strip() | ||
| if not resolved or resolved == asan_lib or not Path(resolved).is_file(): | ||
| raise FileNotFoundError( | ||
| f"Could not locate ASan runtime '{asan_lib}' via {THEROCK_CLANG_PLUS_PATH} " | ||
| f"(got: '{resolved}')" | ||
| ) | ||
| return str(Path(resolved).resolve()) | ||
| return str(get_asan_runtime_path(THEROCK_PATH)) | ||
|
|
||
|
|
||
| def setup_env(): | ||
|
|
@@ -134,7 +113,7 @@ def setup_env(): | |
|
|
||
| if is_asan(): | ||
| # Installed test binaries are built with -shared-libsan, so the clang | ||
| # resource dir holding libclang_rt.asan-<arch>.so must be on the loader | ||
| # resource dir holding the ASan runtime must be on the loader | ||
| # search path. Match rocprofiler-sdk sanitizer defaults for launchers. | ||
| ld_lib_paths.append(str(Path(get_asan_runtime_library()).parent)) | ||
|
|
||
|
|
||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an issue, just an observation. asan env is getting imported in release job also