Skip to content
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_disable_starlark_host_transitions #17032

Open
gregestren opened this issue Dec 14, 2022 · 9 comments
Open

incompatible_disable_starlark_host_transitions #17032

gregestren opened this issue Dec 14, 2022 · 9 comments
Assignees
Labels
breaking-change-7.0 Incompatible flags to be flipped in Bazel 7.0 incompatible-change Incompatible/breaking change migration-ready Incompatible flag is ready for migration with Bazel rolling releases or Bazel@last_green P2 We'll consider working on this in future. (Assignee optional)

Comments

@gregestren
Copy link
Contributor

Change:

--incompatible_disable_starlark_host_transitions 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.
@gregestren gregestren added P2 We'll consider working on this in future. (Assignee optional) incompatible-change Incompatible/breaking change labels Dec 14, 2022
@gregestren
Copy link
Contributor Author

Early evidence is this breaks Bazel's own tests: //src/test/shell/bazel:bazel_bootstrap_distfile_test fails because of a grpc repo dependency with cfg="host".

@meteorcloudy meteorcloudy added the migration-ready Incompatible flag is ready for migration with Bazel rolling releases or Bazel@last_green label Dec 15, 2022
@meteorcloudy
Copy link
Member

@keertk
Copy link
Member

keertk commented Dec 15, 2022

For tracking:

Failures: https://buildkite.com/bazel/bazelisk-plus-incompatible-flags/builds/1365

image

To fix:

This was referenced Dec 15, 2022
linzhp pushed a commit to bazel-contrib/rules_go that referenced this issue Dec 16, 2022
Become compatible with
`--incompatible_disable_starlark_host_transitions`, which will be
flipped in Bazel 7.

bazelbuild/bazel#17032
uhthomas pushed a commit to bazelbuild/rules_docker that referenced this issue Dec 16, 2022
This will be required for bazel 7.0 due to bazelbuild/bazel#17032.
@meteorcloudy meteorcloudy changed the title --incompatible_disable_starlark_host_transitions incompatible_disable_starlark_host_transitions Dec 22, 2022
@keertk keertk added the breaking-change-7.0 Incompatible flags to be flipped in Bazel 7.0 label Feb 1, 2023
healthy-pod pushed a commit to cockroachdb/rules_go that referenced this issue Feb 18, 2023
Become compatible with
`--incompatible_disable_starlark_host_transitions`, which will be
flipped in Bazel 7.

bazelbuild/bazel#17032
healthy-pod pushed a commit to cockroachdb/rules_go that referenced this issue Feb 22, 2023
Become compatible with
`--incompatible_disable_starlark_host_transitions`, which will be
flipped in Bazel 7.

bazelbuild/bazel#17032
@shahms
Copy link

shahms commented May 15, 2023

As of Bazel 6.2, this flag remains almost entirely unusable as the included version of rules_license still specifies cfg = "host" and that will be triggered by any use of http_archive, which is likely to cover most repositories at this point.

@meteorcloudy
Copy link
Member

/cc @aiuto

@aiuto
Copy link
Contributor

aiuto commented May 15, 2023 via email

@aiuto
Copy link
Contributor

aiuto commented May 15, 2023

Yeech. Bazel at head and 6.x is using rules_license 0.0.3. I'll have 0.0.5 out later this week. We can upgrade both to that.

tingilee pushed a commit to tingilee/rules_go that referenced this issue Jul 19, 2023
Become compatible with
`--incompatible_disable_starlark_host_transitions`, which will be
flipped in Bazel 7.

bazelbuild/bazel#17032
gregestren added a commit to gregestren/examples that referenced this issue Nov 15, 2023
gregestren added a commit to bazelbuild/examples that referenced this issue Dec 8, 2023
For bazelbuild/bazel#17032 (eliminate
dependencies on `cfg = "host"`)
gregestren added a commit to gregestren/grpc that referenced this issue Dec 8, 2023
Preserves future Bazel compatibility:
bazelbuild/bazel#17032

Extension of grpc#32021 which missed review.
copybara-service bot pushed a commit to grpc/grpc that referenced this issue Dec 15, 2023
Preserves future Bazel compatibility:bazelbuild/bazel#17032

Extension of #32021 which missed review.

release notes: no

Closes #35258

COPYBARA_INTEGRATE_REVIEW=#35258 from gregestren:master 7379674
PiperOrigin-RevId: 591092923
cushon added a commit to cushon/sdk-platform-java that referenced this issue Feb 28, 2024
This is a no-op cleanup, 'host' is being renamed to 'exec', see:
bazelbuild/bazel#17032
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change-7.0 Incompatible flags to be flipped in Bazel 7.0 incompatible-change Incompatible/breaking change migration-ready Incompatible flag is ready for migration with Bazel rolling releases or Bazel@last_green P2 We'll consider working on this in future. (Assignee optional)
Projects
None yet
Development

No branches or pull requests

7 participants