-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incompatible_no_rule_outputs_param: disable outputs param of rule function #7977
Comments
This constitutes an incompatible change guarded by flag --incompatible_no_rule_outputs_param. See #7977 for further details. Implementation for #7977. RELNOTES: The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See #7977 for more info. PiperOrigin-RevId: 244032985
I've spoken to authors of rules_apple (@thomasvl @allevato @sergiocampama) who have established some pains with respect to this change. These are issues we should work to resolve before proceeding with this migration.
my_rule_private.bzl:
my_rule.bzl:
Loading an additional bzl file has performance implications, and this pattern requires annoying separation between related bits of code. Possible workaround: One workaround would be if we allow rules to define their proper name to be different than their exported name.
This seems a high priority feature for Stardoc, and perhaps a blocker for this migration. For completeness, we also discussed a question I have been asked before regarding this migration: |
Aside: rules_apple/rules_swift can look into using output groups as well (which would avoid the need for a macro), but those output groups can't be referenced directly by other rules (i.e., there's no equivalent to |
That's correct -- the only way to make optional outputs specifiable by label is to use FWIW, the correct approach is to use both output groups and
and the latter allows building Foo.ipa by specifying:
(or similarly a dependency on |
*** Reason for rollback *** Breaks Bazel's target //scripts/packages/debian:bazel-debian.deb which is needed for bazel releases. *** Original change description *** Disable outputs param of rule function This constitutes an incompatible change guarded by flag --incompatible_no_rule_outputs_param. See #7977 for further details. Implementation for #7977. RELNOTES: The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See #7977 for more info. PiperOrigin-RevId: 246792521
Baseline: daa8ae5 Cherry picks: + 61c7ffa: Automated rollback of commit 87388e2. + 898d7b6: Add test for repository overrides, conflicting with managed directories being added when Bazel server is already started. + c2001a4: Automated rollback of commit bbe47a1. + e67c961: Fix a non-determinism in create_embedded_tools.py. + 81aefe7: Remove unsupported cpu attribute from cc_toolchains. + 597e289: remote: made CombinedCache a composition of Disk and Http Cache + 942f7cf: C++: Fixes bug in C++ API with external repo aspects + 85a5a2b: Configure @androidsdk//:emulator_x86 and :emulator_arm to point to the unified emulator binary + 9835cb4: Automated rollback of commit 844e4e2. + c963ba2: Windows, Python: fix arg. esc. also in host config + a1ea487: Do not pre-cache changed files under managed directories + 7dc78cd: Add explicit execution and target constraints for autodiscovered cc t? + dd9ac13: Fix a bug when a relative path is used for the execution log + 0ff19c6: Fix StandaloneTestStrategy.appendStderr + 7f49531: Fix the autodetecting Python toolchain on Mac + ddce723: Avoid exporting PATH unnecessarily + 35dd05a: Allow Starlark rules to be able to use the `exec_compatible_with` Incompatible changes: - Flip --incompatible_windows_escape_jvm_flags to true. See bazelbuild#7486 - Flip --incompatible_windows_style_arg_escaping to true. See bazelbuild#7454 - --incompatible_windows_escape_jvm_flags is enabled by default, and the flag no longer exists - `--incompatible_no_output_attr_default` is enabled by default. - --incompatible_depset_union is enabled by default. - Python rules now determine the Python runtime using toolchains rather than `--python_top` and `--python_path`, which are deprecated. See [bazelbuild#7899](bazelbuild#7899) for information on declaring Python toolchains and migrating your code. As a side-benefit, this addresses bazelbuild#4815 (incorrect interpreter version used) on non-Windows platforms. You can temporarily opt out of this change with `--incompatible_use_python_toolchains=false`. - Python rules now determine the Python runtime using toolchains rather than `--python_top` and `--python_path`, which are deprecated. See bazelbuild#7899 for information on declaring Python toolchains and migrating your code. As a side-benefit, this addresses bazelbuild#4815 (incorrect interpreter version used) on non-Windows platforms. You can temporarily opt out of this change with `--incompatible_use_python_toolchains=false`. New features: - Windows, Python: the --incompatible_windows_escape_python_args flag (false by default) builds py_binary and py_test targets with correct command line argument escaping. - cquery supports --output=build Important changes: - Allow debugging C++ features logic. - The --ios_multi_cpus, --watchos_cpus, --macos_cpus and tvos_cpus are now additive. This means that you can now split the --ios_multi_cpus=arm64,armv7 into --ios_multi_cpus=arm64 and --ios_multi_cpus=armv7. - Generated Go protobufs now depend on //net/proto2/go:proto_gendeps instead of //net/proto2/go:proto - Add new options --cs_fdo_instrument and --cs_profile to support LLVM's context-sensitive FDO (CSFDO). - Bazel C++ compile/link Starlark API. Can be used with experimental flag --experimental_cc_skylark_api_enabled_packages=<package_path>,<pac kage_path2>. - `cc_toolchain.static_runtime_lib` and `cc_toolchain.dynamic_runtime_lib` are now exposed to Starlark. - New flag `--incompatible_no_kwargs_in_build_files`. See bazelbuild#8021 - struct.to_proto() converts dict into proto3 text message (map<,>). - Android resource conflicts will no longer be reported between a strong attr resource and a weak attr resource, if the weak attr does not have format specified. - Flag `--incompatible_static_name_resolution_in_build_files` is added. See bazelbuild#8022 - Add --incompatible_objc_framework_cleanup to control whether to enable some objc framework cleanup that changes the API. Specifically, the cleanup changes the objc provider API pertaining to frameworks. This change is expected to be transparent to most users unless they write their own Starlark rules to handle frameworks. See bazelbuild#7594 for details. - Added --incompatible_remove_binary_profile to disable the old binary profiles. Instead use the JSON profile format: https://docs.bazel.build/versions/master/skylark/performance.html# json-profile - Introducing --execution_log_binary_file and --execution_log_json_file that output a stable sorted execution log. They will offer a stable replacement to --experimental_execution_log_file. - Flag `--incompatible_disallow_old_octal_notation` is added. See //github.com/bazelbuild/issues/8059 - Removes the --incompatible_disable_genrule_cc_toolchain_dependency flag. - Android resource conflicts will no longer be reported between a strong attr resource and a weak attr resource, if the weak attr does not have format specified. - Incompatible flag `--incompatible_make_thinlto_command_lines_standalone` has been added. See bazelbuild#6791 for details. - objc_library does not support resource attributes any more. Please read bazelbuild#7594 for more info. - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See bazelbuild#7977 for more info. - New platform_mappings ability to allow gradual flag to platforms/toolchains migration. See also bazelbuild#6426 - Added support for compiling against fully qualified R classes from aar_import dependencies. - --tls_enabled flag is deprecated. Please provide 'grpcs' as a scheme in the URLs if TLS should be used for a remote connection. - Adds incompatible_disallow_rule_execution_platform_constraints_allowed, which disallows the use of the "execution_platform_constraints_allowed" attribute when defining new rules. - Flag `--incompatible_restrict_named_params` is added. See bazelbuild#8147 for details. - The glob function has a new argument `allow_empty`. When set to False, the glob fails when it doesn't match anything. - Adds the "disable_whole_archive_for_static_lib" feature to allow turning off legacy_whole_archive for individual targets. - C++ Starlark API for compilation and linking is no longer whitelisted - Update visibility advice in build-style - --incompatible_disable_objc_provider_resources is now enabled by default. - Fixed an issue where some `py_runtime`s were incompatible with using `--build_python_zip` (bazelbuild#5104). - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See bazelbuild#7977 for more info. This release contains contributions from many people at Google, as well as Benjamin Peterson, Brian Topping, clyang82, Dave Lee, George Gensure, Greg Estren, Greg, Guro Bokum, Keith Smiley, Max Vorobev, Michael Hackner, Robert Brown, Robert Sayre, Ryan Beasley, Yannic.
Baseline: daa8ae5 Cherry picks: + 61c7ffa: Automated rollback of commit 87388e2. + 898d7b6: Add test for repository overrides, conflicting with managed directories being added when Bazel server is already started. + c2001a4: Automated rollback of commit bbe47a1. + e67c961: Fix a non-determinism in create_embedded_tools.py. + 81aefe7: Remove unsupported cpu attribute from cc_toolchains. + 597e289: remote: made CombinedCache a composition of Disk and Http Cache + 942f7cf: C++: Fixes bug in C++ API with external repo aspects + 85a5a2b: Configure @androidsdk//:emulator_x86 and :emulator_arm to point to the unified emulator binary + 9835cb4: Automated rollback of commit 844e4e2. + c963ba2: Windows, Python: fix arg. esc. also in host config + a1ea487: Do not pre-cache changed files under managed directories + 7dc78cd: Add explicit execution and target constraints for autodiscovered cc t? + dd9ac13: Fix a bug when a relative path is used for the execution log + 0ff19c6: Fix StandaloneTestStrategy.appendStderr + 7f49531: Fix the autodetecting Python toolchain on Mac + ddce723: Avoid exporting PATH unnecessarily + 35dd05a: Allow Starlark rules to be able to use the `exec_compatible_with` Incompatible changes: - Flip --incompatible_windows_escape_jvm_flags to true. See #7486 - Flip --incompatible_windows_style_arg_escaping to true. See #7454 - --incompatible_windows_escape_jvm_flags is enabled by default, and the flag no longer exists - `--incompatible_no_output_attr_default` is enabled by default. - --incompatible_depset_union is enabled by default. - Python rules now determine the Python runtime using toolchains rather than `--python_top` and `--python_path`, which are deprecated. See [#7899](#7899) for information on declaring Python toolchains and migrating your code. As a side-benefit, this addresses #4815 (incorrect interpreter version used) on non-Windows platforms. You can temporarily opt out of this change with `--incompatible_use_python_toolchains=false`. - Python rules now determine the Python runtime using toolchains rather than `--python_top` and `--python_path`, which are deprecated. See #7899 for information on declaring Python toolchains and migrating your code. As a side-benefit, this addresses #4815 (incorrect interpreter version used) on non-Windows platforms. You can temporarily opt out of this change with `--incompatible_use_python_toolchains=false`. New features: - Windows, Python: the --incompatible_windows_escape_python_args flag (false by default) builds py_binary and py_test targets with correct command line argument escaping. - cquery supports --output=build Important changes: - Allow debugging C++ features logic. - The --ios_multi_cpus, --watchos_cpus, --macos_cpus and tvos_cpus are now additive. This means that you can now split the --ios_multi_cpus=arm64,armv7 into --ios_multi_cpus=arm64 and --ios_multi_cpus=armv7. - Generated Go protobufs now depend on //net/proto2/go:proto_gendeps instead of //net/proto2/go:proto - Add new options --cs_fdo_instrument and --cs_profile to support LLVM's context-sensitive FDO (CSFDO). - Bazel C++ compile/link Starlark API. Can be used with experimental flag --experimental_cc_skylark_api_enabled_packages=<package_path>,<pac kage_path2>. - `cc_toolchain.static_runtime_lib` and `cc_toolchain.dynamic_runtime_lib` are now exposed to Starlark. - New flag `--incompatible_no_kwargs_in_build_files`. See #8021 - struct.to_proto() converts dict into proto3 text message (map<,>). - Android resource conflicts will no longer be reported between a strong attr resource and a weak attr resource, if the weak attr does not have format specified. - Flag `--incompatible_static_name_resolution_in_build_files` is added. See #8022 - Add --incompatible_objc_framework_cleanup to control whether to enable some objc framework cleanup that changes the API. Specifically, the cleanup changes the objc provider API pertaining to frameworks. This change is expected to be transparent to most users unless they write their own Starlark rules to handle frameworks. See #7594 for details. - Added --incompatible_remove_binary_profile to disable the old binary profiles. Instead use the JSON profile format: https://docs.bazel.build/versions/master/skylark/performance.html# json-profile - Introducing --execution_log_binary_file and --execution_log_json_file that output a stable sorted execution log. They will offer a stable replacement to --experimental_execution_log_file. - Flag `--incompatible_disallow_old_octal_notation` is added. See //github.com//issues/8059 - Removes the --incompatible_disable_genrule_cc_toolchain_dependency flag. - Android resource conflicts will no longer be reported between a strong attr resource and a weak attr resource, if the weak attr does not have format specified. - Incompatible flag `--incompatible_make_thinlto_command_lines_standalone` has been added. See #6791 for details. - objc_library does not support resource attributes any more. Please read #7594 for more info. - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See #7977 for more info. - New platform_mappings ability to allow gradual flag to platforms/toolchains migration. See also #6426 - Added support for compiling against fully qualified R classes from aar_import dependencies. - --tls_enabled flag is deprecated. Please provide 'grpcs' as a scheme in the URLs if TLS should be used for a remote connection. - Adds incompatible_disallow_rule_execution_platform_constraints_allowed, which disallows the use of the "execution_platform_constraints_allowed" attribute when defining new rules. - Flag `--incompatible_restrict_named_params` is added. See #8147 for details. - The glob function has a new argument `allow_empty`. When set to False, the glob fails when it doesn't match anything. - Adds the "disable_whole_archive_for_static_lib" feature to allow turning off legacy_whole_archive for individual targets. - C++ Starlark API for compilation and linking is no longer whitelisted - Update visibility advice in build-style - --incompatible_disable_objc_provider_resources is now enabled by default. - Fixed an issue where some `py_runtime`s were incompatible with using `--build_python_zip` (#5104). - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See #7977 for more info. This release contains contributions from many people at Google, as well as Benjamin Peterson, Brian Topping, clyang82, Dave Lee, George Gensure, Greg Estren, Greg, Guro Bokum, Keith Smiley, Max Vorobev, Michael Hackner, Robert Brown, Robert Sayre, Ryan Beasley, Yannic.
Original change broke //scripts/packages/debian:bazel-debian.deb This rollforward manually tested to not break that target. *** Original change description *** Disable outputs param of rule function This constitutes an incompatible change guarded by flag --incompatible_no_rule_outputs_param. See #7977 for further details. Implementation for #7977. RELNOTES: The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See #7977 for more info. PiperOrigin-RevId: 252063297
Baseline: 5935259 Cherry picks: + fe81b49: Support of using the absolute path profile for LLVM's Context Sensitive FDO + ce5e718: Demote OptionProcessor from globals + 3ed9d36: Properly wire up BES half-close. The lack thereof was a simple oversight. + 4ca768e: standardize graph output indentation with 2 spaces + aff189a: Make sure default Linux artifacts have an associated action, even when artifact names are altered. + 8c3b3fb: Failures early in package loading will now fail all --keep_going builds. + 123c68d: Warn in more cases of possible Python version mismatch in host config + 052167e: Add a non-strict autodetecting Python toolchain + 6ef6d87: Default java toolchain target + 50fa3ec: Fix problems with the non-strict Python toolchain + e2a626c: Automated rollback of commit bc6f7cb. + 6efc5b7: Treat existence of managed directories as a part of repository dirtiness. + 3a4be3c: Add /usr/local/bin to default PATH under strict action env + 5c1005c: Automated rollback of commit 536a166. Incompatible changes: - --incompatible_disable_objc_provider_resources no longer has effect. Use of deprecated resource fields on the Objc provider is now disallowed regardless of this flag. - deleted deprecated --experimental-remote-retry* flags, please use --remote_retries instead - flipped --incompatible_list_based_execution_strategy_selection flag to be true by default. See #7480 for details. - Octal integer literals in Starlark are required to start with "Oo". - The "native" module is no longer available in BUILD files, all its members can be accessed directly as global symbols. This can be temporarily reverted by providing --incompatible_disallow_native_in_build_file=false as a flag to Blaze. - The "native" module is no longer available in BUILD files, all its members can be accessed directly as global symbols. This can be temporarily reverted by providing --incompatible_disallow_native_in_build_file=false as a flag to Blaze. - Turn off binary style profile format. - The "native" module is no longer available in BUILD files, all its members can be accessed directly as global symbols. This can be temporarily reverted by providing --incompatible_disallow_native_in_build_f... - cleanup that affects user provided apple frameworks is now enabled by default. See #7944 for more info. - Python rules now determine the Python runtime using toolchains rather than `--python_top` and `--python_path`, which are deprecated. See [#7899](#7899) for information on declaring Python toolchains and migrating your code. As a side-benefit, this addresses [#4815](#4815) (incorrect interpreter version used) on non-Windows platforms. Note however that some builds break due to getting the version they asked for -- consider setting `python_version = "PY2"` on Python 2 targets and `--host_force_python=PY2` if any Python 2 targets are used in the host configuration. You can temporarily opt out of this change with `--incompatible_use_python_toolchains=false`. - Depsets can't be iterated over unless they're converted to lists using the .to_list() method. Use --incompatible_depset_is_not_iterable=false to temporarily restore the previous behaviour. New features: - Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. The rlocation() implementation is the same. - Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. The rlocation() implementation is the same. - Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. To use the new init code, you need Bazel 0.27 or newer. The old (longer) init code still works. Important changes: - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See #7977 for more info. - The --incompatible_disable_objc_library_resources flag is being removed. Please remove it from your configs as it otherwise will fail the build. - Add a generic additional_linker_inputs attribute on cc_binary rules. - Windows, C++ autoconfigure: BAZEL_VC and BAZEL_VS may now have quotes, so if you set these envvars' values in cmd.exe via TAB-completion then you no longer need to remove the surrounding quotes. - pkg_deb has new attributes: `config` and `templates` that can be used for integration with debconf - Allow cc_import() of a DLL with no interface library on Windows, used to document runtime dependencies. - All host-configured Python tools that are built for the wrong Python version will now emit a warning message when they exit with non-zero status. See #7899. - deprecated --remote_local_fallback_strategy. Use `--strategy=remote,local` instead. See #7480. - Introduce --incompatible_disable_native_android_rules flag - The Android desugaring actions now support a persistent worker mode for faster local build performance. Enable it with `--strategy=Desugar=worker`. - --incompatible_static_name_resolution_in_build_files is now enabled by default - --incompatible_disable_deprecated_attr_params is now enabled by default (#5818) - Repository containing autoconfigured C++ toolchain `@local_config_cc` has been split in 2 - see `local_config_cc_toolchains`. - --incompatible_string_join_requires_strings is now enabled by default - Flag --incompatible_new_actions_api is enabled by dewfault (#5825) - New flag `--incompatible_disallow_empty_glob`. See #8195 - --incompatible_no_kwargs_in_build_files is enabled by default - Incompatible flag `--incompatible_require_ctx_in_configure_features` has been flipped. See #7793 for more information. - `BAZEL_USE_XCODE_TOOLCHAIN=1` tells Bazel not to look for Xcode to decide whether to enable toolchains for Apple rules, but to assume Xcode is available. Can be also used when building on Darwin and no C++ or ObjC is being built, so there is no need to detect Xcode. - Android desugaring actions now use persistent workers by default. This has been measured to provide up to 20% reduction in build times. To disable it, use the `--strategy=Desugar=sandboxed` flag. See #8342 and #8427 for more details on local build speed optimization for Android apps. - Fixed an issue with Android builds where `--fat_apk_cpu` doesn't pack all selected shared libraries from `aar_import` targets into the APK. See [#8283](#8283). - Turn on --experimental_starlark_config_transitions by default for starlark transitions (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-transitions for more info) - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) - Incompatible flag `--incompatible_dont_enable_host_nonhost_crosstool_features` has been flipped. See #7407 for more information. - Added support for Android NDK 19 and 20. - Flip --incompatible_no_support_tools_in_action_inputs - --remote_executor, --remote_cache or --bes_backend=someurl.com would be treated as grpcs://someurl.com, if the --incompatible_tls_enabled_removed flag enabled. See #8061 for details. - Add new options --cs_fdo_absolute_path= to support the absolute path profile for LLVM's context-sensitive FDO. - When `--incompatible_strict_action_env` is enabled, the default `PATH` now includes `/usr/local/bin`. - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) This release contains contributions from many people at Google, as well as Alex Thompson, Andy Scott, Benjamin Peterson, David McNett, Drew Gassaway, Ira Shikhman, James deBoer, Jay Vercellone, Jingwen Chen, Josh Rosen, Keith Smiley, Laurent Le Brun, Lee Mracek, Marwan Tammam, Matt Passell, Michael Hackner, Michal Majcherski, Patrick Niklaus, Peter Mounce, Ricky Pai, Steeve Morin, szakmary, Takuto Ikuta, Vladimir Chebotarev, Yen-Chi Chen.
Baseline: daa8ae5 Cherry picks: + 61c7ffa: Automated rollback of commit 87388e2. + 898d7b6: Add test for repository overrides, conflicting with managed directories being added when Bazel server is already started. + c2001a4: Automated rollback of commit bbe47a1. + e67c961: Fix a non-determinism in create_embedded_tools.py. + 81aefe7: Remove unsupported cpu attribute from cc_toolchains. + 597e289: remote: made CombinedCache a composition of Disk and Http Cache + 942f7cf: C++: Fixes bug in C++ API with external repo aspects + 85a5a2b: Configure @androidsdk//:emulator_x86 and :emulator_arm to point to the unified emulator binary + 9835cb4: Automated rollback of commit 844e4e2. + c963ba2: Windows, Python: fix arg. esc. also in host config + a1ea487: Do not pre-cache changed files under managed directories + 7dc78cd: Add explicit execution and target constraints for autodiscovered cc t? + dd9ac13: Fix a bug when a relative path is used for the execution log + 0ff19c6: Fix StandaloneTestStrategy.appendStderr + 7f49531: Fix the autodetecting Python toolchain on Mac + ddce723: Avoid exporting PATH unnecessarily + 35dd05a: Allow Starlark rules to be able to use the `exec_compatible_with` Incompatible changes: - Flip --incompatible_windows_escape_jvm_flags to true. See bazelbuild#7486 - Flip --incompatible_windows_style_arg_escaping to true. See bazelbuild#7454 - --incompatible_windows_escape_jvm_flags is enabled by default, and the flag no longer exists - `--incompatible_no_output_attr_default` is enabled by default. - --incompatible_depset_union is enabled by default. - Python rules now determine the Python runtime using toolchains rather than `--python_top` and `--python_path`, which are deprecated. See [bazelbuild#7899](bazelbuild#7899) for information on declaring Python toolchains and migrating your code. As a side-benefit, this addresses bazelbuild#4815 (incorrect interpreter version used) on non-Windows platforms. You can temporarily opt out of this change with `--incompatible_use_python_toolchains=false`. - Python rules now determine the Python runtime using toolchains rather than `--python_top` and `--python_path`, which are deprecated. See bazelbuild#7899 for information on declaring Python toolchains and migrating your code. As a side-benefit, this addresses bazelbuild#4815 (incorrect interpreter version used) on non-Windows platforms. You can temporarily opt out of this change with `--incompatible_use_python_toolchains=false`. New features: - Windows, Python: the --incompatible_windows_escape_python_args flag (false by default) builds py_binary and py_test targets with correct command line argument escaping. - cquery supports --output=build Important changes: - Allow debugging C++ features logic. - The --ios_multi_cpus, --watchos_cpus, --macos_cpus and tvos_cpus are now additive. This means that you can now split the --ios_multi_cpus=arm64,armv7 into --ios_multi_cpus=arm64 and --ios_multi_cpus=armv7. - Generated Go protobufs now depend on //net/proto2/go:proto_gendeps instead of //net/proto2/go:proto - Add new options --cs_fdo_instrument and --cs_profile to support LLVM's context-sensitive FDO (CSFDO). - Bazel C++ compile/link Starlark API. Can be used with experimental flag --experimental_cc_skylark_api_enabled_packages=<package_path>,<pac kage_path2>. - `cc_toolchain.static_runtime_lib` and `cc_toolchain.dynamic_runtime_lib` are now exposed to Starlark. - New flag `--incompatible_no_kwargs_in_build_files`. See bazelbuild#8021 - struct.to_proto() converts dict into proto3 text message (map<,>). - Android resource conflicts will no longer be reported between a strong attr resource and a weak attr resource, if the weak attr does not have format specified. - Flag `--incompatible_static_name_resolution_in_build_files` is added. See bazelbuild#8022 - Add --incompatible_objc_framework_cleanup to control whether to enable some objc framework cleanup that changes the API. Specifically, the cleanup changes the objc provider API pertaining to frameworks. This change is expected to be transparent to most users unless they write their own Starlark rules to handle frameworks. See bazelbuild#7594 for details. - Added --incompatible_remove_binary_profile to disable the old binary profiles. Instead use the JSON profile format: https://docs.bazel.build/versions/master/skylark/performance.html# json-profile - Introducing --execution_log_binary_file and --execution_log_json_file that output a stable sorted execution log. They will offer a stable replacement to --experimental_execution_log_file. - Flag `--incompatible_disallow_old_octal_notation` is added. See //github.com/bazelbuild/issues/8059 - Removes the --incompatible_disable_genrule_cc_toolchain_dependency flag. - Android resource conflicts will no longer be reported between a strong attr resource and a weak attr resource, if the weak attr does not have format specified. - Incompatible flag `--incompatible_make_thinlto_command_lines_standalone` has been added. See bazelbuild#6791 for details. - objc_library does not support resource attributes any more. Please read bazelbuild#7594 for more info. - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See bazelbuild#7977 for more info. - New platform_mappings ability to allow gradual flag to platforms/toolchains migration. See also bazelbuild#6426 - Added support for compiling against fully qualified R classes from aar_import dependencies. - --tls_enabled flag is deprecated. Please provide 'grpcs' as a scheme in the URLs if TLS should be used for a remote connection. - Adds incompatible_disallow_rule_execution_platform_constraints_allowed, which disallows the use of the "execution_platform_constraints_allowed" attribute when defining new rules. - Flag `--incompatible_restrict_named_params` is added. See bazelbuild#8147 for details. - The glob function has a new argument `allow_empty`. When set to False, the glob fails when it doesn't match anything. - Adds the "disable_whole_archive_for_static_lib" feature to allow turning off legacy_whole_archive for individual targets. - C++ Starlark API for compilation and linking is no longer whitelisted - Update visibility advice in build-style - --incompatible_disable_objc_provider_resources is now enabled by default. - Fixed an issue where some `py_runtime`s were incompatible with using `--build_python_zip` (bazelbuild#5104). - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See bazelbuild#7977 for more info. This release contains contributions from many people at Google, as well as Benjamin Peterson, Brian Topping, clyang82, Dave Lee, George Gensure, Greg Estren, Greg, Guro Bokum, Keith Smiley, Max Vorobev, Michael Hackner, Robert Brown, Robert Sayre, Ryan Beasley, Yannic.
Original change broke //scripts/packages/debian:bazel-debian.deb This rollforward manually tested to not break that target. *** Original change description *** Disable outputs param of rule function This constitutes an incompatible change guarded by flag --incompatible_no_rule_outputs_param. See bazelbuild#7977 for further details. Implementation for bazelbuild#7977. RELNOTES: The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See bazelbuild#7977 for more info. PiperOrigin-RevId: 252063297
Baseline: 5935259 Cherry picks: + fe81b49: Support of using the absolute path profile for LLVM's Context Sensitive FDO + ce5e718: Demote OptionProcessor from globals + 3ed9d36: Properly wire up BES half-close. The lack thereof was a simple oversight. + 4ca768e: standardize graph output indentation with 2 spaces + aff189a: Make sure default Linux artifacts have an associated action, even when artifact names are altered. + 8c3b3fb: Failures early in package loading will now fail all --keep_going builds. + 123c68d: Warn in more cases of possible Python version mismatch in host config + 052167e: Add a non-strict autodetecting Python toolchain + 6ef6d87: Default java toolchain target + 50fa3ec: Fix problems with the non-strict Python toolchain + e2a626c: Automated rollback of commit bc6f7cb. + 6efc5b7: Treat existence of managed directories as a part of repository dirtiness. + 3a4be3c: Add /usr/local/bin to default PATH under strict action env + 5c1005c: Automated rollback of commit 536a166. Incompatible changes: - --incompatible_disable_objc_provider_resources no longer has effect. Use of deprecated resource fields on the Objc provider is now disallowed regardless of this flag. - deleted deprecated --experimental-remote-retry* flags, please use --remote_retries instead - flipped --incompatible_list_based_execution_strategy_selection flag to be true by default. See bazelbuild#7480 for details. - Octal integer literals in Starlark are required to start with "Oo". - The "native" module is no longer available in BUILD files, all its members can be accessed directly as global symbols. This can be temporarily reverted by providing --incompatible_disallow_native_in_build_file=false as a flag to Blaze. - The "native" module is no longer available in BUILD files, all its members can be accessed directly as global symbols. This can be temporarily reverted by providing --incompatible_disallow_native_in_build_file=false as a flag to Blaze. - Turn off binary style profile format. - The "native" module is no longer available in BUILD files, all its members can be accessed directly as global symbols. This can be temporarily reverted by providing --incompatible_disallow_native_in_build_f... - cleanup that affects user provided apple frameworks is now enabled by default. See bazelbuild#7944 for more info. - Python rules now determine the Python runtime using toolchains rather than `--python_top` and `--python_path`, which are deprecated. See [bazelbuild#7899](bazelbuild#7899) for information on declaring Python toolchains and migrating your code. As a side-benefit, this addresses [bazelbuild#4815](bazelbuild#4815) (incorrect interpreter version used) on non-Windows platforms. Note however that some builds break due to getting the version they asked for -- consider setting `python_version = "PY2"` on Python 2 targets and `--host_force_python=PY2` if any Python 2 targets are used in the host configuration. You can temporarily opt out of this change with `--incompatible_use_python_toolchains=false`. - Depsets can't be iterated over unless they're converted to lists using the .to_list() method. Use --incompatible_depset_is_not_iterable=false to temporarily restore the previous behaviour. New features: - Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. The rlocation() implementation is the same. - Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. The rlocation() implementation is the same. - Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. To use the new init code, you need Bazel 0.27 or newer. The old (longer) init code still works. Important changes: - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See bazelbuild#7977 for more info. - The --incompatible_disable_objc_library_resources flag is being removed. Please remove it from your configs as it otherwise will fail the build. - Add a generic additional_linker_inputs attribute on cc_binary rules. - Windows, C++ autoconfigure: BAZEL_VC and BAZEL_VS may now have quotes, so if you set these envvars' values in cmd.exe via TAB-completion then you no longer need to remove the surrounding quotes. - pkg_deb has new attributes: `config` and `templates` that can be used for integration with debconf - Allow cc_import() of a DLL with no interface library on Windows, used to document runtime dependencies. - All host-configured Python tools that are built for the wrong Python version will now emit a warning message when they exit with non-zero status. See bazelbuild#7899. - deprecated --remote_local_fallback_strategy. Use `--strategy=remote,local` instead. See bazelbuild#7480. - Introduce --incompatible_disable_native_android_rules flag - The Android desugaring actions now support a persistent worker mode for faster local build performance. Enable it with `--strategy=Desugar=worker`. - --incompatible_static_name_resolution_in_build_files is now enabled by default - --incompatible_disable_deprecated_attr_params is now enabled by default (bazelbuild#5818) - Repository containing autoconfigured C++ toolchain `@local_config_cc` has been split in 2 - see `local_config_cc_toolchains`. - --incompatible_string_join_requires_strings is now enabled by default - Flag --incompatible_new_actions_api is enabled by dewfault (bazelbuild#5825) - New flag `--incompatible_disallow_empty_glob`. See bazelbuild#8195 - --incompatible_no_kwargs_in_build_files is enabled by default - Incompatible flag `--incompatible_require_ctx_in_configure_features` has been flipped. See bazelbuild#7793 for more information. - `BAZEL_USE_XCODE_TOOLCHAIN=1` tells Bazel not to look for Xcode to decide whether to enable toolchains for Apple rules, but to assume Xcode is available. Can be also used when building on Darwin and no C++ or ObjC is being built, so there is no need to detect Xcode. - Android desugaring actions now use persistent workers by default. This has been measured to provide up to 20% reduction in build times. To disable it, use the `--strategy=Desugar=sandboxed` flag. See bazelbuild#8342 and bazelbuild#8427 for more details on local build speed optimization for Android apps. - Fixed an issue with Android builds where `--fat_apk_cpu` doesn't pack all selected shared libraries from `aar_import` targets into the APK. See [bazelbuild#8283](bazelbuild#8283). - Turn on --experimental_starlark_config_transitions by default for starlark transitions (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-transitions for more info) - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) - Incompatible flag `--incompatible_dont_enable_host_nonhost_crosstool_features` has been flipped. See bazelbuild#7407 for more information. - Added support for Android NDK 19 and 20. - Flip --incompatible_no_support_tools_in_action_inputs - --remote_executor, --remote_cache or --bes_backend=someurl.com would be treated as grpcs://someurl.com, if the --incompatible_tls_enabled_removed flag enabled. See bazelbuild#8061 for details. - Add new options --cs_fdo_absolute_path= to support the absolute path profile for LLVM's context-sensitive FDO. - When `--incompatible_strict_action_env` is enabled, the default `PATH` now includes `/usr/local/bin`. - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) This release contains contributions from many people at Google, as well as Alex Thompson, Andy Scott, Benjamin Peterson, David McNett, Drew Gassaway, Ira Shikhman, James deBoer, Jay Vercellone, Jingwen Chen, Josh Rosen, Keith Smiley, Laurent Le Brun, Lee Mracek, Marwan Tammam, Matt Passell, Michael Hackner, Michal Majcherski, Patrick Niklaus, Peter Mounce, Ricky Pai, Steeve Morin, szakmary, Takuto Ikuta, Vladimir Chebotarev, Yen-Chi Chen.
Looks like this is incompatible with rule transitions, I get the following error:
Granted, this is also an issue with implicit outputs, just wanted to bring this into attention in case the solution is different. |
Baseline: 5935259 Cherry picks: + fe81b49: Support of using the absolute path profile for LLVM's Context Sensitive FDO + ce5e718: Demote OptionProcessor from globals + 3ed9d36: Properly wire up BES half-close. The lack thereof was a simple oversight. + 4ca768e: standardize graph output indentation with 2 spaces + aff189a: Make sure default Linux artifacts have an associated action, even when artifact names are altered. + 8c3b3fb: Failures early in package loading will now fail all --keep_going builds. + 123c68d: Warn in more cases of possible Python version mismatch in host config + 052167e: Add a non-strict autodetecting Python toolchain + 6ef6d87: Default java toolchain target + 50fa3ec: Fix problems with the non-strict Python toolchain + e2a626c: Automated rollback of commit bc6f7cb. + 6efc5b7: Treat existence of managed directories as a part of repository dirtiness. + 3a4be3c: Add /usr/local/bin to default PATH under strict action env + 5c1005c: Automated rollback of commit 536a166. Incompatible changes: - --incompatible_disable_objc_provider_resources no longer has effect. Use of deprecated resource fields on the Objc provider is now disallowed regardless of this flag. - deleted deprecated --experimental-remote-retry* flags, please use --remote_retries instead - flipped --incompatible_list_based_execution_strategy_selection flag to be true by default. See bazelbuild#7480 for details. - Octal integer literals in Starlark are required to start with "Oo". - The "native" module is no longer available in BUILD files, all its members can be accessed directly as global symbols. This can be temporarily reverted by providing --incompatible_disallow_native_in_build_file=false as a flag to Blaze. - The "native" module is no longer available in BUILD files, all its members can be accessed directly as global symbols. This can be temporarily reverted by providing --incompatible_disallow_native_in_build_file=false as a flag to Blaze. - Turn off binary style profile format. - The "native" module is no longer available in BUILD files, all its members can be accessed directly as global symbols. This can be temporarily reverted by providing --incompatible_disallow_native_in_build_f... - cleanup that affects user provided apple frameworks is now enabled by default. See bazelbuild#7944 for more info. - Python rules now determine the Python runtime using toolchains rather than `--python_top` and `--python_path`, which are deprecated. See [bazelbuild#7899](bazelbuild#7899) for information on declaring Python toolchains and migrating your code. As a side-benefit, this addresses [bazelbuild#4815](bazelbuild#4815) (incorrect interpreter version used) on non-Windows platforms. Note however that some builds break due to getting the version they asked for -- consider setting `python_version = "PY2"` on Python 2 targets and `--host_force_python=PY2` if any Python 2 targets are used in the host configuration. You can temporarily opt out of this change with `--incompatible_use_python_toolchains=false`. - Depsets can't be iterated over unless they're converted to lists using the .to_list() method. Use --incompatible_depset_is_not_iterable=false to temporarily restore the previous behaviour. New features: - Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. The rlocation() implementation is the same. - Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. The rlocation() implementation is the same. - Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. To use the new init code, you need Bazel 0.27 or newer. The old (longer) init code still works. Important changes: - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See bazelbuild#7977 for more info. - The --incompatible_disable_objc_library_resources flag is being removed. Please remove it from your configs as it otherwise will fail the build. - Add a generic additional_linker_inputs attribute on cc_binary rules. - Windows, C++ autoconfigure: BAZEL_VC and BAZEL_VS may now have quotes, so if you set these envvars' values in cmd.exe via TAB-completion then you no longer need to remove the surrounding quotes. - pkg_deb has new attributes: `config` and `templates` that can be used for integration with debconf - Allow cc_import() of a DLL with no interface library on Windows, used to document runtime dependencies. - All host-configured Python tools that are built for the wrong Python version will now emit a warning message when they exit with non-zero status. See bazelbuild#7899. - deprecated --remote_local_fallback_strategy. Use `--strategy=remote,local` instead. See bazelbuild#7480. - Introduce --incompatible_disable_native_android_rules flag - The Android desugaring actions now support a persistent worker mode for faster local build performance. Enable it with `--strategy=Desugar=worker`. - --incompatible_static_name_resolution_in_build_files is now enabled by default - --incompatible_disable_deprecated_attr_params is now enabled by default (bazelbuild#5818) - Repository containing autoconfigured C++ toolchain `@local_config_cc` has been split in 2 - see `local_config_cc_toolchains`. - --incompatible_string_join_requires_strings is now enabled by default - Flag --incompatible_new_actions_api is enabled by dewfault (bazelbuild#5825) - New flag `--incompatible_disallow_empty_glob`. See bazelbuild#8195 - --incompatible_no_kwargs_in_build_files is enabled by default - Incompatible flag `--incompatible_require_ctx_in_configure_features` has been flipped. See bazelbuild#7793 for more information. - `BAZEL_USE_XCODE_TOOLCHAIN=1` tells Bazel not to look for Xcode to decide whether to enable toolchains for Apple rules, but to assume Xcode is available. Can be also used when building on Darwin and no C++ or ObjC is being built, so there is no need to detect Xcode. - Android desugaring actions now use persistent workers by default. This has been measured to provide up to 20% reduction in build times. To disable it, use the `--strategy=Desugar=sandboxed` flag. See bazelbuild#8342 and bazelbuild#8427 for more details on local build speed optimization for Android apps. - Fixed an issue with Android builds where `--fat_apk_cpu` doesn't pack all selected shared libraries from `aar_import` targets into the APK. See [bazelbuild#8283](bazelbuild#8283). - Turn on --experimental_starlark_config_transitions by default for starlark transitions (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-transitions for more info) - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) - Incompatible flag `--incompatible_dont_enable_host_nonhost_crosstool_features` has been flipped. See bazelbuild#7407 for more information. - Added support for Android NDK 19 and 20. - Flip --incompatible_no_support_tools_in_action_inputs - --remote_executor, --remote_cache or --bes_backend=someurl.com would be treated as grpcs://someurl.com, if the --incompatible_tls_enabled_removed flag enabled. See bazelbuild#8061 for details. - Add new options --cs_fdo_absolute_path= to support the absolute path profile for LLVM's context-sensitive FDO. - When `--incompatible_strict_action_env` is enabled, the default `PATH` now includes `/usr/local/bin`. - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) This release contains contributions from many people at Google, as well as Alex Thompson, Andy Scott, Benjamin Peterson, David McNett, Drew Gassaway, Ira Shikhman, James deBoer, Jay Vercellone, Jingwen Chen, Josh Rosen, Keith Smiley, Laurent Le Brun, Lee Mracek, Marwan Tammam, Matt Passell, Michael Hackner, Michal Majcherski, Patrick Niklaus, Peter Mounce, Ricky Pai, Steeve Morin, szakmary, Takuto Ikuta, Vladimir Chebotarev, Yen-Chi Chen.
Baseline: 5935259 Cherry picks: + fe81b49: Support of using the absolute path profile for LLVM's Context Sensitive FDO + ce5e718: Demote OptionProcessor from globals + 3ed9d36: Properly wire up BES half-close. The lack thereof was a simple oversight. + 4ca768e: standardize graph output indentation with 2 spaces + aff189a: Make sure default Linux artifacts have an associated action, even when artifact names are altered. + 8c3b3fb: Failures early in package loading will now fail all --keep_going builds. + 123c68d: Warn in more cases of possible Python version mismatch in host config + 052167e: Add a non-strict autodetecting Python toolchain + 6ef6d87: Default java toolchain target + 50fa3ec: Fix problems with the non-strict Python toolchain + e2a626c: Automated rollback of commit bc6f7cb. + 6efc5b7: Treat existence of managed directories as a part of repository dirtiness. + 3a4be3c: Add /usr/local/bin to default PATH under strict action env + 5c1005c: Automated rollback of commit 536a166. Incompatible changes: - --incompatible_disable_objc_provider_resources no longer has effect. Use of deprecated resource fields on the Objc provider is now disallowed regardless of this flag. - deleted deprecated --experimental-remote-retry* flags, please use --remote_retries instead - flipped --incompatible_list_based_execution_strategy_selection flag to be true by default. See bazelbuild#7480 for details. - Octal integer literals in Starlark are required to start with "Oo". - The "native" module is no longer available in BUILD files, all its members can be accessed directly as global symbols. This can be temporarily reverted by providing --incompatible_disallow_native_in_build_file=false as a flag to Blaze. - The "native" module is no longer available in BUILD files, all its members can be accessed directly as global symbols. This can be temporarily reverted by providing --incompatible_disallow_native_in_build_file=false as a flag to Blaze. - Turn off binary style profile format. - The "native" module is no longer available in BUILD files, all its members can be accessed directly as global symbols. This can be temporarily reverted by providing --incompatible_disallow_native_in_build_f... - cleanup that affects user provided apple frameworks is now enabled by default. See bazelbuild#7944 for more info. - Python rules now determine the Python runtime using toolchains rather than `--python_top` and `--python_path`, which are deprecated. See [bazelbuild#7899](bazelbuild#7899) for information on declaring Python toolchains and migrating your code. As a side-benefit, this addresses [bazelbuild#4815](bazelbuild#4815) (incorrect interpreter version used) on non-Windows platforms. Note however that some builds break due to getting the version they asked for -- consider setting `python_version = "PY2"` on Python 2 targets and `--host_force_python=PY2` if any Python 2 targets are used in the host configuration. You can temporarily opt out of this change with `--incompatible_use_python_toolchains=false`. - Depsets can't be iterated over unless they're converted to lists using the .to_list() method. Use --incompatible_depset_is_not_iterable=false to temporarily restore the previous behaviour. New features: - Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. The rlocation() implementation is the same. - Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. The rlocation() implementation is the same. - Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. To use the new init code, you need Bazel 0.27 or newer. The old (longer) init code still works. Important changes: - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See bazelbuild#7977 for more info. - The --incompatible_disable_objc_library_resources flag is being removed. Please remove it from your configs as it otherwise will fail the build. - Add a generic additional_linker_inputs attribute on cc_binary rules. - Windows, C++ autoconfigure: BAZEL_VC and BAZEL_VS may now have quotes, so if you set these envvars' values in cmd.exe via TAB-completion then you no longer need to remove the surrounding quotes. - pkg_deb has new attributes: `config` and `templates` that can be used for integration with debconf - Allow cc_import() of a DLL with no interface library on Windows, used to document runtime dependencies. - All host-configured Python tools that are built for the wrong Python version will now emit a warning message when they exit with non-zero status. See bazelbuild#7899. - deprecated --remote_local_fallback_strategy. Use `--strategy=remote,local` instead. See bazelbuild#7480. - Introduce --incompatible_disable_native_android_rules flag - The Android desugaring actions now support a persistent worker mode for faster local build performance. Enable it with `--strategy=Desugar=worker`. - --incompatible_static_name_resolution_in_build_files is now enabled by default - --incompatible_disable_deprecated_attr_params is now enabled by default (bazelbuild#5818) - Repository containing autoconfigured C++ toolchain `@local_config_cc` has been split in 2 - see `local_config_cc_toolchains`. - --incompatible_string_join_requires_strings is now enabled by default - Flag --incompatible_new_actions_api is enabled by dewfault (bazelbuild#5825) - New flag `--incompatible_disallow_empty_glob`. See bazelbuild#8195 - --incompatible_no_kwargs_in_build_files is enabled by default - Incompatible flag `--incompatible_require_ctx_in_configure_features` has been flipped. See bazelbuild#7793 for more information. - `BAZEL_USE_XCODE_TOOLCHAIN=1` tells Bazel not to look for Xcode to decide whether to enable toolchains for Apple rules, but to assume Xcode is available. Can be also used when building on Darwin and no C++ or ObjC is being built, so there is no need to detect Xcode. - Android desugaring actions now use persistent workers by default. This has been measured to provide up to 20% reduction in build times. To disable it, use the `--strategy=Desugar=sandboxed` flag. See bazelbuild#8342 and bazelbuild#8427 for more details on local build speed optimization for Android apps. - Fixed an issue with Android builds where `--fat_apk_cpu` doesn't pack all selected shared libraries from `aar_import` targets into the APK. See [bazelbuild#8283](bazelbuild#8283). - Turn on --experimental_starlark_config_transitions by default for starlark transitions (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-transitions for more info) - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) - Incompatible flag `--incompatible_dont_enable_host_nonhost_crosstool_features` has been flipped. See bazelbuild#7407 for more information. - Added support for Android NDK 19 and 20. - Flip --incompatible_no_support_tools_in_action_inputs - --remote_executor, --remote_cache or --bes_backend=someurl.com would be treated as grpcs://someurl.com, if the --incompatible_tls_enabled_removed flag enabled. See bazelbuild#8061 for details. - Add new options --cs_fdo_absolute_path= to support the absolute path profile for LLVM's context-sensitive FDO. - When `--incompatible_strict_action_env` is enabled, the default `PATH` now includes `/usr/local/bin`. - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) This release contains contributions from many people at Google, as well as Alex Thompson, Andy Scott, Benjamin Peterson, David McNett, Drew Gassaway, Ira Shikhman, James deBoer, Jay Vercellone, Jingwen Chen, Josh Rosen, Keith Smiley, Laurent Le Brun, Lee Mracek, Marwan Tammam, Matt Passell, Michael Hackner, Michal Majcherski, Patrick Niklaus, Peter Mounce, Ricky Pai, Steeve Morin, szakmary, Takuto Ikuta, Vladimir Chebotarev, Yen-Chi Chen.
Baseline: 2e374a9 Cherry picks: + 6d0b14b: rule_test: apply "tags" to all rules in the macro Incompatible changes: - Add --incompatible_enable_profile_by_default to enable the JSON profile by default. - The --incompatible_windows_style_arg_escaping flag is flipped to "true", and the "false" case unsupported. Bazel no longer accepts this flag. Important changes: - Bazel now supports hiding compiler warnings for targets that you're not explicitly building (see https://docs.bazel.build/versions/master/user-manual.html#flag--au to_output_filter). - Flag `--incompatible_restrict_escape_sequences` is added. See #8380 - The "info" command now supports the "starlark-semantics" argument, which outputs a representation of the effective Starlark semantics option values. - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See #7977 for more info. - When `--incompatible_strict_action_env` is enabled, the default `PATH` now includes `/usr/local/bin`. - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) - `@bazel_tools//tools/jdk:toolchain_java10` and `@bazel_tools//tools/jdk:toolchain_java11` are now available to enable java 10, respectively java 11 language level support. - The `command` parameter of the `actions.run_shell()` function will be restricted to only accept strings (and not string sequences). This check is attached to flag `--incompatible_run_shell_command_string`. One may migrate by using the `arguments` parameter of `actions.run()` instead. See #5903 for more info. - Incompatible change `--incompatible_use_platforms_repo_for_constraints` has been added. See #8622 for details. - Incompatible change `--incompatible_use_platforms_repo_for_constraints` has been added. See #8622 f... - Bazel's C++ autoconfiguration now understands `BAZEL_LINKLIBS` environment variable to specify system libraries that should be appended to the link command line. - paths under the execution root starting with "." or "_" will be re-linked across builds - execution_log_json_file now allows actions without outputs. - Labels aapt as deprecated for aapt_version, and heavily endorses aapt2. - Update doc links still pointing to cc_binary.features to point to common features - Incompatible change `--incompatible_use_platforms_repo_for_constraints` has been added. See #8622 for details. RELNOTES: - --incompatible_disable_nocopts flag has been added. See #8706 for details. - Fixed treatment of <dist:module /> tags in AndroidManifest.xml - Fixed asset precedence for android_binary rules with aapt2. - Bazel now officially supports running on CentOS 7. - The runtime dynamic libraries are no longer in default output group of cc_binary. - set the FDOBuildType as CSFDO for binaries built with --cs_fdo_absolute_path. - Bazel can now be bootstrapped and built on arm64 platforms without requiring any flags or patches. - Fixed treatment of AndroidManifest.xml attributes which contained XML escaping - Retire experimental blaze flag experimental_link_compile_output_separately. The same behavior is available through the feature dynamic_link_test_srcs. - --incompatible_load_java_rules_from_bzl was added to forbid loading the native java rules directly. See more on tracking issue #8746 - Turn on --experimental_build_setting_api by default for starlark build settings (see https://docs.bazel.build/versions/master/skylark/config.html#user- defined-build-settings for more info) - Attribute names are going to be restricted and must be syntactically valid identifiers. #6437 - rule_test: fix Bazel 0.27 regression ("tags" attribute was ingored, #8723 This release contains contributions from many people at Google, as well as Ben Diuguid, Benjamin Peterson, Dave Lee, Loo Rong Jie, Mark Butcher, Marwan Tammam, Pedro Alvarez.
Without the ability to manually specify the rule kind, encouraging the macro-based solution is going further obscure the fact that the left-hand-side of the assignment from the return value of |
Baseline: daa8ae5 Cherry picks: + 61c7ffa: Automated rollback of commit 87388e2. + 898d7b6: Add test for repository overrides, conflicting with managed directories being added when Bazel server is already started. + c2001a4: Automated rollback of commit bbe47a1. + e67c961: Fix a non-determinism in create_embedded_tools.py. + 81aefe7: Remove unsupported cpu attribute from cc_toolchains. + 597e289: remote: made CombinedCache a composition of Disk and Http Cache + 942f7cf: C++: Fixes bug in C++ API with external repo aspects + 85a5a2b: Configure @androidsdk//:emulator_x86 and :emulator_arm to point to the unified emulator binary + 9835cb4: Automated rollback of commit 844e4e2. + c963ba2: Windows, Python: fix arg. esc. also in host config + a1ea487: Do not pre-cache changed files under managed directories + 7dc78cd: Add explicit execution and target constraints for autodiscovered cc t? + dd9ac13: Fix a bug when a relative path is used for the execution log + 0ff19c6: Fix StandaloneTestStrategy.appendStderr + 7f49531: Fix the autodetecting Python toolchain on Mac + ddce723: Avoid exporting PATH unnecessarily + 35dd05a: Allow Starlark rules to be able to use the `exec_compatible_with` Incompatible changes: - Flip --incompatible_windows_escape_jvm_flags to true. See bazelbuild#7486 - Flip --incompatible_windows_style_arg_escaping to true. See bazelbuild#7454 - --incompatible_windows_escape_jvm_flags is enabled by default, and the flag no longer exists - `--incompatible_no_output_attr_default` is enabled by default. - --incompatible_depset_union is enabled by default. - Python rules now determine the Python runtime using toolchains rather than `--python_top` and `--python_path`, which are deprecated. See [bazelbuild#7899](bazelbuild#7899) for information on declaring Python toolchains and migrating your code. As a side-benefit, this addresses bazelbuild#4815 (incorrect interpreter version used) on non-Windows platforms. You can temporarily opt out of this change with `--incompatible_use_python_toolchains=false`. - Python rules now determine the Python runtime using toolchains rather than `--python_top` and `--python_path`, which are deprecated. See bazelbuild#7899 for information on declaring Python toolchains and migrating your code. As a side-benefit, this addresses bazelbuild#4815 (incorrect interpreter version used) on non-Windows platforms. You can temporarily opt out of this change with `--incompatible_use_python_toolchains=false`. New features: - Windows, Python: the --incompatible_windows_escape_python_args flag (false by default) builds py_binary and py_test targets with correct command line argument escaping. - cquery supports --output=build Important changes: - Allow debugging C++ features logic. - The --ios_multi_cpus, --watchos_cpus, --macos_cpus and tvos_cpus are now additive. This means that you can now split the --ios_multi_cpus=arm64,armv7 into --ios_multi_cpus=arm64 and --ios_multi_cpus=armv7. - Generated Go protobufs now depend on //net/proto2/go:proto_gendeps instead of //net/proto2/go:proto - Add new options --cs_fdo_instrument and --cs_profile to support LLVM's context-sensitive FDO (CSFDO). - Bazel C++ compile/link Starlark API. Can be used with experimental flag --experimental_cc_skylark_api_enabled_packages=<package_path>,<pac kage_path2>. - `cc_toolchain.static_runtime_lib` and `cc_toolchain.dynamic_runtime_lib` are now exposed to Starlark. - New flag `--incompatible_no_kwargs_in_build_files`. See bazelbuild#8021 - struct.to_proto() converts dict into proto3 text message (map<,>). - Android resource conflicts will no longer be reported between a strong attr resource and a weak attr resource, if the weak attr does not have format specified. - Flag `--incompatible_static_name_resolution_in_build_files` is added. See bazelbuild#8022 - Add --incompatible_objc_framework_cleanup to control whether to enable some objc framework cleanup that changes the API. Specifically, the cleanup changes the objc provider API pertaining to frameworks. This change is expected to be transparent to most users unless they write their own Starlark rules to handle frameworks. See bazelbuild#7594 for details. - Added --incompatible_remove_binary_profile to disable the old binary profiles. Instead use the JSON profile format: https://docs.bazel.build/versions/master/skylark/performance.html# json-profile - Introducing --execution_log_binary_file and --execution_log_json_file that output a stable sorted execution log. They will offer a stable replacement to --experimental_execution_log_file. - Flag `--incompatible_disallow_old_octal_notation` is added. See //github.com/bazelbuild/issues/8059 - Removes the --incompatible_disable_genrule_cc_toolchain_dependency flag. - Android resource conflicts will no longer be reported between a strong attr resource and a weak attr resource, if the weak attr does not have format specified. - Incompatible flag `--incompatible_make_thinlto_command_lines_standalone` has been added. See bazelbuild#6791 for details. - objc_library does not support resource attributes any more. Please read bazelbuild#7594 for more info. - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See bazelbuild#7977 for more info. - New platform_mappings ability to allow gradual flag to platforms/toolchains migration. See also bazelbuild#6426 - Added support for compiling against fully qualified R classes from aar_import dependencies. - --tls_enabled flag is deprecated. Please provide 'grpcs' as a scheme in the URLs if TLS should be used for a remote connection. - Adds incompatible_disallow_rule_execution_platform_constraints_allowed, which disallows the use of the "execution_platform_constraints_allowed" attribute when defining new rules. - Flag `--incompatible_restrict_named_params` is added. See bazelbuild#8147 for details. - The glob function has a new argument `allow_empty`. When set to False, the glob fails when it doesn't match anything. - Adds the "disable_whole_archive_for_static_lib" feature to allow turning off legacy_whole_archive for individual targets. - C++ Starlark API for compilation and linking is no longer whitelisted - Update visibility advice in build-style - --incompatible_disable_objc_provider_resources is now enabled by default. - Fixed an issue where some `py_runtime`s were incompatible with using `--build_python_zip` (bazelbuild#5104). - The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See bazelbuild#7977 for more info. This release contains contributions from many people at Google, as well as Benjamin Peterson, Brian Topping, clyang82, Dave Lee, George Gensure, Greg Estren, Greg, Guro Bokum, Keith Smiley, Max Vorobev, Michael Hackner, Robert Brown, Robert Sayre, Ryan Beasley, Yannic.
Original change broke //scripts/packages/debian:bazel-debian.deb This rollforward manually tested to not break that target. *** Original change description *** Disable outputs param of rule function This constitutes an incompatible change guarded by flag --incompatible_no_rule_outputs_param. See bazelbuild#7977 for further details. Implementation for bazelbuild#7977. RELNOTES: The `outputs` parameter of the `rule()` function is deprecated and attached to flag `--incompatible_no_rule_outputs_param`. Migrate rules to use `OutputGroupInfo` or `attr.output` instead. See bazelbuild#7977 for more info. PiperOrigin-RevId: 252063297
As a user of rules, the real problem I have with outputs is that there are outputs I cannot reference directly. Unfortunately, this change risks encouraging this poor behavior exactly where it's most vexing. The rules that have the greatest need for declaring outputs with patterned names are complex rules that output files of different types (e.g. debug info, source maps, loaders etc.). Because these files have different purposes, it’s important to be able to pick the one you want instead of grabbing the whole bag. This use case is well-served by rule.outputs: you declare your outputs, name them with patterns, and they are “made available as labels” (user POV: they work). The change proposed here means that even if rules declare their outputs, they “won’t be made available as labels” (user POV: they’re broken, and I need to use a genrule to make a copy of the file I want, which will then work). To get working outputs rule authors will need to go out of their way and write a macro, which they won’t do until thirty users run into the issue and give up, twenty run into it and hack a workaround, and the fifty-first files a bug, at which point the macro may be added. Rinse and repeat for each new rule. BTW, I took the user POV here, but in reality I was also the author of the rule I was having an issue with. Both of me agree that we want declared labeled outputs in the rule. |
Update: We'd still like to remove implicit outputs, but at the moment don't have the bandwidth to reassess the alternatives users would migrate to. We won't actually flip the flag until we have time to address that. |
Is it possible to get some more attention on this? Huge numbers of projects (e.g. rules_docker, rules_nodejs, I believe many others) are using this feature extensively. There's no clear guidance on why it's deprecated or what they should be doing instead. It's uncomfortable to build lots of code around deprecated behavior, but these projects have found it so useful, they do it anyway. |
Going back to
Let's do an example. Let's assume we have a compiler that produces a debug file, but the name should be based on a value we get from the toolchain. We can not know this until Analysis time, so the current outputs functionality does not even work. Let's call that the 'debug' output. The way I approach this is:
We have an actual case in pkg_deb(name = "deb", ...)
filegroup(
name = "the_changes_file",
srcs = [":deb"],
output_group = "changes",
)
genrule(
name = "use_changes_file",
srcs = [":the_changes_file"],
outs = ["copy_of_changes.txt"],
cmd = "cp $(location :the_changes_file) $@",
) This might appear a little clunky, but often the |
Output groups work, though they are definitely less ergonomic than implicit outputs.
Is that....is that a real example? In any cases, yes output groups do work, though with a bit more awkwardness. For context, a real-world example is rules_docker's
https://github.com/bazelbuild/rules_docker/blob/master/docs/container.md#container_image Using deprecated features, tsk, tsk. |
Not the compiler, but the example is real for pkg_deb. The Debian standard for naming packages includes the target hardware architecture, so we have rules that can pick that up and use it to create the name. https://github.com/bazelbuild/rules_pkg/tree/main/examples/naming_package_files
True. But OutputGroupInfo solves the problem of names you can not predict until analysis time, so it's a mixed call.
As long as this is just variations on [name], then outputs is eaiser to use. But this also seems like something
What deprecated feature? |
Implicit outputs. They are deprecated, noted by both the docs and with the CLI flag. But they are so useful, rules_docker doesn't care. (Or at least, not enough to change now.) |
The outputs_param is deprecated, but having a rule create implicit outputs with declare is not. :-) No matter what the resolution to this issue is, we need functionality that lets a rule determine (at analysis time) the actual file name which gets created for an output. That is, wrapper macros are insufficient. The outputs param was a first cut at this - but there are claims it adds unwanted complexity in Bazel (I don't have an opinion on that). Putting things in OutputGroupInfo is a more general approach, but it has the annoyance that you need an intermediate filegroup to refer explicitly to any of the outputs declared at run time. Perhaps we could do something where attr.output had an additional parameter that defined a label template. Maybe `spec: attr.output(label='${name}.spec'). This would declare a new Label bound to that output from the rule. Other targets could depend on the 'name.spec' name in build files. Even better is if we had a ctx.action that could set the actual file name of an output. Sort of a variant of declare_file, but it only resets the name of an already declared output. I don't claim that this is even possible. I'm just trying to work up APIs that solve user problems and relatively easy to understand. |
I think Though IDK why implicit outputs were deprecated in the first place. |
According to https://buildkite.com/bazel/bazelisk-plus-incompatible-flags/builds/1253 This flag is breaking almost all downstream projects, I believe it's the same for the wider community. Also this flag is marked at P4, if no active plan on migrating the ecosystem, I'll remove "migration-ready" label for now. |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale. |
This flag disables the
outputs
parameter on therule()
function.Flag: --incompatible_no_rule_outputs_param
Motivation
Output Map Madness outlines some problems and inconsistencies in using this pattern, and there are also a couple of github issues (#2883 and #5581) on this matter.
Additional details in #6241
Migration
Use
OutputGroupInfo
specify output files instead.For example, replace:
with:
Note that this migration approach does not automatically let you specify these outputs by label. For example, you will notice that, with this exact approach, you cannot specify the ".exe"-suffix as its own label.
In order to preserve this implicit-output functionality, you will need to use
attr.output
with a macro-specified default. For example:The text was updated successfully, but these errors were encountered: