Skip to content

Commit

Permalink
Sanitizers: check sanitizer modes
Browse files Browse the repository at this point in the history
Summary: Perform sanitizer target platform compatibility checks using configurations.

Reviewed By: benb

Differential Revision: D64823048

fbshipit-source-id: 88d9b39618dfc571b0e311107090c3fb6dc247e0
  • Loading branch information
milend authored and facebook-github-bot committed Oct 23, 2024
1 parent 8db105e commit 6970739
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions prelude/apple/apple_common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ def _skip_universal_resource_dedupe_arg():
"skip_universal_resource_dedupe": attrs.bool(default = _skip_universal_resource_dedupe_default_value()),
}

def _apple_sanitizer_compatibility_arg():
if not is_full_meta_repo():
return {}

return {
"_sanitizer_compatibility": attrs.default_only(attrs.dep(default = "fbsource//tools/build_defs/apple/sanitizers:sanitizer_compatibility")),
}

apple_common = struct(
headers_arg = _headers_arg,
exported_headers_arg = _exported_headers_arg,
Expand All @@ -223,4 +231,5 @@ apple_common = struct(
uses_explicit_modules_arg = _uses_explicit_modules_arg,
meta_apple_library_validation_enabled_arg = _meta_apple_library_validation_enabled_arg,
skip_universal_resource_dedupe_arg = _skip_universal_resource_dedupe_arg,
apple_sanitizer_compatibility_arg = _apple_sanitizer_compatibility_arg,
)
2 changes: 2 additions & 0 deletions prelude/decls/apple_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ apple_binary = prelude_rule(
apple_common.extra_xcode_files() |
apple_common.serialize_debugging_options_arg() |
apple_common.uses_explicit_modules_arg() |
apple_common.apple_sanitizer_compatibility_arg() |
{
"bridging_header": attrs.option(attrs.source(), default = None),
"can_be_asset": attrs.option(attrs.bool(), default = None),
Expand Down Expand Up @@ -706,6 +707,7 @@ apple_test = prelude_rule(
apple_common.extra_xcode_files() |
apple_common.serialize_debugging_options_arg() |
apple_common.uses_explicit_modules_arg() |
apple_common.apple_sanitizer_compatibility_arg() |
{
"asset_catalogs_compilation_options": attrs.dict(key = attrs.string(), value = attrs.any(), default = {}),
"bridging_header": attrs.option(attrs.source(), default = None),
Expand Down

0 comments on commit 6970739

Please sign in to comment.