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

[bzlmod] kt_jvm_export cannot resolve @io_bazel_rules_kotlin_configured #1030

Open
ydynnikov opened this issue Jan 10, 2024 · 0 comments
Open

Comments

@ydynnikov
Copy link

I have following setup in my MODULE.bazel:

bazel_dep(name = "rules_kotlin", version = "1.9.0")
bazel_dep(name = "rules_jvm_external", version = "5.3")

Then in my BUILD.bazel I'm trying to use kt_jvm_export:

load("@rules_jvm_external//:kt_defs.bzl", "kt_jvm_export")


kt_jvm_export(
    name = "somepackage-lib",
    srcs = glob(["**/*.kt"]),
    deps = [
        "//:kotlin_serialization",
    ],
    visibility = ["//kt:__subpackages__"],
  maven_coordinates = "com.some.package:13",
)

I would expect it to work, but I get a following:

ERROR: error loading package 'kt/com/scorewarrior/kimmpack/main': at /home/morodeer/.cache/bazel/_bazel_morodeer/3332918fcb8a999028cbf59416624409/external/rules_jvm_external~5.3/kt_defs.bzl:19:6: at /home/morodeer/.cache/bazel/_bazel_morodeer/3332918fcb8a999028cbf59416624409/external/rules_jvm_external~5.3/private/rules/kt_jvm_export.bzl:1:6: at /home/morodeer/.cache/bazel/_bazel_morodeer/3332918fcb8a999028cbf59416624409/external/rules_jvm_external~5.3~non_module_deps~io_bazel_rules_kotlin/kotlin/jvm.bzl:9:5: at /home/morodeer/.cache/bazel/_bazel_morodeer/3332918fcb8a999028cbf59416624409/external/rules_jvm_external~5.3~non_module_deps~io_bazel_rules_kotlin/kotlin/internal/opts.bzl:22:5: Unable to find package for @@[unknown repo 'io_bazel_rules_kotlin_configured' requested from @@rules_jvm_external~5.3~non_module_deps~io_bazel_rules_kotlin]//jvm:opts.bzl: The repository '@@[unknown repo 'io_bazel_rules_kotlin_configured' requested from @@rules_jvm_external~5.3~non_module_deps~io_bazel_rules_kotlin]' could not be resolved: No repository visible as '@io_bazel_rules_kotlin_configured' from repository '@@rules_jvm_external~5.3~non_module_deps~io_bazel_rules_kotlin'.

I tried to mix bzlmod declaration with traditional declaration through calling kotlin_repositories() in WORKSPACE, but I get into some cyclic dependency I couldn't resolve

Are there any steps I miss?

bazel version: 7.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant