diff --git a/.buckconfig b/.buckconfig index 1fe72c203..1fc16ae9b 100644 --- a/.buckconfig +++ b/.buckconfig @@ -11,4 +11,4 @@ config = ovr_config [buildfile] [not_buildfile] # @oss-enable -name = TARGETS +name_v2 = TARGETS.v2,TARGETS,BUCK.v2,BUCK diff --git a/BUCK b/BUCK index a95349844..45335415e 100644 --- a/BUCK +++ b/BUCK @@ -37,7 +37,7 @@ prelude.filegroup( prelude.genrule( name = "copy_android_constraint", out = "BUCK.v2", - cmd = "cp $(location prelude//android/constraints:files)/TARGETS.v2 $OUT", + cmd = "cp $(location prelude//android/constraints:files)/BUCK.v2 $OUT", visibility = ["PUBLIC"], ) diff --git a/apple/apple_binary.bzl b/apple/apple_binary.bzl index 921a06ced..93873701c 100644 --- a/apple/apple_binary.bzl +++ b/apple/apple_binary.bzl @@ -10,7 +10,7 @@ load("@prelude//:paths.bzl", "paths") load("@prelude//:validation_deps.bzl", "get_validation_deps_outputs") load("@prelude//apple:apple_stripping.bzl", "apple_strip_args") load("@prelude//apple:apple_utility.bzl", "get_module_name") -# @oss-disable: load("@prelude//apple/meta_only:linker_outputs.bzl", "get_extra_linker_output_flags", "get_extra_linker_outputs") +# @oss-disable[end= ]: load("@prelude//apple/meta_only:linker_outputs.bzl", "get_extra_linker_output_flags", "get_extra_linker_outputs") load( "@prelude//apple/swift:swift_compilation.bzl", "compile_swift", @@ -252,12 +252,12 @@ def apple_binary_impl(ctx: AnalysisContext) -> [list[Provider], Promise]: def _get_extra_linker_outputs(ctx: AnalysisContext) -> ExtraLinkerOutputs: _ = ctx # buildifier: disable=unused-variable - # @oss-disable: return get_extra_linker_outputs(ctx) + # @oss-disable[end= ]: return get_extra_linker_outputs(ctx) return ExtraLinkerOutputs() # @oss-enable def _get_extra_linker_outputs_flags(ctx: AnalysisContext, outputs: dict[str, Artifact]) -> list[ArgLike]: _ = ctx # buildifier: disable=unused-variable - # @oss-disable: return get_extra_linker_output_flags(ctx, outputs) + # @oss-disable[end= ]: return get_extra_linker_output_flags(ctx, outputs) return [] # @oss-enable def _filter_swift_srcs(ctx: AnalysisContext) -> (list[CxxSrcWithFlags], list[CxxSrcWithFlags]): diff --git a/apple/apple_bundle.bzl b/apple/apple_bundle.bzl index 6d1380c05..ef177744b 100644 --- a/apple/apple_bundle.bzl +++ b/apple/apple_bundle.bzl @@ -16,7 +16,7 @@ load("@prelude//:validation_deps.bzl", "get_validation_deps_outputs") load("@prelude//apple:apple_toolchain_types.bzl", "AppleToolchainInfo", "AppleToolsInfo") load("@prelude//apple:apple_xctest_frameworks_utility.bzl", "get_xctest_frameworks_bundle_parts") load("@prelude//apple:debug.bzl", "AppleSelectiveDebuggableMetadata") -# @oss-disable: load("@prelude//apple/meta_only:linker_outputs.bzl", "subtargets_for_apple_bundle_extra_outputs") +# @oss-disable[end= ]: load("@prelude//apple/meta_only:linker_outputs.bzl", "subtargets_for_apple_bundle_extra_outputs") load("@prelude//apple/user:apple_selected_debug_path_file.bzl", "SELECTED_DEBUG_PATH_FILE_NAME") load("@prelude//apple/user:apple_selective_debugging.bzl", "AppleSelectiveDebuggingInfo") load("@prelude//apple/validation:debug_artifacts.bzl", "get_debug_artifacts_validators") @@ -426,8 +426,8 @@ def apple_bundle_impl(ctx: AnalysisContext) -> list[Provider]: # Collect extra bundle outputs extra_output_provider = _extra_output_provider(ctx) - # @oss-disable: extra_output_subtargets = subtargets_for_apple_bundle_extra_outputs(ctx, extra_output_provider) - # @oss-disable: sub_targets.update(extra_output_subtargets) + # @oss-disable[end= ]: extra_output_subtargets = subtargets_for_apple_bundle_extra_outputs(ctx, extra_output_provider) + # @oss-disable[end= ]: sub_targets.update(extra_output_subtargets) # index store index_store_subtargets, index_store_info = _index_store_data(ctx) diff --git a/apple/apple_error_handler.bzl b/apple/apple_error_handler.bzl index 674182f39..bd6097455 100644 --- a/apple/apple_error_handler.bzl +++ b/apple/apple_error_handler.bzl @@ -6,7 +6,7 @@ # of this source tree. load("@prelude//apple:apple_error_handler_types.bzl", "AppleErrorCategories") -# @oss-disable: load("@prelude//apple/meta_only:apple_extra_error_categories.bzl", "APPLE_META_STDERR_ERROR_CATEGORIES") +# @oss-disable[end= ]: load("@prelude//apple/meta_only:apple_extra_error_categories.bzl", "APPLE_META_STDERR_ERROR_CATEGORIES") _APPLE_STDERR_ERROR_CATEGORIES = [ #codesigning issues @@ -58,6 +58,6 @@ def apple_build_error_handler(ctx: ActionErrorCtx) -> list[ActionSubError]: lowercase_stderr = ctx.stderr.lower() categories = set() _add_category_strings(lowercase_stderr, categories, _APPLE_STDERR_ERROR_CATEGORIES) - # @oss-disable: _add_category_strings(lowercase_stderr, categories, APPLE_META_STDERR_ERROR_CATEGORIES) + # @oss-disable[end= ]: _add_category_strings(lowercase_stderr, categories, APPLE_META_STDERR_ERROR_CATEGORIES) return [ctx.new_sub_error(category = category_string) for category_string in sorted(categories)] diff --git a/apple/apple_library.bzl b/apple/apple_library.bzl index 99fab5a78..3cc7af938 100644 --- a/apple/apple_library.bzl +++ b/apple/apple_library.bzl @@ -17,8 +17,8 @@ load("@prelude//apple:apple_dsym.bzl", "DSYM_SUBTARGET", "get_apple_dsym") load("@prelude//apple:apple_error_handler.bzl", "apple_build_error_handler") load("@prelude//apple:apple_stripping.bzl", "apple_strip_args") load("@prelude//apple:apple_toolchain_types.bzl", "AppleToolchainInfo") -# @oss-disable: load("@prelude//apple/meta_only:apple_library_meta_validation.bzl", "apple_library_validate_for_meta_restrictions") -# @oss-disable: load("@prelude//apple/meta_only:linker_outputs.bzl", "get_extra_linker_output_flags", "get_extra_linker_outputs") +# @oss-disable[end= ]: load("@prelude//apple/meta_only:apple_library_meta_validation.bzl", "apple_library_validate_for_meta_restrictions") +# @oss-disable[end= ]: load("@prelude//apple/meta_only:linker_outputs.bzl", "get_extra_linker_output_flags", "get_extra_linker_outputs") load("@prelude//apple/mockingbird:mockingbird_types.bzl", "MockingbirdLibraryInfo", "MockingbirdLibraryInfoTSet", "MockingbirdLibraryRecord", "MockingbirdSourcesInfo", "MockingbirdTargetType") load( "@prelude//apple/swift:swift_compilation.bzl", @@ -146,7 +146,7 @@ AppleLibraryForDistributionInfo = provider( ) def apple_library_impl(ctx: AnalysisContext) -> [Promise, list[Provider]]: - # @oss-disable: apple_library_validate_for_meta_restrictions(ctx) + # @oss-disable[end= ]: apple_library_validate_for_meta_restrictions(ctx) def get_apple_library_providers(deps_providers) -> list[Provider]: shared_type = AppleSharedLibraryMachOFileType(ctx.attrs.shared_library_macho_file_type) @@ -549,12 +549,12 @@ def apple_library_rule_constructor_params_and_swift_providers(ctx: AnalysisConte def _get_extra_linker_outputs(ctx: AnalysisContext) -> ExtraLinkerOutputs: _ = ctx # buildifier: disable=unused-variable - # @oss-disable: return get_extra_linker_outputs(ctx) + # @oss-disable[end= ]: return get_extra_linker_outputs(ctx) return ExtraLinkerOutputs() # @oss-enable def _get_extra_linker_outputs_flags(ctx: AnalysisContext, outputs: dict[str, Artifact]) -> list[ArgLike]: _ = ctx # buildifier: disable=unused-variable - # @oss-disable: return get_extra_linker_output_flags(ctx, outputs) + # @oss-disable[end= ]: return get_extra_linker_output_flags(ctx, outputs) return [] # @oss-enable def _filter_swift_srcs(ctx: AnalysisContext, additional_srcs: list = []) -> (list[CxxSrcWithFlags], list[CxxSrcWithFlags]): diff --git a/apple/apple_test.bzl b/apple/apple_test.bzl index 471bce40f..852a7fa1f 100644 --- a/apple/apple_test.bzl +++ b/apple/apple_test.bzl @@ -12,8 +12,8 @@ load( load("@prelude//apple:apple_library.bzl", "AppleLibraryAdditionalParams", "apple_library_rule_constructor_params_and_swift_providers") load("@prelude//apple:apple_toolchain_types.bzl", "AppleToolchainInfo") load("@prelude//apple:apple_xctest_frameworks_utility.bzl", "get_xctest_frameworks_bundle_parts") -# @oss-disable: load("@prelude//apple/meta_only:apple_test_re_capabilities.bzl", "ios_test_re_capabilities", "macos_test_re_capabilities") -# @oss-disable: load("@prelude//apple/meta_only:apple_test_re_use_case.bzl", "apple_test_re_use_case") +# @oss-disable[end= ]: load("@prelude//apple/meta_only:apple_test_re_capabilities.bzl", "ios_test_re_capabilities", "macos_test_re_capabilities") +# @oss-disable[end= ]: load("@prelude//apple/meta_only:apple_test_re_use_case.bzl", "apple_test_re_use_case") load("@prelude//apple/swift:swift_compilation.bzl", "get_swift_anonymous_targets", "uses_explicit_modules") load( "@prelude//cxx:argsfiles.bzl", @@ -235,15 +235,15 @@ def _get_test_info(ctx: AnalysisContext, xctest_bundle: Artifact, test_host_app_ remote_execution_properties = ctx.attrs.test_re_capabilities elif sdk_name == MacOSXSdkMetadata.name: - # @oss-disable: remote_execution_properties = macos_test_re_capabilities() + # @oss-disable[end= ]: remote_execution_properties = macos_test_re_capabilities() remote_execution_properties = None # @oss-enable else: - # @oss-disable: requires_ios_booted_simulator = ctx.attrs.test_host_app != None or ctx.attrs.ui_test_target_app != None - # @oss-disable: remote_execution_properties = ios_test_re_capabilities(use_unbooted_simulator = not requires_ios_booted_simulator) + # @oss-disable[end= ]: requires_ios_booted_simulator = ctx.attrs.test_host_app != None or ctx.attrs.ui_test_target_app != None + # @oss-disable[end= ]: remote_execution_properties = ios_test_re_capabilities(use_unbooted_simulator = not requires_ios_booted_simulator) remote_execution_properties = None # @oss-enable - # @oss-disable: remote_execution_use_case = ctx.attrs.test_re_use_case or apple_test_re_use_case(macos_test = sdk_name == MacOSXSdkMetadata.name) + # @oss-disable[end= ]: remote_execution_use_case = ctx.attrs.test_re_use_case or apple_test_re_use_case(macos_test = sdk_name == MacOSXSdkMetadata.name) remote_execution_use_case = None # @oss-enable local_enabled = remote_execution_use_case == None diff --git a/apple/swift/swift_compilation.bzl b/apple/swift/swift_compilation.bzl index 3e6f44d95..9a6610a2b 100644 --- a/apple/swift/swift_compilation.bzl +++ b/apple/swift/swift_compilation.bzl @@ -140,7 +140,7 @@ SwiftDebugInfo = record( _IS_USER_BUILD = True # @oss-enable # @oss-disable: # To determine whether we're running on CI or not, we expect user.sandcastle_alias to be set. -# @oss-disable: _IS_USER_BUILD = (read_root_config("user", "sandcastle_alias", None) == None) +# @oss-disable[end= ]: _IS_USER_BUILD = (read_root_config("user", "sandcastle_alias", None) == None) _REQUIRED_SDK_MODULES = ["Swift", "SwiftOnoneSupport", "Darwin", "_Concurrency", "_StringProcessing"] diff --git a/apple/tools/BUCK.v2 b/apple/tools/BUCK.v2 index e641a99dc..ea59bbf16 100644 --- a/apple/tools/BUCK.v2 +++ b/apple/tools/BUCK.v2 @@ -9,7 +9,7 @@ source_listing() apple_tools( name = "apple-tools", adhoc_codesign_tool = None, # @oss-enable - # @oss-disable: adhoc_codesign_tool = "prelude//apple/tools/meta_only/codesign_rust:adhoc-signer", + # @oss-disable[end= ]: adhoc_codesign_tool = "prelude//apple/tools/meta_only/codesign_rust:adhoc-signer", assemble_bundle = "prelude//apple/tools/bundling:assemble_bundle", dry_codesign_tool = ":dry_codesign_tool", framework_sanitizer = ":framework_sanitizer", diff --git a/apple/tools/defs.bzl b/apple/tools/defs.bzl index a1918efe3..68879695b 100644 --- a/apple/tools/defs.bzl +++ b/apple/tools/defs.bzl @@ -5,7 +5,7 @@ # License, Version 2.0 found in the LICENSE-APACHE file in the root directory # of this source tree. -# @oss-disable: load("@fbsource//tools/build_defs:python_platform.bzl", "set_platform_decorator_for_python") +# @oss-disable[end= ]: load("@fbsource//tools/build_defs:python_platform.bzl", "set_platform_decorator_for_python") load("@prelude//:is_full_meta_repo.bzl", "is_full_meta_repo") load("@prelude//:native.bzl", _native = "native") @@ -14,7 +14,7 @@ set_platform_decorator_for_python = lambda **kwargs: kwargs # @oss-enable def meta_python_test(name, **kwargs): # Set the platform attributes as needed for proper exec platform resolution kwargs = set_platform_decorator_for_python( - # @oss-disable: set_python_constraint_overrides = True, + # @oss-disable[end= ]: set_python_constraint_overrides = True, **kwargs ) diff --git a/ide_integrations/xcode/argsfiles.bzl b/ide_integrations/xcode/argsfiles.bzl index 7a4836770..22fe1dab9 100644 --- a/ide_integrations/xcode/argsfiles.bzl +++ b/ide_integrations/xcode/argsfiles.bzl @@ -5,10 +5,10 @@ # License, Version 2.0 found in the LICENSE-APACHE file in the root directory # of this source tree. -# @oss-disable: load("@prelude//apple/meta_only:xcode_argsfiles.bzl", "get_meta_specific_xcode_arg_substitutions") +# @oss-disable[end= ]: load("@prelude//apple/meta_only:xcode_argsfiles.bzl", "get_meta_specific_xcode_arg_substitutions") def _get_meta_specific_xcode_arg_substitutions(): - # @oss-disable: return get_meta_specific_xcode_arg_substitutions() + # @oss-disable[end= ]: return get_meta_specific_xcode_arg_substitutions() return [] # @oss-enable XCODE_ARGSFILES_SUB_TARGET = "xcode-argsfiles" diff --git a/platforms/BUCK.v2 b/platforms/BUCK.v2 index 30302244b..388f02881 100644 --- a/platforms/BUCK.v2 +++ b/platforms/BUCK.v2 @@ -73,8 +73,7 @@ prelude.constraint_value( # execution configuration, but that's not implemented yet. export_file( name = "fat_platform_incompatible", - src = "BUCK.v2", # @oss-enable - # @oss-disable: src = "TARGETS.v2", + src = "BUCK.v2", target_compatible_with = select({ ":fat_platform_enabled": ["config//:none"], "DEFAULT": [], diff --git a/platforms/apple/base.bzl b/platforms/apple/base.bzl index 90a87848a..ab14aa297 100644 --- a/platforms/apple/base.bzl +++ b/platforms/apple/base.bzl @@ -23,12 +23,12 @@ load( # Debug constraints to add for build modes used by other rule platforms (ex: rust). _DEBUG_CONSTRAINTS = [ - # @oss-disable: "ovr_config//build_mode/constraints:debug", + # @oss-disable[end= ]: "ovr_config//build_mode/constraints:debug", ] # Release constraints to add for build modes used by other rule platforms (ex: rust). _RELEASE_CONSTRAINTS = [ - # @oss-disable: "ovr_config//build_mode/constraints:release", + # @oss-disable[end= ]: "ovr_config//build_mode/constraints:release", ] BUILD_MODE_TO_CONSTRAINTS_MAP = { diff --git a/platforms/apple/build_mode.bzl b/platforms/apple/build_mode.bzl index 720055502..091039554 100644 --- a/platforms/apple/build_mode.bzl +++ b/platforms/apple/build_mode.bzl @@ -5,33 +5,33 @@ # License, Version 2.0 found in the LICENSE-APACHE file in the root directory # of this source tree. -# @oss-disable: load("@prelude//platforms/apple/meta_only:build_mode.bzl", _APPLE_BUILD_MODES = "APPLE_BUILD_MODES", _BUILD_MODE = "BUILD_MODE", _get_build_mode = "get_build_mode", _get_build_mode_debug = "get_build_mode_debug", _get_build_mode_release = "get_build_mode_release") +# @oss-disable[end= ]: load("@prelude//platforms/apple/meta_only:build_mode.bzl", _APPLE_BUILD_MODES = "APPLE_BUILD_MODES", _BUILD_MODE = "BUILD_MODE", _get_build_mode = "get_build_mode", _get_build_mode_debug = "get_build_mode_debug", _get_build_mode_release = "get_build_mode_release") BUILD_MODE_DEBUG = "debug" # @oss-enable BUILD_MODE_PROFILE = "profile" # @oss-enable BUILD_MODE_RELEASE = "release" # @oss-enable APPLE_BUILD_MODES = [BUILD_MODE_DEBUG, BUILD_MODE_PROFILE, BUILD_MODE_RELEASE] # @oss-enable -# @oss-disable: APPLE_BUILD_MODES = _APPLE_BUILD_MODES +# @oss-disable[end= ]: APPLE_BUILD_MODES = _APPLE_BUILD_MODES BUILD_MODE = struct( # @oss-enable DEBUG = BUILD_MODE_DEBUG, # @oss-enable PROFILE = BUILD_MODE_PROFILE, # @oss-enable RELEASE = BUILD_MODE_RELEASE, # @oss-enable ) # @oss-enable -# @oss-disable: BUILD_MODE = _BUILD_MODE +# @oss-disable[end= ]: BUILD_MODE = _BUILD_MODE CONSTRAINT_PACKAGE = "prelude//platforms/apple/constraints" # @oss-enable -# @oss-disable: CONSTRAINT_PACKAGE = "ovr_config//build_mode/apple/constraints" +# @oss-disable[end= ]: CONSTRAINT_PACKAGE = "ovr_config//build_mode/apple/constraints" def get_build_mode(): return read_root_config("apple", "build_mode", BUILD_MODE_DEBUG) # @oss-enable - # @oss-disable: return _get_build_mode() + # @oss-disable[end= ]: return _get_build_mode() def get_build_mode_debug(): return BUILD_MODE.DEBUG # @oss-enable - # @oss-disable: return _get_build_mode_debug() + # @oss-disable[end= ]: return _get_build_mode_debug() def get_build_mode_release(): return BUILD_MODE.RELEASE # @oss-enable - # @oss-disable: return _get_build_mode_release() + # @oss-disable[end= ]: return _get_build_mode_release() diff --git a/platforms/apple/platforms_map.bzl b/platforms/apple/platforms_map.bzl index 9e15a662c..0103e3a23 100644 --- a/platforms/apple/platforms_map.bzl +++ b/platforms/apple/platforms_map.bzl @@ -5,10 +5,10 @@ # License, Version 2.0 found in the LICENSE-APACHE file in the root directory # of this source tree. -# @oss-disable: load("@prelude//platforms/apple/meta_only:platforms_map.bzl", _APPLE_PLATFORMS_MAP = "APPLE_PLATFORMS_MAP", _APPLE_SDK_DEFAULT_PLATFORM_MAP = "APPLE_SDK_DEFAULT_PLATFORM_MAP") +# @oss-disable[end= ]: load("@prelude//platforms/apple/meta_only:platforms_map.bzl", _APPLE_PLATFORMS_MAP = "APPLE_PLATFORMS_MAP", _APPLE_SDK_DEFAULT_PLATFORM_MAP = "APPLE_SDK_DEFAULT_PLATFORM_MAP") APPLE_PLATFORMS_MAP = {} # TODO: Define OSS platforms map # @oss-enable -# @oss-disable: APPLE_PLATFORMS_MAP = _APPLE_PLATFORMS_MAP +# @oss-disable[end= ]: APPLE_PLATFORMS_MAP = _APPLE_PLATFORMS_MAP APPLE_SDK_DEFAULT_PLATFORM_MAP = {} # @oss-enable -# @oss-disable: APPLE_SDK_DEFAULT_PLATFORM_MAP = _APPLE_SDK_DEFAULT_PLATFORM_MAP +# @oss-disable[end= ]: APPLE_SDK_DEFAULT_PLATFORM_MAP = _APPLE_SDK_DEFAULT_PLATFORM_MAP diff --git a/python/tools/make_par/BUCK b/python/tools/make_par/BUCK index 62d07e098..5dbca1a01 100644 --- a/python/tools/make_par/BUCK +++ b/python/tools/make_par/BUCK @@ -1,8 +1,3 @@ -# META INTERNAL NOTES: -# If this file is changed open source it will probably not import correctly, -# as it is the only `TARGETS` (not `TARGETS.v2`) in the prelude. -# Configuring the tools to do it right seemed more dangerous than just having a caveat on this one file. - load("@prelude//utils:source_listing.bzl", "source_listing") oncall("build_infra") diff --git a/rust/linkable_symbol.bzl b/rust/linkable_symbol.bzl index d1e295548..d37c196ac 100644 --- a/rust/linkable_symbol.bzl +++ b/rust/linkable_symbol.bzl @@ -50,7 +50,7 @@ applies to all of the following situations: load("@prelude//rust:link_info.bzl", "RustLinkInfo") # @oss-enable load("@prelude//prelude.bzl", prelude = "native") # @oss-enable -# @oss-disable: load("@fbcode//buck2/facebook:autodeps_hacks.bzl", "RustLinkInfo", "prelude") +# @oss-disable[end= ]: load("@fbcode//buck2/facebook:autodeps_hacks.bzl", "RustLinkInfo", "prelude") def _remove_rust_link_info_impl(ctx: AnalysisContext) -> list[Provider]: out = []