Skip to content

Commit d87eaf5

Browse files
comiuscopybara-github
authored andcommitted
Flip incompatible_disable_autoloads_in_main_repo
The flag flip forces loads in main repository when using Bazel@HEAD. Flipping it now, so that we can disable autoloads by release of Bazel 9. Downstream test: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/4659 Issue: #25755 PiperOrigin-RevId: 756261097 Change-Id: I7204470c08a66a15b28bc0b0c48f41d69e1694c8
1 parent dc501a6 commit d87eaf5

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public final class BuildLanguageOptions extends OptionsBase {
149149

150150
@Option(
151151
name = "incompatible_disable_autoloads_in_main_repo",
152-
defaultValue = "false",
152+
defaultValue = "true",
153153
documentationCategory = OptionDocumentationCategory.STARLARK_SEMANTICS,
154154
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
155155
metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE},
@@ -943,7 +943,7 @@ public StarlarkSemantics toStarlarkSemantics() {
943943
public static final String INCOMPATIBLE_STOP_EXPORTING_LANGUAGE_MODULES =
944944
"-incompatible_stop_exporting_language_modules";
945945
public static final String INCOMPATIBLE_DISABLE_AUTOLOADS_IN_MAIN_REPO =
946-
"-incompatible_disable_autoloads_in_main_repo";
946+
"+incompatible_disable_autoloads_in_main_repo";
947947
public static final String INCOMPATIBLE_ALLOW_TAGS_PROPAGATION =
948948
"+incompatible_allow_tags_propagation";
949949
public static final String EXPERIMENTAL_BUILTINS_DUMMY = "-experimental_builtins_dummy";

src/test/shell/bazel/external_integration_test.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ http_archive(
135135
sha256 = '$sha256'
136136
)
137137
EOF
138+
add_rules_shell "MODULE.bazel"
138139

139140
cat > zoo/BUILD <<EOF
141+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
140142
sh_binary(
141143
name = "breeding-program",
142144
srcs = ["female.sh"],
@@ -195,6 +197,7 @@ http_archive(
195197
type = 'zip',
196198
)
197199
EOF
200+
add_rules_shell "MODULE.bazel"
198201
bazel run //zoo:breeding-program >& $TEST_log \
199202
|| echo "Expected build/run to succeed"
200203
kill_nc
@@ -249,8 +252,10 @@ http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "ht
249252
http_archive(name = 'endangered', url = 'http://bad.example/repo.zip',
250253
sha256 = '2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9826')
251254
EOF
252-
255+
add_rules_shell "MODULE.bazel"
253256
cat > zoo/BUILD <<EOF
257+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
258+
254259
sh_binary(
255260
name = "breeding-program",
256261
srcs = ["female.sh"],
@@ -293,6 +298,7 @@ EOF
293298

294299
cat > zoo/BUILD <<EOF
295300
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
301+
296302
sh_binary(
297303
name = "breeding-program",
298304
srcs = ["female.sh"],
@@ -614,9 +620,11 @@ http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_
614620
http_file(name = 'toto', urls = ['http://127.0.0.1:$nc_port/toto'],
615621
sha256 = '$sha256', executable = True)
616622
EOF
617-
623+
add_rules_shell "MODULE.bazel"
618624
mkdir -p test
619625
cat > test/BUILD <<'EOF'
626+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
627+
620628
sh_binary(
621629
name = "test",
622630
srcs = ["test.sh"],
@@ -672,9 +680,11 @@ http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_
672680
http_file(name = 'toto', urls = ['http://127.0.0.1:$redirect_port/toto'],
673681
sha256 = '$sha256')
674682
EOF
675-
683+
add_rules_shell "MODULE.bazel"
676684
mkdir -p test
677685
cat > test/BUILD <<'EOF'
686+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
687+
678688
sh_binary(
679689
name = "test",
680690
srcs = ["test.sh"],
@@ -2641,7 +2651,10 @@ local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl"
26412651
local_repository(name = 'repo1', path='$test_repo1')
26422652
local_repository(name = 'repo2', path='$test_repo2')
26432653
EOF
2654+
add_rules_java "MODULE.bazel"
26442655
cat > BUILD <<'EOF'
2656+
load("@rules_java//java:java_binary.bzl", "java_binary")
2657+
26452658
java_binary(
26462659
name = "a_bin",
26472660
runtime_deps = ["@repo1//a:a"],

src/test/shell/bazel/remote/remote_execution_test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3770,8 +3770,10 @@ EOF
37703770
# remote execution regardless of whether they are added as a source directory or
37713771
# via globbing.
37723772
function test_source_directory() {
3773+
add_rules_shell "MODULE.bazel"
37733774
mkdir -p a
37743775
cat > a/BUILD <<'EOF'
3776+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
37753777
filegroup(
37763778
name = "source_directory",
37773779
srcs = ["dir"],

src/test/shell/integration/incompatible_autoload_externally_test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ source "${CURRENT_DIR}/../integration_test_setup.sh" \
2424
#### SETUP #############################################################
2525

2626
set -e
27+
add_to_bazelrc "common --noincompatible_disable_autoloads_in_main_repo"
2728

2829
#### TESTS #############################################################
2930

0 commit comments

Comments
 (0)