Skip to content

Add --experimental_disable_build_prelude - #32503

Closed
dzbarsky wants to merge 1 commit into
bazelbuild:masterfrom
dzbarsky:dzbarsky/disable-build-prelude
Closed

dzbarsky wants to merge 1 commit into
bazelbuild:masterfrom
dzbarsky:dzbarsky/disable-build-prelude

Conversation

@dzbarsky

@dzbarsky dzbarsky commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Bazel implicitly looks for //tools/build_rules:prelude_bazel when loading BUILD files. Even when the prelude is absent, that lookup can add dependencies on ancestor BUILD files. Add the default-off --experimental_disable_build_prelude flag to skip the lookup in every repository. Repositories that rely on prelude symbols can move them to a .bzl file and load them explicitly. See #11946 for the prior discussion about removing the prelude.

The integration test toggles the flag on a warm server and checks the main and external repositories.

@github-actions github-actions Bot added team-Core Skyframe, bazel query, BEP, options parsing, bazelrc awaiting-review PR is awaiting review from an assigned reviewer team-Loading-API BUILD file and macro processing: labels, package(), visibility, glob labels Nov 8, 2026
dzbarsky added a commit to dzbarsky/bazel that referenced this pull request Nov 8, 2026
Skip prelude lookup and loading for every repository when the flag is
enabled. Register the flag in StarlarkSemantics so toggling it on a
warm server reevaluates BUILD files.

See bazelbuild#11946 for prior discussion about removing the prelude.

RELNOTES: Bazel now supports `--incompatible_disable_build_prelude` to disable implicit BUILD preludes.
(cherry picked from commit 0a6bc21)

Upstream-PR: bazelbuild#32503
dzbarsky added a commit to dzbarsky/bazel that referenced this pull request Nov 9, 2026
Skip prelude lookup and loading for every repository when the flag is
enabled. Register the flag in StarlarkSemantics so toggling it on a
warm server reevaluates BUILD files.

See bazelbuild#11946 for prior discussion about removing the prelude.

RELNOTES: Bazel now supports `--incompatible_disable_build_prelude` to disable implicit BUILD preludes.
(cherry picked from commit 0a6bc21)

Upstream-PR: bazelbuild#32503

@susinmotion susinmotion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In general this seems fine, but I'd like to talk about it with the team briefly

dzbarsky added a commit to dzbarsky/bazel that referenced this pull request Nov 11, 2026
Skip prelude lookup and loading for every repository when the flag is
enabled. Register the flag in StarlarkSemantics so toggling it on a
warm server reevaluates BUILD files.

See bazelbuild#11946 for prior discussion about removing the prelude.

RELNOTES: Bazel now supports `--incompatible_disable_build_prelude` to disable implicit BUILD preludes.
(cherry picked from commit 0a6bc21)

Upstream-PR: bazelbuild#32503
dzbarsky added a commit to dzbarsky/bazel that referenced this pull request Nov 12, 2026
Skip prelude lookup and loading for every repository when the flag is
enabled. Register the flag in StarlarkSemantics so toggling it on a
warm server reevaluates BUILD files.

See bazelbuild#11946 for prior discussion about removing the prelude.

RELNOTES: Bazel now supports `--incompatible_disable_build_prelude` to disable implicit BUILD preludes.
(cherry picked from commit 0a6bc21)

Upstream-PR: bazelbuild#32503
dzbarsky added a commit to dzbarsky/bazel that referenced this pull request Nov 16, 2026
Skip prelude lookup and loading for every repository when the flag is
enabled. Register the flag in StarlarkSemantics so toggling it on a
warm server reevaluates BUILD files.

See bazelbuild#11946 for prior discussion about removing the prelude.

RELNOTES: Bazel now supports `--incompatible_disable_build_prelude` to disable implicit BUILD preludes.
(cherry picked from commit 0a6bc21)

Upstream-PR: bazelbuild#32503
dzbarsky added a commit to dzbarsky/bazel that referenced this pull request Nov 19, 2026
Skip prelude lookup and loading for every repository when the flag is
enabled. Register the flag in StarlarkSemantics so toggling it on a
warm server reevaluates BUILD files.

See bazelbuild#11946 for prior discussion about removing the prelude.

RELNOTES: Bazel now supports `--incompatible_disable_build_prelude` to disable implicit BUILD preludes.
(cherry picked from commit 0a6bc21)

Upstream-PR: bazelbuild#32503
@susinmotion

Copy link
Copy Markdown
Contributor

We do not intend to flip this flag. Can you name the flag experimental_disable... instead?

@dzbarsky
dzbarsky force-pushed the dzbarsky/disable-build-prelude branch from 0a6bc21 to 6c0b71e Compare November 22, 2026 12:50
@dzbarsky dzbarsky changed the title Add --incompatible_disable_build_prelude Add --experimental_disable_build_prelude Nov 22, 2026
Skip prelude lookup and loading for every repository when the flag is enabled. Register the flag in StarlarkSemantics so a change invalidates loaded packages.
@dzbarsky
dzbarsky force-pushed the dzbarsky/disable-build-prelude branch from 6c0b71e to c64e628 Compare November 22, 2026 12:51
@dzbarsky

Copy link
Copy Markdown
Contributor Author

We do not intend to flip this flag. Can you name the flag experimental_disable... instead?

Sure thing, done!

dzbarsky added a commit to dzbarsky/bazel that referenced this pull request Nov 22, 2026
Skip prelude lookup and loading for every repository when the flag is
enabled. Register the flag in StarlarkSemantics so toggling it on a
warm server reevaluates BUILD files.

See bazelbuild#11946 for prior discussion about removing the prelude.

RELNOTES: Bazel now supports `--incompatible_disable_build_prelude` to disable implicit BUILD preludes.
(cherry picked from commit 0a6bc21)

Upstream-PR: bazelbuild#32503
dzbarsky added a commit to dzbarsky/bazel that referenced this pull request Nov 23, 2026
Skip prelude lookup and loading for every repository when the flag is
enabled. Register the flag in StarlarkSemantics so toggling it on a
warm server reevaluates BUILD files.

See bazelbuild#11946 for prior discussion about removing the prelude.

RELNOTES: Bazel now supports `--incompatible_disable_build_prelude` to disable implicit BUILD preludes.
(cherry picked from commit 0a6bc21)

Upstream-PR: bazelbuild#32503
@brandjon brandjon added copybara:import Trigger copybara to import the PR and removed awaiting-review PR is awaiting review from an assigned reviewer labels Nov 23, 2026
dzbarsky added a commit to dzbarsky/bazel that referenced this pull request Nov 29, 2026
Skip prelude lookup and loading for every repository when the flag is
enabled. Register the flag in StarlarkSemantics so toggling it on a
warm server reevaluates BUILD files.

See bazelbuild#11946 for prior discussion about removing the prelude.

RELNOTES: Bazel now supports `--incompatible_disable_build_prelude` to disable implicit BUILD preludes.
(cherry picked from commit 0a6bc21)

Upstream-PR: bazelbuild#32503
dzbarsky added a commit to dzbarsky/bazel that referenced this pull request Dec 3, 2026
Skip prelude lookup and loading for every repository when the flag is
enabled. Register the flag in StarlarkSemantics so toggling it on a
warm server reevaluates BUILD files.

See bazelbuild#11946 for prior discussion about removing the prelude.

RELNOTES: Bazel now supports `--incompatible_disable_build_prelude` to disable implicit BUILD preludes.
(cherry picked from commit 0a6bc21)

Upstream-PR: bazelbuild#32503
dzbarsky added a commit to dzbarsky/bazel that referenced this pull request Dec 4, 2026
Skip prelude lookup and loading for every repository when the flag is
enabled. Register the flag in StarlarkSemantics so toggling it on a
warm server reevaluates BUILD files.

See bazelbuild#11946 for prior discussion about removing the prelude.

RELNOTES: Bazel now supports `--incompatible_disable_build_prelude` to disable implicit BUILD preludes.
(cherry picked from commit 0a6bc21)

Upstream-PR: bazelbuild#32503
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copybara:import Trigger copybara to import the PR team-Core Skyframe, bazel query, BEP, options parsing, bazelrc team-Loading-API BUILD file and macro processing: labels, package(), visibility, glob

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants