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

Error loading 1.5.0-beta-4 #602

Closed
zack-sampson opened this issue Oct 18, 2021 · 2 comments · Fixed by #613
Closed

Error loading 1.5.0-beta-4 #602

zack-sampson opened this issue Oct 18, 2021 · 2 comments · Fixed by #613
Assignees

Comments

@zack-sampson
Copy link

zack-sampson commented Oct 18, 2021

Whenever I try to run a build with the latest release, I get this output:

ERROR: Failed to load Starlark extension '@io_bazel_rules_kotlin_configured//kotlin: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.
 - @io_bazel_rules_kotlin_configured
This could either mean you have to add the '@io_bazel_rules_kotlin_configured' 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
INFO: Elapsed time: 0.155s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

I've reproduced on a "nullary" repository containing only this WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

rules_kotlin_version = "v1.5.0-beta-4"

http_archive(
    name = "io_bazel_rules_kotlin",
    urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/%s/rules_kotlin_release.tgz" % rules_kotlin_version],
)

load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories")
 
### deleting anything below this line has no impact on behavior ### 
kotlin_repositories()                                              

load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_register_toolchains")
kt_register_toolchains()

I'm on OSX using Bazel 4.0.0 if that matters. I saw #597 looks similar, but I couldn't figure out how to translate his solution.

@f355
Copy link

f355 commented Nov 1, 2021

@zack-sampson things got moved around a bit. the following works for me:

load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories")

kotlin_repositories()

not sure if kt_register_toolchains got moved or not, we're using a custom toolchain.

@restingbull
Copy link
Collaborator

restingbull commented Nov 5, 2021

Sadly, the kotlin_repositories alias cannot work from kotlin.bzl

I'll make a note of this breaking change in the release notes -- unfortunately, it's necessary to manage multi-version support.

PR #613 removes the rogue alias. Starlark loading order is a bit mindbending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants