Skip to content

allow Bazel to build with --incompatible_disable_target_default_provider_fields#26272

Closed
dws wants to merge 3 commits intobazelbuild:masterfrom
dws:DefaultInfo
Closed

allow Bazel to build with --incompatible_disable_target_default_provider_fields#26272
dws wants to merge 3 commits intobazelbuild:masterfrom
dws:DefaultInfo

Conversation

@dws
Copy link
Copy Markdown
Contributor

@dws dws commented Jun 11, 2025

We here address obstacles to building Bazel with --incompatible_disable_target_default_provider_fields enabled.

This includes patches representing

which should be removed once these PRs have been included in releases of their respective repos. All of these pull requests have been approved and merged into their respective repositories.

Once #26276 is cherry-picked into a Bazel 8 release, we should be able to update .bazelversion to that release, and in conjunction with the changes herein, we should be able to enable --incompatible_disable_target_default_provider_fields in .bazelrc in order to prevent regressions. Ideally, we could also flip the default value of this flag once #26297 also lands.
Note that #26293 is related, but not strictly needed for builds.

@dws dws force-pushed the DefaultInfo branch 8 times, most recently from bce2e30 to 6fb552b Compare June 13, 2025 19:08
dws added 3 commits June 13, 2025 15:15
    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 bazelbuild#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 bazelbuild#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
    ERROR: /private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/rules_java+/toolchains/BUILD:359:27: in java_toolchain rule @@rules_java+//toolchains:toolchain_jdk_21:
    Traceback (most recent call last):
            File "/private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/rules_java+/java/common/rules/java_toolchain.bzl", line 100, column 45, in _java_toolchain_impl
                    jacocorunner = ctx.attr.jacocorunner.files_to_run if ctx.attr.jacocorunner else None,
    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 bazelbuild#20183 for details.
    ERROR: /private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/rules_java+/toolchains/BUILD:359:27: Analysis of target '@@rules_java+//toolchains:toolchain_jdk_21' failed
    ERROR: Analysis of target '//src:bazel' failed; build aborted: Analysis failed

    ERROR: /Users/dws/src/bazel-dws/third_party/BUILD:578:20: in java_import rule //third_party:netty_tcnative_checked_in:
    Traceback (most recent call last):
            File "/private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/rules_java+/java/bazel/rules/bazel_java_import.bzl", line 25, column 34, in _proxy
                    return bazel_java_import_rule(
            File "/private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/rules_java+/java/common/rules/impl/bazel_java_import_impl.bzl", line 132, column 35, in bazel_java_import_rule
                    collected_jars = _collect_jars(ctx, jars)
            File "/private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/rules_java+/java/common/rules/impl/bazel_java_import_impl.bzl", line 38, column 24, in _collect_jars
                    for jar in info.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 bazelbuild#20183 for details.
    ERROR: /Users/dws/src/bazel-dws/third_party/BUILD:578:20: Analysis of target '//third_party:netty_tcnative_checked_in' failed
    ERROR: Analysis of target '//src:bazel' failed; build aborted: Analysis failed
    ERROR: /private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/googleapis+/google/devtools/build/v1/BUILD.bazel:81:18: in _java_grpc_library rule @@googleapis+//google/devtools/build/v1:build_java_grpc:
    Traceback (most recent call last):
            File "/private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/grpc-java+/java_grpc_library.bzl", line 94, column 30, in _java_rpc_library_impl
                    args.add(toolchain.plugin.files_to_run.executable, format = "--plugin=protoc-gen-rpc-plugin=%s")
    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 bazelbuild#20183 for details.
    ERROR: /private/var/tmp/_bazel_dws/7fd3cd5077fbf76d9e2ae421c39ef7ed/external/googleapis+/google/devtools/build/v1/BUILD.bazel:81:18: Analysis of target '@@googleapis+//google/devtools/build/v1:build_java_grpc' failed
    ERROR: Analysis of target '//src:bazel' failed; build aborted: Analysis failed
@dws dws marked this pull request as ready for review June 13, 2025 19:24
@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Jun 13, 2025
@dws
Copy link
Copy Markdown
Contributor Author

dws commented Jun 13, 2025

@meteorcloudy Perhaps you could select a reviewer for this?

Copy link
Copy Markdown
Member

@meteorcloudy meteorcloudy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@meteorcloudy meteorcloudy added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Jun 16, 2025
@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants