diff --git a/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java b/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java index 02ba6d1e6d6099..8805b243ef5c4d 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java +++ b/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java @@ -486,9 +486,13 @@ public final class BuildLanguageOptions extends OptionsBase { + "https://github.com/bazelbuild/bazel/issues/9014 for details.") public boolean incompatibleDisableTargetDefaultProviderFields; + // DO NOT inline this constant: it's used by copybara to alter the default value. It's different + // in Google and in OSS Bazel. + private static final String DISALLOW_EMPTY_GLOB_DEFAULT = "true"; + @Option( name = "incompatible_disallow_empty_glob", - defaultValue = "false", + defaultValue = DISALLOW_EMPTY_GLOB_DEFAULT, category = "incompatible changes", documentationCategory = OptionDocumentationCategory.STARLARK_SEMANTICS, effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS}, @@ -976,7 +980,8 @@ public StarlarkSemantics toStarlarkSemantics() { "+incompatible_depset_for_libraries_to_link_getter"; public static final String INCOMPATIBLE_DISABLE_TARGET_PROVIDER_FIELDS = "-incompatible_disable_target_provider_fields"; - public static final String INCOMPATIBLE_DISALLOW_EMPTY_GLOB = "-incompatible_disallow_empty_glob"; + // Note that INCOMPATIBLE_DISALLOW_EMPTY_GLOB differs in Google and in OSS Bazel. + public static final String INCOMPATIBLE_DISALLOW_EMPTY_GLOB = "+incompatible_disallow_empty_glob"; public static final String INCOMPATIBLE_DISALLOW_STRUCT_PROVIDER_SYNTAX = "+incompatible_disallow_struct_provider_syntax"; public static final String INCOMPATIBLE_PACKAGE_GROUP_HAS_PUBLIC_SYNTAX = diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java index 78964bc3b08212..49d29f125c0af8 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java +++ b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java @@ -259,7 +259,8 @@ protected void setupRulesCc(MockToolsConfig config) throws IOException { "cc/cc_toolchain_config_lib.bzl", "cc/find_cc_toolchain.bzl", "cc/toolchain_utils.bzl", - "cc/private/rules_impl/BUILD")) { + "cc/private/rules_impl/BUILD", + "cc/private/rules_impl/native.bzl")) { try { config.overwrite( "third_party/bazel_rules/rules_cc/" + path, diff --git a/src/test/shell/bazel/runfiles_test.sh b/src/test/shell/bazel/runfiles_test.sh index 2f4b07698c00e4..0b0055331586a1 100755 --- a/src/test/shell/bazel/runfiles_test.sh +++ b/src/test/shell/bazel/runfiles_test.sh @@ -240,7 +240,7 @@ function test_switch_runfiles_from_enabled_to_disabled { sh_binary( name = "cmd", srcs = ["cmd.sh"], - data = glob(["data-*"]), + data = glob(["data-*"], allow_empty = True), ) genrule( name = "g",