bazel icon indicating copy to clipboard operation
bazel copied to clipboard

--incompatible_disable_starlark_host_transitions

Open gregestren opened this issue 2 years ago • 5 comments

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 avatar Dec 14 '22 22:12 gregestren

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".

gregestren avatar Dec 14 '22 22:12 gregestren

Testing this flag at https://buildkite.com/bazel/bazelisk-plus-incompatible-flags/builds/1365#_

meteorcloudy avatar Dec 15 '22 10:12 meteorcloudy

For tracking:

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

image

To fix:

  • [x] Android Studio Plugin: https://github.com/bazelbuild/intellij/issues/4208
  • [x] Android Studio Plugin Google: https://github.com/bazelbuild/intellij/issues/4207
  • [ ] Bazel: https://github.com/bazelbuild/bazel/issues/17043
  • [ ] Bazel Examples: https://github.com/bazelbuild/examples/issues/273
  • [x] Bazel Remote Cache: https://github.com/buchgr/bazel-remote/issues/620
  • [ ] Bazel skylib: https://github.com/bazelbuild/bazel-skylib/issues/418
  • [ ] Bazel watcher: https://github.com/bazelbuild/bazel-watcher/issues/572
  • [x] Bazelisk: https://github.com/bazelbuild/bazelisk/issues/405
  • [ ] Buildfarm: https://github.com/bazelbuild/bazel-buildfarm/issues/1228
  • [x] Buildtools: https://github.com/bazelbuild/buildtools/issues/1109
  • [ ] Cartographer: https://github.com/cartographer-project/cartographer/issues/1913
  • [x] CLion Plugin: https://github.com/bazelbuild/intellij/issues/4219
  • [x] CLion Plugin Google: https://github.com/bazelbuild/intellij/issues/4218
  • [x] Cloud Robotics Core: https://github.com/googlecloudrobotics/core/issues/95
  • [ ] Envoy: https://github.com/envoyproxy/envoy/issues/24565
  • [ ] FlatBuffers: https://github.com/google/flatbuffers/issues/7715
  • [x] Flogger: https://github.com/google/flogger/issues/326
  • [x] Gerrit: https://bugs.chromium.org/p/gerrit/issues/detail?id=16531
  • [x] IntelliJ Plugin: https://github.com/bazelbuild/intellij/issues/4214
  • [x] IntelliJ Plugin Aspect: https://github.com/bazelbuild/intellij/issues/4213
  • [x] IntelliJ Plugin Aspect Google: https://github.com/bazelbuild/intellij/issues/4212
  • [x] IntelliJ Plugin Google: https://github.com/bazelbuild/intellij/issues/4211
  • [x] IntelliJ UE Plugin: https://github.com/bazelbuild/intellij/issues/4216
  • [x] IntelliJ UE Plugin Google: https://github.com/bazelbuild/intellij/issues/4215
  • [x] Kythe: https://github.com/kythe/kythe/issues/5487
  • [ ] Protobuf: https://github.com/protocolbuffers/protobuf/issues/11333
  • [x] rules_apple: https://github.com/bazelbuild/rules_apple/issues/1787
  • [x] rules_cc: https://github.com/bazelbuild/rules_cc/issues/159
  • [ ] rules_closure: https://github.com/bazelbuild/rules_closure/issues/568
  • [x] rules_dotnet: https://github.com/bazelbuild/rules_dotnet/issues/322
  • [ ] rules_foreign_cc: https://github.com/bazelbuild/rules_foreign_cc/issues/988
  • [x] rules_go: https://github.com/bazelbuild/rules_go/issues/3403
  • [ ] rules_groovy: https://github.com/bazelbuild/rules_groovy/issues/63
  • [x] rules_haskell: https://github.com/tweag/rules_haskell/issues/1846
  • [x] rules_jsonnet: https://github.com/bazelbuild/rules_jsonnet/issues/166
  • [ ] rules_jvm_external: https://github.com/bazelbuild/rules_jvm_external/issues/809
  • [ ] rules_kotlin: https://github.com/bazelbuild/rules_kotlin/issues/885
  • [ ] rules_nodejs: https://github.com/bazelbuild/rules_nodejs/issues/3613
  • [ ] rules_rust: https://github.com/bazelbuild/rules_rust/issues/1704
  • [ ] rules_sass: https://github.com/bazelbuild/rules_sass/issues/145
  • [x] rules_swift: https://github.com/bazelbuild/rules_swift/issues/952
  • [ ] rules_webtesting: https://github.com/bazelbuild/rules_webtesting/issues/449
  • [x] Stard_oc: https://github.com/bazelbuild/stardoc/issues/145
  • [x] rules_Pythonhttps://github.com/bazelbuild/rules_python/issues/1236

keertk avatar Dec 15 '22 13:12 keertk

I think this breaks rules_docker too, could you add that to the tests on buildkite?

mostynb avatar Dec 16 '22 09:12 mostynb

@mostynb Unfortunately, rules_docker still uses Bazel 4.0.0, and is disabled in the Bazel's downstream pipeline due to https://github.com/bazelbuild/rules_docker/issues/1988. You'll need to fix that one before we can add rules_docker back to Bazel's downstream

meteorcloudy avatar Dec 16 '22 09:12 meteorcloudy

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.

shahms avatar May 15 '23 16:05 shahms

/cc @aiuto

meteorcloudy avatar May 15 '23 16:05 meteorcloudy

Not near desk right now, but it sounds like we've got to upgrade a basal 62X release to a fresher rooms license. I'll take a look at that later this week.

On Mon, May 15, 2023, 12:11 PM Yun Peng @.***> wrote:

/cc @aiuto https://github.com/aiuto

— Reply to this email directly, view it on GitHub https://github.com/bazelbuild/bazel/issues/17032#issuecomment-1548154932, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXHHHEG3XU42SLKXB6OJR3XGJIU5ANCNFSM6AAAAAAS7BEDJE . You are receiving this because you were mentioned.Message ID: @.***>

aiuto avatar May 15 '23 18:05 aiuto

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.

aiuto avatar May 15 '23 19:05 aiuto