bazelbuild / bazelbuild/bazel

incompatible_disable_starlark_host_transitions

Open
#17,032 11 comments 5 reactions 1 assignee Assigned to @keertk View on GitHub
incompatible-change migration-ready P2
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

#### Change:

[--incompatible_disable_starlark_host_transitions](https://github.com/bazelbuild/bazel/blob/27f0f0f947a6f066b752f0212a19780706005c4e/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java#L624-L630) makes this Starlark syntax illegal:

cfg = "host"

Instead use:

cfg = "exec"

#### Rationale:
Rules can't be configured for the *host* configuration, which is the machine Bazel rules on. They must be configured for the *exec* configuration, which is the machine that runs builds actions. Sometimes these are the same (local builds), but not always (remote execution builds). `exec` correctly captures these differences.

Even with this flag disabled, `cfg = "host"` is an alias for `cfg = "exec"`. So this is a no-op beyond the syntax cleanup.

#### Expected error for unmigrated code:

Error in label: 'cfg = "host"' is deprecated and should no longer be used. Please use 'cfg = "exec"' instead.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.