| commit c8fecc0002e6fc03419cf106a3c02294e4a67896 |
| Author: David Sanderson <32687193+dws@users.noreply.github.com> |
| Date: Wed Jun 11 15:28:14 2025 -0400 |
| |
| use DefaultInfo in apple_support |
| |
| We here address the following obstacles in apple_support to using |
| Bazel's --incompatible_disable_target_default_provider_fields flag: |
| |
| ERROR: /private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/apple_support+/crosstool/BUILD:25:20: in apple_genrule rule @@apple_support+//crosstool:exec_wrapped_clang_pp.target_config: |
| Traceback (most recent call last): |
| File "/private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/apple_support+/rules/private/apple_genrule.bzl", line 52, column 45, in _apple_genrule_impl |
| resolved_srcs = depset(transitive = [dep.files for dep in ctx.attr.srcs]) |
| Error: Accessing the default provider in this manner is deprecated and will be removed soon. It may be temporarily re-enabled by setting --incompatible_disable_target_default_provider_fields=false. See https://github.com/bazelbuild/bazel/issues/20183 for details. |
| ERROR: /private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/apple_support+/crosstool/BUILD:25:20: Analysis of target '@@apple_support+//crosstool:exec_wrapped_clang_pp.target_config' failed |
| ERROR: Analysis of target '//src:bazel' failed; build aborted: Analysis failed |
| |
| ERROR: /private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/apple_support++apple_cc_configure_extension+local_config_apple_cc/BUILD:78:24: in cc_toolchain_config rule @@apple_support++apple_cc_configure_extension+local_config_apple_cc//:darwin_x86_64: |
| Traceback (most recent call last): |
| File "/private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/apple_support++apple_cc_configure_extension+local_config_apple_cc/cc_toolchain_config.bzl", line 2506, column 37, in _impl |
| modulemaps = ctx.attr.module_map.files.to_list() |
| Error: Accessing the default provider in this manner is deprecated and will be removed soon. It may be temporarily re-enabled by setting --incompatible_disable_target_default_provider_fields=false. See https://github.com/bazelbuild/bazel/issues/20183 for details. |
| ERROR: /private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/apple_support++apple_cc_configure_extension+local_config_apple_cc/BUILD:78:24: Analysis of target '@@apple_support++apple_cc_configure_extension+local_config_apple_cc//:darwin_x86_64' failed |
| ERROR: Analysis of target '//src:bazel' failed; build aborted: Analysis failed |
| |
| diff --git a/crosstool/cc_toolchain_config.bzl b/crosstool/cc_toolchain_config.bzl |
| index 3bb7c26..1ae7198 100644 |
| --- a/crosstool/cc_toolchain_config.bzl |
| +++ b/crosstool/cc_toolchain_config.bzl |
| @@ -2503,7 +2503,7 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new |
| ], |
| ) |
| |
| - modulemaps = ctx.attr.module_map.files.to_list() |
| + modulemaps = ctx.attr.module_map[DefaultInfo].files.to_list() |
| if modulemaps: |
| if len(modulemaps) != 1: |
| fail("internal error: expected 1 modulemap got:", modulemaps) |
| diff --git a/rules/private/apple_genrule.bzl b/rules/private/apple_genrule.bzl |
| index b00395e..cdfd501 100644 |
| --- a/rules/private/apple_genrule.bzl |
| +++ b/rules/private/apple_genrule.bzl |
| @@ -49,8 +49,8 @@ def _apple_genrule_impl(ctx): |
| attr = "executable", |
| ) |
| |
| - resolved_srcs = depset(transitive = [dep.files for dep in ctx.attr.srcs]) |
| - label_dict = {dep.label: dep.files.to_list() for dep in ctx.attr.srcs} |
| + resolved_srcs = depset(transitive = [dep[DefaultInfo].files for dep in ctx.attr.srcs]) |
| + label_dict = {dep.label: dep[DefaultInfo].files.to_list() for dep in ctx.attr.srcs} |
| |
| xcode_config = ctx.attr._xcode_config[apple_common.XcodeVersionConfig] |
| |