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

Possible bug in bazel_features causing problem updating rules_jvm_external depndency #70

Closed
hb-man opened this issue Sep 20, 2024 · 4 comments

Comments

@hb-man
Copy link

hb-man commented Sep 20, 2024

Not sure in which of two projects the problem is
bazel-contrib/rules_jvm_external#1256

Updating rules_jvm_external to version 6.4 causes bazel_features error

can be reproduced on this project/branch

JetBrains/hirschgarten#68

full error message:

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.
 - @@bazel_features
This could either mean you have to add the '@@bazel_features' 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.
Computing main repo mapping:
ERROR: Error computing the main repository mapping: cycles detected during computation of main repo mapping

i tried fixing it by adding explicit dependency to bazel_features - but than i get another error:

ERROR: Failed to load Starlark extension '@@bazel_features_version//:version.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.
 - @@bazel_features_version
This could either mean you have to add the '@@bazel_features_version' 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: Error computing the main repository mapping: cycles detected during computation of main repo mapping

Though, if I add bazel_features depndency explicit, but WORKSPACE-style - it starts to work. This might be a bug in bazel features so I'll file it there.

@fmeum
Copy link
Member

fmeum commented Sep 20, 2024

I'm pretty sure that the bug is in the transitively updated rules_java, which is used by Bazel's workspace suffix but doesn't properly declare the dep on bazel_features here: https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl

@hvadehra

@daniel-b2c2
Copy link

@fmeum so the issue should be raised in rules_java project?

@fmeum
Copy link
Member

fmeum commented Sep 25, 2024

@daniel-b2c2 Yes, please do!

@fmeum
Copy link
Member

fmeum commented Oct 2, 2024

See bazelbuild/rules_java#225 (comment), a closer look revealed that this is an issue with rules_sonatype.

@fmeum fmeum closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
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

3 participants