Pratik Tandel
10/24/2021, 4:48 PMrules_kotlin
for many folks. it’d be great if we could unblock it so teams can upgrade to kotlin 1.5
https://github.com/bazelbuild/rules_kotlinMarc Plano-Lesay
10/24/2021, 9:24 PMPratik Tandel
10/24/2021, 11:37 PMMarc Plano-Lesay
10/24/2021, 11:38 PMPratik Tandel
10/24/2021, 11:39 PMMarc Plano-Lesay
10/24/2021, 11:43 PMcompiler_release
in the kotlin_repositories
call, and a toolchainkotlin_repositories(
compiler_release = kotlinc_version(
release = kotlin_compiler.version,
sha256 = kotlin_compiler.sha,
),
)
version = "1.5.21",
sha = "f3313afdd6abf1b8c75c6292f4e41f2dbafefc8f6c72762c7ba9b3daeef5da59",
Pratik Tandel
10/24/2021, 11:57 PMMarc Plano-Lesay
10/24/2021, 11:58 PMPratik Tandel
10/25/2021, 4:27 PMERROR: Failed to load Starlark extension '@rkt_1_4//jvm:opts.bzl'.
Cycle in the workspace file detected. This indicates that a repository is used prior to being defined.
The following chain of repository dependencies lead to the missing definition.
- @rkt_1_4
This could either mean you have to add the '@rkt_1_4' repository with a statement like `http_archive` in your WORKSPACE file (note that transitive dependencies are not added automatically), or move an existing definition earlier in your WORKSPACE file.
ERROR: cycles detected during target parsing
This our root BUILD.bazel
load("@io_bazel_rules_kotlin//kotlin/internal:opts.bzl", "kt_javac_options", "kt_kotlinc_options")
# Currently blocked on <https://github.com/bazelbuild/rules_kotlin/issues/517>
kt_kotlinc_options(
name = "brex_kotlinc_options",
# This is necessary due to
# <https://github.com/micronaut-projects/micronaut-core/blob/b581ba6b2a16da720b91ff4e60541f964aafd082/src/main/docs/guide/languageSupport/java/retainparameternames.adoc>
java_parameters = True,
)
kt_javac_options(
name = "brex_javac_options",
)
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "define_kt_toolchain")
define_kt_toolchain(
name = "kotlin_toolchain",
api_version = "1.4",
javac_options = ":brex_javac_options",
jvm_target = "1.8",
kotlinc_options = ":brex_kotlinc_options",
language_version = "1.4",
)
and our root WORKSPACE
# Begin kotlin section
load("@brex_rules_kotlin//:repos.bzl", "kotlin_repos")
kotlin_repos()
load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
rules_jvm_external_deps()
load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")
rules_jvm_external_setup()
load("@brex_rules_kotlin//:deps.bzl", "add_kotlin")
add_kotlin()
load("//bazel:kotlin_third_party.bzl", "kotlin_deps")
kotlin_deps()
register_toolchains("//:kotlin_toolchain")
load("@brex_rules_kotlin//:post_maven.bzl", "post_maven_setup")
post_maven_setup()
# End kotlin section
Rest of the file is elided but i can share more context if useful