-
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_disallow_empty_glob: fail if a glob doesn't match anything #8195
Comments
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.
Implements bazelbuild#8195 When the flag is enabled, the default value of allow_empty in glob is False. RELNOTES: New flag `--incompatible_disallow_empty_glob`. See bazelbuild#8195 PiperOrigin-RevId: 250263059
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: 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.
Implements bazelbuild#8195 When the flag is enabled, the default value of allow_empty in glob is False. RELNOTES: New flag `--incompatible_disallow_empty_glob`. See bazelbuild#8195 PiperOrigin-RevId: 250263059
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.
Worth noting this will cause a lot of churn in macros, especially in private repositories, that will not be exposed in downstream rule sets. |
Hi all, wanted to check if we plan to flip this flag in 7.0? Let me know when this is ready for migration so we can check for downstream fixes needed. Thanks. |
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 PR is to flip the default value of `incompatible_disallow_empty_glob`. This flag is tracked in #8195 and it is available since Bazel 0.29 from August 2019. Once this is merged, users still can allow empty globs without being explicit setting `--incompatible_disallow_empty_glob=false`. The motivation of the flip is bazel-contrib/SIG-rules-authors#37 and the fact of not keeping an incompatible flag for 4 years without flipping it. What needs to be done before flipping this: - [x] Merge protocolbuffers/upb#584 - [x] Update upb to a version that has the change in protocolbuffers/upb#584 - [x] Merge protocolbuffers/upb#745 - [x] Bring the changes from protocolbuffers/upb#745 to the 21.x branch - [x] Bring the changes from protocolbuffers/upb@e5f2601 to the 21.x branch (protocolbuffers/upb#781) - [x] Update upb to the latest commit of the 21.x branch (#16343) - [x] Merge #15374 - [x] Merge #15339 - [x] Merge #15330 - [x] Merge #16431 - [x] Merge #16468 - [x] Get green checks for this PR - [ ] Fix failures in downstream projects: https://buildkite.com/bazel/bazelisk-plus-incompatible-flags - [ ] Fix empty globs from IntellIJ Plugin (https://github.com/bazelbuild/intellij) - [ ] Issue: bazelbuild/intellij#4040 - [ ] Android Studio Plugin - [ ] Android Studio Plugin Google - [ ] CLion Plugin - [ ] CLion Plugin Google - [ ] IntelliJ Plugin - [ ] IntelliJ Plugin Aspect - [ ] IntelliJ Plugin Aspect Google - [ ] IntelliJ Plugin Google - [ ] IntelliJ UE Plugin - [ ] IntelliJ UE Plugin Google - Opened PRs - [x] bazelbuild/intellij#4025 - [x] bazelbuild/intellij#4038 - [x] Fix empty globs from Bazel Bench (https://github.com/bazelbuild/bazel-bench) - [ ] bazelbuild/bazel-bench#174 - [x] bazelbuild/bazel-bench#149 - [x] Fix empty globs from Buildfarm (https://github.com/bazelbuild/bazel-buildfarm) - [x] Fix empty globs from Cargo - [x] ~~Fix empty globs from Cartographer (https://github.com/cartographer-project/cartographer)~~ (No longer maintained) - Issue: cartographer-project/cartographer#1908 - PR to enforce it cartographer-project/cartographer#1944 - [x] Fix empty globs from Cloud Robotics Core (https://github.com/googlecloudrobotics/core/) - [x] PR to prevent regresions googlecloudrobotics/core#279 - [ ] Fix empty globs from Envoy - [x] Fix empty globs from FlatBuffers - [x] Fix empty globs from Flogger - [ ] Fix empty globs from Gerrit (https://gerrit.googlesource.com/gerrit.git) - Issue: https://issues.gerritcodereview.com/issues/40011754 - [x] Fix empty globs from :bazel:Protobuf - [x] Fix empty globs from rules_android_ndk - [ ] Fix empty globs from rules_dotnet - [x] Fix empty globs from :bazel:rules_foreign_cc bazel-contrib/rules_foreign_cc#974 - [x] Fix empty globs from rules_go - [x] Fix empty globs from rules_haskell tweag/rules_haskell#1827 - [x] Fix empty globs from :bazel:rules_jvm_external - [x] Fix empty globs from rules_kotlin - [x] Fix empty globs from rules_nodejs - [x] Fix empty globs from :bazel:rules_python - [ ] Fix empty globs from rules_rust - [x] Fix empty globs from rules_swift - [x] Fix empty globs from rules_webtesting - [x] Fix empty globs from TensorFlow tensorflow/tensorflow#58155 - [x] tensorflow/tensorflow#58008 - [x] tensorflow/tensorflow#58154 - [x] Fix empty globs from upb RELNOTES[INC]: The flag `--incompatible_disallow_empty_glob` now defaults to true. Closes #15327. PiperOrigin-RevId: 683316885 Change-Id: Id34ffd32a9e979fada9207e475b826a508100ba5
I want an error if we don't have any |
@brentleyjones Would this work for you? glob([
allow_empty = True,
"*.strings",
"*.stringsdict",
]) or fail("glob is empty") |
Yes. Thank you. |
…_glob (#3507) An issue was reported in `rules_rust` (bazelbuild/rules_rust#3137) where some local patches to satisfy bazelbuild/bazel#8195 were added to llvm via a `single_version_override` which does not affect consumers. This change is an attempt to upstream an otherwise noop change to llvm that supports this flag being flipped in Bazel. --------- Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
The
glob()
function tends to be error-prone, because any typo in a path will silently return an empty list. This has been a source of confusion and bugs for many users.glob
has an optional Boolean argumentallow_empty
. For example, let's say your code looks like:This code will fail if
pattern_a
orpattern_b
doesn't match anything. It also fails if the whole function (after excludingpattern_c
) doesn't match anything. We believe this behavior is safer in general.In rare cases, this is intentional that a pattern doesn't match anything, e.g. when a source file is optional. When it happens, users should tell their intent explicitly by setting
allow_empty = True
.What's going to change? The default value of
allow_empty
used to be True. It will change to False.How to update your code? If a glob fails, use
allow_empty = True
to keep the old behavior.In Bazel 8.0, the flag
--incompatible_disallow_empty_glob
will default totrue
. This means that theallow_empty
argument defaults toFalse
on allglob
calls.The text was updated successfully, but these errors were encountered: