Use relative instead of absolute labels when referring to targets within rules_kotlin.

PiperOrigin-RevId: 472799742
diff --git a/bazel/BUILD b/bazel/BUILD
index afb123a..e10757f 100644
--- a/bazel/BUILD
+++ b/bazel/BUILD
@@ -14,7 +14,7 @@
 
 licenses(["notice"])  # Apache 2.0
 
-package(default_visibility = ["@//:internal"])
+package(default_visibility = ["//:internal"])
 
 java_library(
     name = "auto_service",
diff --git a/kotlin/common.bzl b/kotlin/common.bzl
index 2ac9254..3ffc660 100644
--- a/kotlin/common.bzl
+++ b/kotlin/common.bzl
@@ -16,8 +16,8 @@
 
 load("@bazel_skylib//lib:sets.bzl", "sets")
 load("@bazel_skylib//lib:structs.bzl", "structs")
-load("@//bazel:stubs.bzl", "BASE_JVMOPTS")
-load("@//bazel:stubs.bzl", "DEFAULT_BUILTIN_PROCESSORS")
+load("//bazel:stubs.bzl", "BASE_JVMOPTS")
+load("//bazel:stubs.bzl", "DEFAULT_BUILTIN_PROCESSORS")
 
 # TODO: Remove the _ALLOWED_*_RULES lists to determine which rules
 # are accepted dependencies to Kotlin rules as the approach does not scale
@@ -90,7 +90,7 @@
 # Compute module name based on target (b/139403883), similar to Swift
 def _derive_module_name(ctx):
     label = _get_original_kt_target_label(ctx)
-    package_part = label.package.replace("/", ".")  # .package has no leading //
+    package_part = label.package.replace("/", ".")  # .package has no leading '//'
     name_part = label.name
     if package_part:
         return package_part + "_" + name_part
diff --git a/kotlin/forbidden_deps.bzl b/kotlin/forbidden_deps.bzl
index 97c032e..67a04fb 100644
--- a/kotlin/forbidden_deps.bzl
+++ b/kotlin/forbidden_deps.bzl
@@ -21,7 +21,7 @@
 """
 
 load("@bazel_skylib//lib:sets.bzl", "sets")
-load("@//bazel:stubs.bzl", "EXEMPT_DEPS", "FORBIDDEN_DEP_PACKAGES")
+load("//bazel:stubs.bzl", "EXEMPT_DEPS", "FORBIDDEN_DEP_PACKAGES")
 
 def _error(target, msg):
     return (str(target.label), msg)
diff --git a/kotlin/jvm_import.bzl b/kotlin/jvm_import.bzl
index aa5a8c9..ed740ca 100644
--- a/kotlin/jvm_import.bzl
+++ b/kotlin/jvm_import.bzl
@@ -16,8 +16,8 @@
 
 load(":common.bzl", "common")
 load(":traverse_exports.bzl", "kt_traverse_exports")
-load("@//toolchains/kotlin_jvm:kt_jvm_toolchains.bzl", "kt_jvm_toolchains")
-load("@//toolchains/kotlin_jvm:java_toolchains.bzl", "java_toolchains")
+load("//toolchains/kotlin_jvm:kt_jvm_toolchains.bzl", "kt_jvm_toolchains")
+load("//toolchains/kotlin_jvm:java_toolchains.bzl", "java_toolchains")
 load("@bazel_skylib//lib:dicts.bzl", "dicts")
 load(":compiler_plugin.bzl", "KtCompilerPluginInfo")
 
diff --git a/kotlin/jvm_library.bzl b/kotlin/jvm_library.bzl
index fd96a69..f2ffe09 100644
--- a/kotlin/jvm_library.bzl
+++ b/kotlin/jvm_library.bzl
@@ -15,7 +15,7 @@
 """Kotlin kt_jvm_library rule."""
 
 load(":jvm_library.internal.bzl", "kt_jvm_library_helper")
-load("@//bazel:stubs.bzl", "register_extension_info")
+load("//bazel:stubs.bzl", "register_extension_info")
 
 def kt_jvm_library(
         name,
@@ -30,7 +30,7 @@
         exported_plugins = None,
         resources = None,
         tags = None,
-        testonly = None,  # None to not override Blaze's default for //javatests, b/112708042
+        testonly = None,  # None to preserve Blaze's defaults, b/112708042
         javacopts = None,
         custom_kotlincopts = None,
         disable_lint_checks = None,
diff --git a/kotlin/jvm_library.internal.bzl b/kotlin/jvm_library.internal.bzl
index b653e7b..c44f056 100644
--- a/kotlin/jvm_library.internal.bzl
+++ b/kotlin/jvm_library.internal.bzl
@@ -14,9 +14,9 @@
 
 """Kotlin kt_jvm_library rule."""
 
-load("@//kotlin:compiler_opt.bzl", "kotlincopts_attrs", "merge_kotlincopts")
-load("@//toolchains/kotlin_jvm:java_toolchains.bzl", "java_toolchains")
-load("@//toolchains/kotlin_jvm:kt_jvm_toolchains.bzl", "kt_jvm_toolchains")
+load("//kotlin:compiler_opt.bzl", "kotlincopts_attrs", "merge_kotlincopts")
+load("//toolchains/kotlin_jvm:java_toolchains.bzl", "java_toolchains")
+load("//toolchains/kotlin_jvm:kt_jvm_toolchains.bzl", "kt_jvm_toolchains")
 load("@bazel_skylib//lib:dicts.bzl", "dicts")
 load(":common.bzl", "common")
 load(":compiler_plugin.bzl", "KtCompilerPluginInfo")
@@ -231,8 +231,6 @@
             [JavaInfo],
         ],
         cfg = "exec",
-        doc = """Additional Android Lint checks to run at compile-time.  Checks must use
-                     //java/com/google/android/tools/lint/registration to work.""",
     ),
 )
 
diff --git a/kotlin/jvm_test.bzl b/kotlin/jvm_test.bzl
index b721458..b7270e2 100644
--- a/kotlin/jvm_test.bzl
+++ b/kotlin/jvm_test.bzl
@@ -15,7 +15,7 @@
 """Kotlin macro for building and running tests on a JVM."""
 
 load(":jvm_library.bzl", "kt_jvm_library")
-load("@//bazel:stubs.bzl", "register_extension_info")
+load("//bazel:stubs.bzl", "register_extension_info")
 
 def _lib_name(name):
     return "%s_DO_NOT_DEPEND_LIB" % name
diff --git a/kotlin/rules.bzl b/kotlin/rules.bzl
index 63fd9df..8d0188b 100644
--- a/kotlin/rules.bzl
+++ b/kotlin/rules.bzl
@@ -14,9 +14,9 @@
 
 """Kotlin rules."""
 
-load("@//kotlin:jvm_import.bzl", _kt_jvm_import = "kt_jvm_import")
-load("@//kotlin:jvm_library.bzl", _kt_jvm_library = "kt_jvm_library")
-load("@//kotlin:jvm_test.bzl", _kt_jvm_test = "kt_jvm_test")
+load("//kotlin:jvm_import.bzl", _kt_jvm_import = "kt_jvm_import")
+load("//kotlin:jvm_library.bzl", _kt_jvm_library = "kt_jvm_library")
+load("//kotlin:jvm_test.bzl", _kt_jvm_test = "kt_jvm_test")
 
 kt_jvm_import = _kt_jvm_import
 
diff --git a/tests/analysis/BUILD b/tests/analysis/BUILD
index 8a440af..b927805 100644
--- a/tests/analysis/BUILD
+++ b/tests/analysis/BUILD
@@ -14,9 +14,9 @@
 
 # Analysis Tests
 
-load("@//tests/analysis:jvm_compile_test.bzl", jvm_compile_test_suite = "test_suite")
-load("@//tests/analysis:jvm_import_test.bzl", jvm_import_test_suite = "test_suite")
-load("@//tests/analysis:jvm_library_test.bzl", jvm_library_test_suite = "test_suite")
+load("//tests/analysis:jvm_compile_test.bzl", jvm_compile_test_suite = "test_suite")
+load("//tests/analysis:jvm_import_test.bzl", jvm_import_test_suite = "test_suite")
+load("//tests/analysis:jvm_library_test.bzl", jvm_library_test_suite = "test_suite")
 
 licenses(["notice"])
 
diff --git a/tests/analysis/compiler_plugin/BUILD b/tests/analysis/compiler_plugin/BUILD
index c3bad7d..0c1f9b6 100644
--- a/tests/analysis/compiler_plugin/BUILD
+++ b/tests/analysis/compiler_plugin/BUILD
@@ -19,5 +19,5 @@
     outs = ["empty.jar"],
     cmd = """$(location @bazel_tools//tools/zip:zipper) c $@ "assets/_empty=" """,
     tools = ["@bazel_tools//tools/zip:zipper"],
-    visibility = ["@//tests/analysis/compiler_plugin:__subpackages__"],
+    visibility = ["//tests/analysis/compiler_plugin:__subpackages__"],
 )
diff --git a/tests/analysis/compiler_plugin/forbidden_target/BUILD b/tests/analysis/compiler_plugin/forbidden_target/BUILD
index 282aab9..9f751fa 100644
--- a/tests/analysis/compiler_plugin/forbidden_target/BUILD
+++ b/tests/analysis/compiler_plugin/forbidden_target/BUILD
@@ -12,8 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:compiler_plugin.bzl", "kt_compiler_plugin")
-load("@//tests/analysis:assert_failure_test.bzl", "assert_failure_test")
-load("@//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS")
+load("//kotlin:compiler_plugin.bzl", "kt_compiler_plugin")
+load("//tests/analysis:assert_failure_test.bzl", "assert_failure_test")
+load("//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS")
 
 licenses(["notice"])
diff --git a/tests/analysis/compiler_plugin/propagation/BUILD b/tests/analysis/compiler_plugin/propagation/BUILD
index bf1896e..0c6fe19 100644
--- a/tests/analysis/compiler_plugin/propagation/BUILD
+++ b/tests/analysis/compiler_plugin/propagation/BUILD
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:compiler_plugin.bzl", "kt_compiler_plugin")
+load("//kotlin:compiler_plugin.bzl", "kt_compiler_plugin")
 load(":assert_propagation_test.bzl", "assert_propagation_test")
 
 licenses(["notice"])
@@ -62,18 +62,18 @@
 
 kt_compiler_plugin(
     name = "1",
-    jar = "@//tests/analysis/compiler_plugin:empty_jar",
+    jar = "//tests/analysis/compiler_plugin:empty_jar",
     plugin_id = "1",
 )
 
 kt_compiler_plugin(
     name = "2",
-    jar = "@//tests/analysis/compiler_plugin:empty_jar",
+    jar = "//tests/analysis/compiler_plugin:empty_jar",
     plugin_id = "2",
 )
 
 kt_compiler_plugin(
     name = "3",
-    jar = "@//tests/analysis/compiler_plugin:empty_jar",
+    jar = "//tests/analysis/compiler_plugin:empty_jar",
     plugin_id = "3",
 )
diff --git a/tests/analysis/compiler_plugin/propagation/assert_propagation_test.bzl b/tests/analysis/compiler_plugin/propagation/assert_propagation_test.bzl
index 7fb0ff2..fe8c9dc 100644
--- a/tests/analysis/compiler_plugin/propagation/assert_propagation_test.bzl
+++ b/tests/analysis/compiler_plugin/propagation/assert_propagation_test.bzl
@@ -16,7 +16,7 @@
 
 load("@bazel_skylib//lib:sets.bzl", "sets")
 load("@bazel_skylib//rules:build_test.bzl", "build_test")
-load("@//kotlin:traverse_exports.bzl", "kt_traverse_exports")
+load("//kotlin:traverse_exports.bzl", "kt_traverse_exports")
 
 def _assert_propagation_impl(ctx):
     expected_ids = sets.make(ctx.attr.expected_plugin_ids)
@@ -45,7 +45,7 @@
         deps = attr.label_list(aspects = [kt_traverse_exports.aspect]),
         _empty_jar = attr.label(
             allow_single_file = True,
-            default = "@//tests/analysis/compiler_plugin:empty_jar",
+            default = "//tests/analysis/compiler_plugin:empty_jar",
         ),
     ),
 )
diff --git a/tests/analysis/compiler_plugin/provider_ctor/BUILD b/tests/analysis/compiler_plugin/provider_ctor/BUILD
index eed998a..fb5acbc 100644
--- a/tests/analysis/compiler_plugin/provider_ctor/BUILD
+++ b/tests/analysis/compiler_plugin/provider_ctor/BUILD
@@ -12,8 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//tests/analysis:assert_failure_test.bzl", "assert_failure_test")
-load("@//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS")
+load("//tests/analysis:assert_failure_test.bzl", "assert_failure_test")
+load("//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS")
 load(":fake_compiler_plugin.bzl", "kt_fake_compiler_plugin")
 
 licenses(["notice"])
diff --git a/tests/analysis/compiler_plugin/provider_ctor/fake_compiler_plugin.bzl b/tests/analysis/compiler_plugin/provider_ctor/fake_compiler_plugin.bzl
index 62136ff..d4a6bac 100644
--- a/tests/analysis/compiler_plugin/provider_ctor/fake_compiler_plugin.bzl
+++ b/tests/analysis/compiler_plugin/provider_ctor/fake_compiler_plugin.bzl
@@ -14,7 +14,7 @@
 
 """A fake impl of kt_compiler_plugin."""
 
-load("@//kotlin:compiler_plugin.bzl", "KtCompilerPluginInfo")
+load("//kotlin:compiler_plugin.bzl", "KtCompilerPluginInfo")
 
 def _kt_fake_compiler_plugin_impl(ctx):
     return [
@@ -30,7 +30,7 @@
     attrs = dict(
         _jar = attr.label(
             allow_single_file = True,
-            default = "@//tests/analysis/compiler_plugin:empty_jar",
+            default = "//tests/analysis/compiler_plugin:empty_jar",
         ),
     ),
     provides = [KtCompilerPluginInfo],
diff --git a/tests/analysis/compiler_plugin/provider_output/BUILD b/tests/analysis/compiler_plugin/provider_output/BUILD
index 9dd3c5c..4769965 100644
--- a/tests/analysis/compiler_plugin/provider_output/BUILD
+++ b/tests/analysis/compiler_plugin/provider_output/BUILD
@@ -12,8 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:compiler_plugin.bzl", "kt_compiler_plugin")
-load("@//tests/analysis:util.bzl", "create_file")
+load("//kotlin:compiler_plugin.bzl", "kt_compiler_plugin")
+load("//tests/analysis:util.bzl", "create_file")
 load("@bazel_skylib//rules:build_test.bzl", "build_test")
 load(":assert_compiler_plugin_test.bzl", "assert_compiler_plugin_test")
 
@@ -25,7 +25,7 @@
         "plugin:com.google.example:key=value",
     ],
     expected_id = "com.google.example",
-    expected_jar = "@//tests/analysis/compiler_plugin:empty_jar",
+    expected_jar = "//tests/analysis/compiler_plugin:empty_jar",
     target_under_test = ":example_plugin",
 )
 
@@ -53,6 +53,6 @@
     args = {
         "key": "value",
     },
-    jar = "@//tests/analysis/compiler_plugin:empty_jar",
+    jar = "//tests/analysis/compiler_plugin:empty_jar",
     plugin_id = "com.google.example",
 )
diff --git a/tests/analysis/compiler_plugin/provider_output/assert_compiler_plugin_test.bzl b/tests/analysis/compiler_plugin/provider_output/assert_compiler_plugin_test.bzl
index afe3577..9b2951e 100644
--- a/tests/analysis/compiler_plugin/provider_output/assert_compiler_plugin_test.bzl
+++ b/tests/analysis/compiler_plugin/provider_output/assert_compiler_plugin_test.bzl
@@ -14,7 +14,7 @@
 
 """An assertion on kt_compiler_plugin analysis."""
 
-load("@//kotlin:compiler_plugin.bzl", "KtCompilerPluginInfo")
+load("//kotlin:compiler_plugin.bzl", "KtCompilerPluginInfo")
 load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
 
 def _test_impl(ctx):
diff --git a/tests/analysis/jvm_compile_test.bzl b/tests/analysis/jvm_compile_test.bzl
index 1d8a95c..b361f5a 100644
--- a/tests/analysis/jvm_compile_test.bzl
+++ b/tests/analysis/jvm_compile_test.bzl
@@ -14,12 +14,12 @@
 
 """Kotlin kt_jvm_compile API test."""
 
-load("@//kotlin:traverse_exports.bzl", "kt_traverse_exports")
-load("@//kotlin:jvm_compile.bzl", "kt_jvm_compile")
-load("@//kotlin:common.bzl", "common")
-load("@//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS", "create_dir", "create_file")
-load("@//toolchains/kotlin_jvm:java_toolchains.bzl", "java_toolchains")
-load("@//toolchains/kotlin_jvm:kt_jvm_toolchains.bzl", "kt_jvm_toolchains")
+load("//kotlin:traverse_exports.bzl", "kt_traverse_exports")
+load("//kotlin:jvm_compile.bzl", "kt_jvm_compile")
+load("//kotlin:common.bzl", "common")
+load("//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS", "create_dir", "create_file")
+load("//toolchains/kotlin_jvm:java_toolchains.bzl", "java_toolchains")
+load("//toolchains/kotlin_jvm:kt_jvm_toolchains.bzl", "kt_jvm_toolchains")
 load("@bazel_skylib//rules:build_test.bzl", "build_test")
 load(":assert_failure_test.bzl", "assert_failure_test")
 
diff --git a/tests/analysis/jvm_import_test.bzl b/tests/analysis/jvm_import_test.bzl
index 0f791b6..a3bfd19 100644
--- a/tests/analysis/jvm_import_test.bzl
+++ b/tests/analysis/jvm_import_test.bzl
@@ -14,10 +14,10 @@
 
 """Kotlin kt_jvm_import rule tests."""
 
-load("@//kotlin:jvm_import.bzl", "kt_jvm_import")
-load("@//kotlin:jvm_library.bzl", "kt_jvm_library")
+load("//kotlin:jvm_import.bzl", "kt_jvm_import")
+load("//kotlin:jvm_library.bzl", "kt_jvm_library")
 load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
-load("@//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS", "create_file")
+load("//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS", "create_file")
 load(":assert_failure_test.bzl", "assert_failure_test")
 
 def _impl(ctx):
diff --git a/tests/analysis/jvm_library/friends/BUILD b/tests/analysis/jvm_library/friends/BUILD
index b526aaa..3c4a7db 100644
--- a/tests/analysis/jvm_library/friends/BUILD
+++ b/tests/analysis/jvm_library/friends/BUILD
@@ -12,13 +12,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:rules.bzl", "kt_jvm_library")
-load("@//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
-load("@//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS")
+load("//kotlin:rules.bzl", "kt_jvm_library")
+load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
+load("//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS")
 
 package(
     default_testonly = True,
-    default_visibility = ["@//tests/analysis/jvm_library/friends:__subpackages__"],
+    default_visibility = ["//tests/analysis/jvm_library/friends:__subpackages__"],
 )
 
 licenses(["notice"])
@@ -35,7 +35,7 @@
     tags = ONLY_FOR_ANALYSIS_TEST_TAGS,
     deps = [
         # Exports :friend from this package
-        "@//tests/analysis/jvm_library/friends/sub:kt_exports_friend",
+        "//tests/analysis/jvm_library/friends/sub:kt_exports_friend",
     ],
 )
 
diff --git a/tests/analysis/jvm_library/friends/sub/BUILD b/tests/analysis/jvm_library/friends/sub/BUILD
index 72ee89c..7c26e59 100644
--- a/tests/analysis/jvm_library/friends/sub/BUILD
+++ b/tests/analysis/jvm_library/friends/sub/BUILD
@@ -12,13 +12,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:rules.bzl", "kt_jvm_library")
-load("@//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
-load("@//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS")
+load("//kotlin:rules.bzl", "kt_jvm_library")
+load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
+load("//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS")
 
 package(
     default_testonly = True,
-    default_visibility = ["@//tests/analysis/jvm_library/friends:__subpackages__"],
+    default_visibility = ["//tests/analysis/jvm_library/friends:__subpackages__"],
 )
 
 licenses(["notice"])
@@ -43,7 +43,7 @@
     name = "kt_exports_friend",
     srcs = ["Input.kt"],
     tags = ONLY_FOR_ANALYSIS_TEST_TAGS,
-    exports = ["@//tests/analysis/jvm_library/friends:friend"],
+    exports = ["//tests/analysis/jvm_library/friends:friend"],
 )
 
 jvm_library_test(
@@ -56,5 +56,5 @@
     name = "no_direct_friend_cross_package",
     srcs = ["Input.kt"],
     tags = ONLY_FOR_ANALYSIS_TEST_TAGS,
-    deps = ["@//tests/analysis/jvm_library/friends:friend"],
+    deps = ["//tests/analysis/jvm_library/friends:friend"],
 )
diff --git a/tests/analysis/jvm_library_test.bzl b/tests/analysis/jvm_library_test.bzl
index 24477c8..fba0d7a 100644
--- a/tests/analysis/jvm_library_test.bzl
+++ b/tests/analysis/jvm_library_test.bzl
@@ -14,8 +14,8 @@
 
 """Kotlin kt_jvm_library rule tests."""
 
-load("@//kotlin:jvm_library.bzl", "kt_jvm_library")
-load("@//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS", "create_file", "get_action_arg")
+load("//kotlin:jvm_library.bzl", "kt_jvm_library")
+load("//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS", "create_file", "get_action_arg")
 load("@bazel_skylib//lib:sets.bzl", "sets")
 load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
 load(":assert_failure_test.bzl", "assert_failure_test")
@@ -415,7 +415,7 @@
             test_name + "/Salutations.kt",
         ],
         # Need a working plugin so it can run for the test.
-        plugins = ["@//bazel:auto_value_plugin"],
+        plugins = ["//bazel:auto_value_plugin"],
     )
 
     _test(
@@ -752,7 +752,7 @@
             "nobuilder",
         ],
     )
-    tut_label = str(Label("@//tests/analysis:kt_jvm_library_with_no_sources_test_tut"))
+    tut_label = str(Label("//tests/analysis:kt_jvm_library_with_no_sources_test_tut"))
     assert_failure_test(
         name = test_name,
         target_under_test = test_name + "_tut",
diff --git a/tests/jvm/java/beer/BUILD b/tests/jvm/java/beer/BUILD
index 57a63fb..9a50474 100644
--- a/tests/jvm/java/beer/BUILD
+++ b/tests/jvm/java/beer/BUILD
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:rules.bzl", "kt_jvm_library", "kt_jvm_test")
+load("//kotlin:rules.bzl", "kt_jvm_library", "kt_jvm_test")
 
 licenses(["notice"])
 
diff --git a/tests/jvm/java/functions/BUILD b/tests/jvm/java/functions/BUILD
index c2b3b32..aa571fe 100644
--- a/tests/jvm/java/functions/BUILD
+++ b/tests/jvm/java/functions/BUILD
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # This package tests importing extension functions.
-load("@//kotlin:rules.bzl", "kt_jvm_import", "kt_jvm_library")
+load("//kotlin:rules.bzl", "kt_jvm_import", "kt_jvm_library")
 
 licenses(["notice"])
 
@@ -21,7 +21,7 @@
     name = "car_demo_src_lib",
     srcs = ["CarDemo.kt"],
     deps = [
-        "@//tests/jvm/java/functions/car:car_lib",
+        "//tests/jvm/java/functions/car:car_lib",
     ],
 )
 
@@ -37,7 +37,7 @@
 
 java_import(
     name = "car-jar",
-    jars = ["@//tests/jvm/java/functions/car:car_lib-jar"],
+    jars = ["//tests/jvm/java/functions/car:car_lib-jar"],
 )
 
 kt_jvm_library(
@@ -63,8 +63,8 @@
 kt_jvm_import(
     name = "car-inline-jar",
     jars = [
-        "@//tests/jvm/java/functions/car:car_inline_lib-jar",
-        "@//tests/jvm/java/functions/car:car_extra_lib-jar",
+        "//tests/jvm/java/functions/car:car_inline_lib-jar",
+        "//tests/jvm/java/functions/car:car_extra_lib-jar",
     ],
     deps = [
         ":car-jar",
diff --git a/tests/jvm/java/functions/car/BUILD b/tests/jvm/java/functions/car/BUILD
index f49d6be..81f0f43 100644
--- a/tests/jvm/java/functions/car/BUILD
+++ b/tests/jvm/java/functions/car/BUILD
@@ -12,9 +12,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:rules.bzl", "kt_jvm_library")
+load("//kotlin:rules.bzl", "kt_jvm_library")
 
-package(default_visibility = ["@//tests/jvm/java/functions:__subpackages__"])
+package(default_visibility = ["//tests/jvm/java/functions:__subpackages__"])
 
 licenses(["notice"])
 
diff --git a/tests/jvm/java/ijar/BUILD b/tests/jvm/java/ijar/BUILD
index 652c154..d742e75 100644
--- a/tests/jvm/java/ijar/BUILD
+++ b/tests/jvm/java/ijar/BUILD
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:rules.bzl", "kt_jvm_library")
+load("//kotlin:rules.bzl", "kt_jvm_library")
 
 licenses(["notice"])
 
diff --git a/tests/jvm/java/internal/BUILD b/tests/jvm/java/internal/BUILD
index 6e1113d..7bf2d8e 100644
--- a/tests/jvm/java/internal/BUILD
+++ b/tests/jvm/java/internal/BUILD
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:rules.bzl", "kt_jvm_library", "kt_jvm_test")
+load("//kotlin:rules.bzl", "kt_jvm_library", "kt_jvm_test")
 
 licenses(["notice"])
 
diff --git a/tests/jvm/java/jni/BUILD b/tests/jvm/java/jni/BUILD
index 2ea3e80..7225ef1 100644
--- a/tests/jvm/java/jni/BUILD
+++ b/tests/jvm/java/jni/BUILD
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 load(
-    "@//kotlin:rules.bzl",
+    "//kotlin:rules.bzl",
     "kt_jvm_library",
     "kt_jvm_test",
 )
@@ -25,7 +25,7 @@
 kt_jvm_library(
     name = "NativeApiKt",
     srcs = ["NativeApi.kt"],
-    visibility = ["@//tests:__subpackages__"],
+    visibility = ["//tests:__subpackages__"],
     runtime_deps = [":jni_NativeApi"],
 )
 
diff --git a/tests/jvm/java/junit/BUILD b/tests/jvm/java/junit/BUILD
index 42566f3..af26b52 100644
--- a/tests/jvm/java/junit/BUILD
+++ b/tests/jvm/java/junit/BUILD
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:rules.bzl", "kt_jvm_library", "kt_jvm_test")
+load("//kotlin:rules.bzl", "kt_jvm_library", "kt_jvm_test")
 
 package(default_testonly = 1)
 
diff --git a/tests/jvm/java/kapt/BUILD b/tests/jvm/java/kapt/BUILD
index 3593a55..43b893d 100644
--- a/tests/jvm/java/kapt/BUILD
+++ b/tests/jvm/java/kapt/BUILD
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 load(
-    "@//kotlin:rules.bzl",
+    "//kotlin:rules.bzl",
     "kt_jvm_library",
     "kt_jvm_test",
 )
@@ -169,7 +169,7 @@
     srcs = ["AP.java"],
     deps = [
         ":anno",
-        "@//bazel:auto_service",
+        "//bazel:auto_service",
     ],
 )
 
@@ -185,7 +185,7 @@
     name = "ignored_failing_processor",
     srcs = ["FailingProcessor.java"],
     deps = [
-        "@//bazel:auto_service",
+        "//bazel:auto_service",
     ],
 )
 
@@ -223,7 +223,7 @@
         "ProcessorWithData.kt",
     ],
     deps = [
-        "@//bazel:auto_service",
+        "//bazel:auto_service",
     ],
 )
 
@@ -243,7 +243,7 @@
     name = "generates_services",
     srcs = ["GeneratesServices.kt"],
     deps = [
-        "@//bazel:auto_service",
+        "//bazel:auto_service",
     ],
 )
 
diff --git a/tests/jvm/java/metasyntactic/BUILD b/tests/jvm/java/metasyntactic/BUILD
index a5447f6..6ee26a9 100644
--- a/tests/jvm/java/metasyntactic/BUILD
+++ b/tests/jvm/java/metasyntactic/BUILD
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:rules.bzl", "kt_jvm_library", "kt_jvm_test")
+load("//kotlin:rules.bzl", "kt_jvm_library", "kt_jvm_test")
 
 licenses(["notice"])
 
diff --git a/tests/jvm/java/mockito/BUILD b/tests/jvm/java/mockito/BUILD
index a60308f..ade78c9 100644
--- a/tests/jvm/java/mockito/BUILD
+++ b/tests/jvm/java/mockito/BUILD
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:rules.bzl", "kt_jvm_test")
+load("//kotlin:rules.bzl", "kt_jvm_test")
 
 package(default_testonly = 1)
 
diff --git a/tests/jvm/java/multijarimport/BUILD b/tests/jvm/java/multijarimport/BUILD
index 1f26e73..d3e6057 100644
--- a/tests/jvm/java/multijarimport/BUILD
+++ b/tests/jvm/java/multijarimport/BUILD
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:rules.bzl", "kt_jvm_import", "kt_jvm_library")
+load("//kotlin:rules.bzl", "kt_jvm_import", "kt_jvm_library")
 
 package(
     default_testonly = 1,
diff --git a/tests/jvm/java/srcartifacts/BUILD b/tests/jvm/java/srcartifacts/BUILD
index 7282e8a..4236672 100644
--- a/tests/jvm/java/srcartifacts/BUILD
+++ b/tests/jvm/java/srcartifacts/BUILD
@@ -12,8 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@//kotlin:rules.bzl", "kt_jvm_library", "kt_jvm_test")
-load("@//tests/analysis:util.bzl", "create_dir", "create_file")
+load("//kotlin:rules.bzl", "kt_jvm_library", "kt_jvm_test")
+load("//tests/analysis:util.bzl", "create_dir", "create_file")
 load("@bazel_skylib//rules:build_test.bzl", "build_test")
 
 package(default_testonly = 1)
diff --git a/toolchains/kotlin_jvm/BUILD b/toolchains/kotlin_jvm/BUILD
index c66bb77..587d3a9 100644
--- a/toolchains/kotlin_jvm/BUILD
+++ b/toolchains/kotlin_jvm/BUILD
@@ -19,7 +19,7 @@
 
 licenses(["notice"])
 
-package(default_visibility = ["@//:internal"])
+package(default_visibility = ["//:internal"])
 
 toolchain_type(name = kt_jvm_toolchains.name)
 
diff --git a/toolchains/kotlin_jvm/kt_jvm_toolchains.bzl b/toolchains/kotlin_jvm/kt_jvm_toolchains.bzl
index f0f68fb..0b9c610 100644
--- a/toolchains/kotlin_jvm/kt_jvm_toolchains.bzl
+++ b/toolchains/kotlin_jvm/kt_jvm_toolchains.bzl
@@ -22,7 +22,7 @@
 KT_LANG_VERSION = "1.7"
 
 # Kotlin JVM toolchain type label
-_TYPE = Label("@//toolchains/kotlin_jvm:kt_jvm_toolchain_type")
+_TYPE = Label("//toolchains/kotlin_jvm:kt_jvm_toolchain_type")
 
 def _kotlinc_common_flags(ctx, other_flags):
     """Returns kotlinc flags to use in all compilations."""
@@ -125,11 +125,11 @@
     name = "kt_jvm_toolchain",
     attrs = dict(
         build_marker = attr.label(
-            default = "@//tools:build_marker",
+            default = "//tools:build_marker",
             allow_single_file = [".jar"],
         ),
         coverage_instrumenter = attr.label(
-            default = "@//tools/coverage:offline_instrument",
+            default = "//tools/coverage:offline_instrument",
             cfg = "exec",
             executable = True,
         ),
@@ -244,7 +244,7 @@
     _toolchain = attr.label(
         # TODO: Delete this attr when fixed.
         doc = "Magic attribute name for DexArchiveAspect (b/78647825)",
-        default = "@//toolchains/kotlin_jvm:kt_jvm_toolchain_impl",
+        default = "//toolchains/kotlin_jvm:kt_jvm_toolchain_impl",
     ),
 )
 
diff --git a/tools/BUILD b/tools/BUILD
index 06482da..18f1a9a 100644
--- a/tools/BUILD
+++ b/tools/BUILD
@@ -16,7 +16,7 @@
 
 licenses(["notice"])
 
-package(default_visibility = ["@//:internal"])
+package(default_visibility = ["//:internal"])
 
 # JAR that contains a marker entry, for identifying apps built by rules_kotlin.
 genrule(
diff --git a/tools/coverage/BUILD b/tools/coverage/BUILD
index 2056248..e97ac5d 100644
--- a/tools/coverage/BUILD
+++ b/tools/coverage/BUILD
@@ -18,10 +18,10 @@
     name = "offline_instrument",
     srcs = ["bazel_jar_instrumenter.sh"],
     data = [
-        "@//bazel:jacoco_cli",
+        "//bazel:jacoco_cli",
         "@bazel_tools//tools/jdk:jar",
     ],
     visibility = [
-        "@//:internal",
+        "//:internal",
     ],
 )