Repository: kythe/kythe (language: rust)

Issue:
Flag --incompatible_disable_starlark_host_transitions will break Kythe in Bazel 7.0
Incompatible flag `--incompatible_disable_starlark_host_transitions` will be enabled by default in the next major release (Bazel 7.0), thus breaking Kythe. Please migrate to fix this and unblock the flip of this flag.

The flag is documented here: [bazelbuild/bazel#17032](https://github.com/bazelbuild/bazel/issues/17032).

Please check the following CI builds for build and test results:

- [Ubuntu 20.04 OpenJDK 11](https://buildkite.com/bazel/bazelisk-plus-incompatible-flags/builds/1390#0185940e-47e5-42f6-8763-cd5f3f3fa30e)

Never heard of incompatible flags before? We have [documentation](https://docs.bazel.build/versions/master/backward-compatibility.html) that explains everything.
If you have any questions, please file an issue in https://github.com/bazelbuild/continuous-integration.


Discussion / hints:
Great. This (or at least the first) failure is due to `bazel_build_rules_nodejs` which is *already* problematic to update
It looks like the only remaining breakage is rules_jvm_external for which we'll need a new release as the most recent (4.5) still uses `host = "cfg"`
And the next release will be a major version bump (https://github.com/bazelbuild/rules_jvm_external/issues/831)
There are no more `host = "cfg"` references in the `HEAD` of `master` of `rules_jvm_external`, and I'm [currently bumping the version of rules_nodejs](https://github.com/bazelbuild/rules_jvm_external/pull/861) Hopefully those will resolve the issues you're seeing. How do we test to ensure this is fixed?
We've addressed the rules_nodejs issue, so should just need to update rules_jvm_external and hope it goes smoothly.
Hi Team, Any update on this issue? 
The latest version of bazel (6.2) ships with a bazel_tools repository which depends on a version of rules_license repository which is incompatible with that flag, which complicates testing.
```
$ bazel test --incompatible_disable_starlark_host_transitions //kythe/...
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 2bcb2976-afe2-4b71-ace0-cb2aeff8db0e
WARNING: --remote_upload_local_results is set, but the remote cache does not support uploading action results or the current account is not authorized to write local results to the remote cache.
ERROR: Traceback (most recent call last):
        File "/usr/local/google/home/shahms/.cache/bazel/_bazel_shahms/kythe_shared/external/rules_license/rules/license.bzl", line 51, column 41, in <toplevel>
                "license_kinds": attr.label_list(
Error in label_list: 'cfg = "host"' is deprecated and should no longer be used. Please use 'cfg = "exec"' instead.
...
Repository rule http_archive defined at:
  /usr/local/google/home/shahms/.cache/bazel/_bazel_shahms/kythe_shared/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
ERROR: /usr/local/google/home/shahms/.cache/bazel/_bazel_shahms/kythe_shared/external/bazel_tools/third_party/ijar/BUILD:47:11: error loading package '@bazel_tools//third_party/zlib': initialization of module 'rules/license.bzl' failed and referenced by '@bazel_tools//third_party/ijar:zlib_client'
```
(This essentially leaves that flag unusable in any repository that uses http_archive, which is probably most of them).

Fix patch:
diff --git a/.bazelversion b/.bazelversion
index f3b5af39e4..6abaeb2f90 100644
--- a/.bazelversion
+++ b/.bazelversion
@@ -1,1 +1,1 @@
-6.1.1
+6.2.0
diff --git a/external.bzl b/external.bzl
index 3baf770a38..577d101207 100644
--- a/external.bzl
+++ b/external.bzl
@@ -1137,13 +1137,14 @@ def _go_dependencies():
     )
     http_archive(
         name = "org_golang_x_tools",
-        # v0.1.12, latest as of 2022-09-10
+        # Must be kept in sync with rules_go or the patches may fail.
+        # v0.7.0, latest as of 2023-03-27
         urls = [
-            "https://mirror.bazel.build/github.com/golang/tools/archive/refs/tags/v0.1.12.zip",
-            "https://github.com/golang/tools/archive/refs/tags/v0.1.12.zip",
+            "https://mirror.bazel.build/github.com/golang/tools/archive/refs/tags/v0.7.0.zip",
+            "https://github.com/golang/tools/archive/refs/tags/v0.7.0.zip",
         ],
-        sha256 = "4e3d94e7bf8dde5dad681c5ddddda6e634f8c8c500683fdf3d2f77a9c086702d",
-        strip_prefix = "tools-0.1.12",
+        sha256 = "9f20a20f29f4008d797a8be882ef82b69cf8f7f2b96dbdfe3814c57d8280fa4b",
+        strip_prefix = "tools-0.7.0",
         patches = [
             "@io_kythe//third_party/go:add_export_license.patch",
             # deletegopls removes the gopls subdirectory. It contains a nested
diff --git a/setup.bzl b/setup.bzl
index 8fde26cbb5..0989eb556a 100644
--- a/setup.bzl
+++ b/setup.bzl
@@ -37,10 +37,10 @@ def kythe_rule_repositories():
     maybe(
         http_archive,
         name = "io_bazel_rules_go",
-        sha256 = "ae013bf35bd23234d1dea46b079f1e05ba74ac0321423830119d3e787ec73483",
+        sha256 = "6dc2da7ab4cf5d7bfc7c949776b1b7c733f05e56edc4bcd9022bb249d2e2a996",
         urls = [
-            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.36.0/rules_go-v0.36.0.zip",
-            "https://github.com/bazelbuild/rules_go/releases/download/v0.36.0/rules_go-v0.36.0.zip",
+            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
+            "https://github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
         ],
     )
 
@@ -90,9 +90,9 @@ def kythe_rule_repositories():
     maybe(
         http_archive,
         name = "rules_jvm_external",
-        sha256 = "8c3b207722e5f97f1c83311582a6c11df99226e65e2471086e296561e57cc954",
-        strip_prefix = "rules_jvm_external-5.1",
-        urls = ["https://github.com/bazelbuild/rules_jvm_external/releases/download/5.1/rules_jvm_external-5.1.tar.gz"],
+        sha256 = "f86fd42a809e1871ca0aabe89db0d440451219c3ce46c58da240c7dcdc00125f",
+        strip_prefix = "rules_jvm_external-5.2",
+        urls = ["https://github.com/bazelbuild/rules_jvm_external/releases/download/5.2/rules_jvm_external-5.2.tar.gz"],
     )
 
     maybe(
diff --git a/version.bzl b/version.bzl
index 86ca76e81d..656cc06224 100644
--- a/version.bzl
+++ b/version.bzl
@@ -2,7 +2,7 @@
 MIN_VERSION = "6.0.0"
 
 # Maximum supported Bazel version.  Should match .bazelversion file.
-MAX_VERSION = "6.1.1"
+MAX_VERSION = "6.2.0"
 
 def _tuplicate(value, delim):
     rv = ()


Test patch: