Skip to content

Commit

Permalink
Remove genrule validation functionality
Browse files Browse the repository at this point in the history
Summary: Removes the genrule validation functionality which is no longer needed.

Reviewed By: d16r, blackm00n

Differential Revision: D52869821

fbshipit-source-id: 7c15f96c5ec7c019bbb56042024b7ace305f6eb0
  • Loading branch information
milend authored and facebook-github-bot committed Jan 19, 2024
1 parent 77a3ae4 commit 6522b8e
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 109 deletions.
4 changes: 0 additions & 4 deletions prelude/apple/apple_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ load(":apple_code_signing_types.bzl", "AppleEntitlementsInfo")
load(":apple_dsym.bzl", "DSYM_SUBTARGET", "get_apple_dsym")
load(":apple_entitlements.bzl", "entitlements_link_flags")
load(":apple_frameworks.bzl", "get_framework_search_path_flags")
load(":apple_genrule_deps.bzl", "get_apple_build_genrule_deps_attr_value", "get_apple_genrule_deps_outputs")
load(":apple_target_sdk_version.bzl", "get_min_deployment_version_for_node", "get_min_deployment_version_target_linker_flags", "get_min_deployment_version_target_preprocessor_flags")
load(":apple_utility.bzl", "get_apple_cxx_headers_layout", "get_apple_stripped_attr_value_with_default_fallback")
load(":apple_validation_deps.bzl", "get_apple_validation_deps_outputs")
Expand Down Expand Up @@ -113,9 +112,6 @@ def apple_binary_impl(ctx: AnalysisContext) -> [list[Provider], Promise]:
)

validation_deps_outputs = get_apple_validation_deps_outputs(ctx)
if get_apple_build_genrule_deps_attr_value(ctx):
validation_deps_outputs += get_apple_genrule_deps_outputs(cxx_attr_deps(ctx))

stripped = get_apple_stripped_attr_value_with_default_fallback(ctx)
constructor_params = CxxRuleConstructorParams(
rule_type = "apple_binary",
Expand Down
4 changes: 0 additions & 4 deletions prelude/apple/apple_bundle.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ load(
)
load(":apple_bundle_utility.bzl", "get_bundle_min_target_version", "get_default_binary_dep", "get_flattened_binary_deps", "get_product_name")
load(":apple_dsym.bzl", "DSYM_INFO_SUBTARGET", "DSYM_SUBTARGET", "get_apple_dsym", "get_apple_dsym_ext", "get_apple_dsym_info")
load(":apple_genrule_deps.bzl", "get_apple_build_genrule_deps_attr_value", "get_apple_genrule_deps_outputs")
load(":apple_sdk.bzl", "get_apple_sdk_name")
load(":apple_universal_binaries.bzl", "create_universal_binary")
load(":apple_validation_deps.bzl", "get_apple_validation_deps_outputs")
Expand Down Expand Up @@ -322,9 +321,6 @@ def apple_bundle_impl(ctx: AnalysisContext) -> list[Provider]:
primary_binary_rel_path = get_apple_bundle_part_relative_destination_path(ctx, primary_binary_part)

validation_deps_outputs = get_apple_validation_deps_outputs(ctx)
if get_apple_build_genrule_deps_attr_value(ctx):
validation_deps_outputs += get_apple_genrule_deps_outputs(ctx.attrs.deps)

sub_targets = assemble_bundle(
ctx,
bundle,
Expand Down
47 changes: 0 additions & 47 deletions prelude/apple/apple_genrule_deps.bzl

This file was deleted.

4 changes: 0 additions & 4 deletions prelude/apple/apple_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ load("@prelude//utils:arglike.bzl", "ArgLike")
load("@prelude//utils:expect.bzl", "expect")
load(":apple_bundle_types.bzl", "AppleBundleLinkerMapInfo", "AppleMinDeploymentVersionInfo")
load(":apple_frameworks.bzl", "get_framework_search_path_flags")
load(":apple_genrule_deps.bzl", "get_apple_build_genrule_deps_attr_value", "get_apple_genrule_deps_outputs")
load(":apple_modular_utility.bzl", "MODULE_CACHE_PATH")
load(":apple_target_sdk_version.bzl", "get_min_deployment_version_for_node", "get_min_deployment_version_target_linker_flags", "get_min_deployment_version_target_preprocessor_flags")
load(":apple_utility.bzl", "get_apple_cxx_headers_layout", "get_apple_stripped_attr_value_with_default_fallback", "get_module_name")
Expand Down Expand Up @@ -223,9 +222,6 @@ def apple_library_rule_constructor_params_and_swift_providers(ctx: AnalysisConte
)

validation_deps_outputs = get_apple_validation_deps_outputs(ctx)
if get_apple_build_genrule_deps_attr_value(ctx):
validation_deps_outputs += get_apple_genrule_deps_outputs(cxx_attr_deps(ctx) + cxx_attr_exported_deps(ctx))

return CxxRuleConstructorParams(
rule_type = params.rule_type,
is_test = (params.rule_type == "apple_test"),
Expand Down
5 changes: 0 additions & 5 deletions prelude/apple/apple_macro_layer.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

load(":apple_bundle_config.bzl", "apple_bundle_config")
load(":apple_dsym_config.bzl", "apple_dsym_config")
load(":apple_genrule_deps.bzl", "get_apple_build_genrule_deps_default_kwargs")
load(":apple_info_plist_substitutions_parsing.bzl", "parse_codesign_entitlements")
load(":apple_package_config.bzl", "apple_package_config")
load(":apple_resource_bundle.bzl", "make_resource_bundle_rule")
Expand Down Expand Up @@ -76,7 +75,6 @@ def apple_test_macro_impl(apple_test_rule, apple_resource_bundle_rule, **kwargs)
kwargs.update(apple_bundle_config())
kwargs.update(apple_dsym_config())
kwargs.update(apple_macro_layer_set_bool_override_attrs_from_config(_APPLE_TEST_LOCAL_EXECUTION_OVERRIDES))
kwargs.update(get_apple_build_genrule_deps_default_kwargs())

# `extension` is used both by `apple_test` and `apple_resource_bundle`, so provide default here
kwargs["extension"] = kwargs.pop("extension", "xctest")
Expand All @@ -89,7 +87,6 @@ def apple_bundle_macro_impl(apple_bundle_rule, apple_resource_bundle_rule, **kwa
info_plist_substitutions = kwargs.get("info_plist_substitutions")
kwargs.update(apple_bundle_config())
kwargs.update(apple_dsym_config())
kwargs.update(get_apple_build_genrule_deps_default_kwargs())
apple_bundle_rule(
_codesign_entitlements = parse_codesign_entitlements(info_plist_substitutions),
_resource_bundle = make_resource_bundle_rule(apple_resource_bundle_rule, **kwargs),
Expand All @@ -100,15 +97,13 @@ def apple_library_macro_impl(apple_library_rule = None, **kwargs):
kwargs.update(apple_dsym_config())
kwargs.update(apple_macro_layer_set_bool_override_attrs_from_config(_APPLE_LIBRARY_LOCAL_EXECUTION_OVERRIDES))
kwargs.update(apple_macro_layer_set_bool_override_attrs_from_config([APPLE_STRIPPED_DEFAULT]))
kwargs.update(get_apple_build_genrule_deps_default_kwargs())
apple_library_rule(**kwargs)

def apple_binary_macro_impl(apple_binary_rule = None, apple_universal_executable = None, **kwargs):
dsym_args = apple_dsym_config()
kwargs.update(dsym_args)
kwargs.update(apple_macro_layer_set_bool_override_attrs_from_config(_APPLE_BINARY_LOCAL_EXECUTION_OVERRIDES))
kwargs.update(apple_macro_layer_set_bool_override_attrs_from_config([APPLE_STRIPPED_DEFAULT]))
kwargs.update(get_apple_build_genrule_deps_default_kwargs())

original_binary_name = kwargs.pop("name")

Expand Down
11 changes: 0 additions & 11 deletions prelude/apple/apple_rules_impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# of this source tree.

load("@prelude//apple:apple_buck2_compatibility.bzl", "BUCK2_COMPATIBILITY_ATTRIB_NAME", "BUCK2_COMPATIBILITY_ATTRIB_TYPE")
load(
"@prelude//apple:apple_genrule_deps.bzl",
"APPLE_BUILD_GENRULE_DEPS_DEFAULT_ATTRIB_NAME",
"APPLE_BUILD_GENRULE_DEPS_DEFAULT_ATTRIB_TYPE",
"APPLE_BUILD_GENRULE_DEPS_TARGET_ATTRIB_NAME",
"APPLE_BUILD_GENRULE_DEPS_TARGET_ATTRIB_TYPE",
)
load("@prelude//apple/swift:swift_incremental_support.bzl", "SwiftCompilationMode")
load("@prelude//apple/swift:swift_toolchain.bzl", "swift_toolchain_impl")
load("@prelude//apple/swift:swift_toolchain_types.bzl", "SwiftObjectFormat")
Expand Down Expand Up @@ -101,8 +94,6 @@ def _apple_binary_extra_attrs():
"_apple_xctoolchain": get_apple_xctoolchain_attr(),
"_apple_xctoolchain_bundle_id": get_apple_xctoolchain_bundle_id_attr(),
"_stripped_default": attrs.bool(default = False),
APPLE_BUILD_GENRULE_DEPS_DEFAULT_ATTRIB_NAME: APPLE_BUILD_GENRULE_DEPS_DEFAULT_ATTRIB_TYPE,
APPLE_BUILD_GENRULE_DEPS_TARGET_ATTRIB_NAME: APPLE_BUILD_GENRULE_DEPS_TARGET_ATTRIB_TYPE,
BUCK2_COMPATIBILITY_ATTRIB_NAME: BUCK2_COMPATIBILITY_ATTRIB_TYPE,
APPLE_VALIDATION_DEPS_ATTR_NAME: APPLE_VALIDATION_DEPS_ATTR_TYPE,
}
Expand Down Expand Up @@ -130,8 +121,6 @@ def _apple_library_extra_attrs():
"_apple_xctoolchain_bundle_id": get_apple_xctoolchain_bundle_id_attr(),
"_stripped_default": attrs.bool(default = False),
APPLE_ARCHIVE_OBJECTS_LOCALLY_OVERRIDE_ATTR_NAME: attrs.option(attrs.bool(), default = None),
APPLE_BUILD_GENRULE_DEPS_DEFAULT_ATTRIB_NAME: APPLE_BUILD_GENRULE_DEPS_DEFAULT_ATTRIB_TYPE,
APPLE_BUILD_GENRULE_DEPS_TARGET_ATTRIB_NAME: APPLE_BUILD_GENRULE_DEPS_TARGET_ATTRIB_TYPE,
BUCK2_COMPATIBILITY_ATTRIB_NAME: BUCK2_COMPATIBILITY_ATTRIB_TYPE,
APPLE_VALIDATION_DEPS_ATTR_NAME: APPLE_VALIDATION_DEPS_ATTR_TYPE,
}
Expand Down
13 changes: 0 additions & 13 deletions prelude/apple/apple_rules_impl_utility.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ load("@prelude//apple:apple_buck2_compatibility.bzl", "BUCK2_COMPATIBILITY_ATTRI
load("@prelude//apple:apple_bundle_attrs.bzl", "get_apple_info_plist_build_system_identification_attrs")
load("@prelude//apple:apple_bundle_types.bzl", "AppleBundleResourceInfo", "AppleBundleTypeAttributeType")
load("@prelude//apple:apple_code_signing_types.bzl", "CodeSignType")
load(
"@prelude//apple:apple_genrule_deps.bzl",
"APPLE_BUILD_GENRULE_DEPS_DEFAULT_ATTRIB_NAME",
"APPLE_BUILD_GENRULE_DEPS_DEFAULT_ATTRIB_TYPE",
"APPLE_BUILD_GENRULE_DEPS_TARGET_ATTRIB_NAME",
"APPLE_BUILD_GENRULE_DEPS_TARGET_ATTRIB_TYPE",
)
load("@prelude//apple:apple_toolchain_types.bzl", "AppleToolchainInfo", "AppleToolsInfo")
load("@prelude//apple/swift:swift_incremental_support.bzl", "SwiftCompilationMode")
load("@prelude//apple/user:apple_selective_debugging.bzl", "AppleSelectiveDebuggingInfo")
Expand Down Expand Up @@ -115,10 +108,6 @@ def apple_test_extra_attrs():
"_macos_idb_companion": attrs.transition_dep(cfg = apple_simulators_transition, default = "fbsource//xplat/buck2/platform/apple:macos_idb_companion", providers = [LocalResourceInfo]),
}
attribs.update(_apple_bundle_like_common_attrs())
attribs.update({
APPLE_BUILD_GENRULE_DEPS_DEFAULT_ATTRIB_NAME: APPLE_BUILD_GENRULE_DEPS_DEFAULT_ATTRIB_TYPE,
APPLE_BUILD_GENRULE_DEPS_TARGET_ATTRIB_NAME: APPLE_BUILD_GENRULE_DEPS_TARGET_ATTRIB_TYPE,
})
return attribs

def apple_xcuitest_extra_attrs():
Expand Down Expand Up @@ -151,8 +140,6 @@ def apple_bundle_extra_attrs():
"universal": attrs.option(attrs.bool(), default = None),
"_apple_toolchain": get_apple_bundle_toolchain_attr(),
"_codesign_entitlements": attrs.option(attrs.source(), default = None),
APPLE_BUILD_GENRULE_DEPS_DEFAULT_ATTRIB_NAME: APPLE_BUILD_GENRULE_DEPS_DEFAULT_ATTRIB_TYPE,
APPLE_BUILD_GENRULE_DEPS_TARGET_ATTRIB_NAME: APPLE_BUILD_GENRULE_DEPS_TARGET_ATTRIB_TYPE,
}
attribs.update(_apple_bundle_like_common_attrs())
return attribs
9 changes: 0 additions & 9 deletions prelude/genrule.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
load("@prelude//:cache_mode.bzl", "CacheModeInfo")
load("@prelude//:genrule_local_labels.bzl", "genrule_labels_require_local")
load("@prelude//:genrule_toolchain.bzl", "GenruleToolchainInfo")
load("@prelude//:genrule_types.bzl", "GENRULE_MARKER_SUBTARGET_NAME", "GenruleMarkerInfo")
load("@prelude//:is_full_meta_repo.bzl", "is_full_meta_repo")
load("@prelude//android:build_only_native_code.bzl", "is_build_only_native_code")
load("@prelude//os_lookup:defs.bzl", "OsLookup")
load("@prelude//utils:expect.bzl", "expect")
load("@prelude//utils:utils.bzl", "flatten", "value_or")

GENRULE_OUT_DIR = "out"
Expand Down Expand Up @@ -347,14 +345,7 @@ def process_genrule(
**metadata_args
)

# Use a subtarget to insert a marker, as callsites make assumptions about
# the providers of `process_genrule()`. We want to have the marker in
# `DefaultInfo` rather than in `genrule_impl()` because we want to identify
# all classes of genrule-like rules.
sub_targets = {k: [DefaultInfo(default_outputs = v)] for (k, v) in named_outputs.items()}
expect(GENRULE_MARKER_SUBTARGET_NAME not in sub_targets, "Conflicting private `{}` subtarget and named output".format(GENRULE_MARKER_SUBTARGET_NAME))
sub_targets[GENRULE_MARKER_SUBTARGET_NAME] = [GenruleMarkerInfo()]

providers = [DefaultInfo(
default_outputs = default_outputs,
sub_targets = sub_targets,
Expand Down
12 changes: 0 additions & 12 deletions prelude/genrule_types.bzl

This file was deleted.

0 comments on commit 6522b8e

Please sign in to comment.