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

Stardoc is not usable by consumers in 0.6.2 #186

Closed
UebelAndre opened this issue Aug 24, 2023 · 7 comments · Fixed by #187
Closed

Stardoc is not usable by consumers in 0.6.2 #186

UebelAndre opened this issue Aug 24, 2023 · 7 comments · Fixed by #187
Assignees

Comments

@UebelAndre
Copy link

I opened bazelbuild/rules_rust#2129 and am getting issues the following build failure:

Error in fail: Failed to parse /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/dc2dbc2929304b001ce0cb65e3254023/external/io_bazel_stardoc/maven_install.json. It is not a valid maven_install.json file. Has this file been modified manually?

Additionally, it feels like there's an insane number of new macros required to use the tool. Can that be reduced somehow?

@tetromino
Copy link
Collaborator

tetromino commented Aug 24, 2023

the following build failure:

Thanks, will investigate. My first suspicion is some kind of a diamond dependency problem with incompatible versions of rules_jvm_external.

Additionally, it feels like there's an insane number of new macros required to use the tool. Can that be reduced somehow?

I recommend switching to --enable_bzlmod - then you just need one line in your MODULE.bazel

Unfortunately, when using WORKSPACE, I don't see a way to reduce the amount of setup steps. It's a long sequence of (a) call one macro to define some repos, (b) load second macro from a .bzl file which for unavoidable reasons references repos defined in previous step, (c) call second macro to define some more repos, (d) et cetera, et cetera.

Reducing the amount of copy-pasting in such cases is precisely why bzlmod was invented!

@tetromino tetromino self-assigned this Aug 24, 2023
@UebelAndre
Copy link
Author

Maybe someone on the Bazel team who’s familiar with bzlmod can help add support for it in rules_rust 😄

@tetromino
Copy link
Collaborator

tetromino commented Aug 24, 2023

Re rules_rust - it's diamond dependency, as suspected.

Stardoc requires @rules_jvm_external >= 5.2

@rules_rust's prost and proto_protobuf transitively (via an obsolete @com_google_protobuf dependency) pull in @rules_jvm_external 4.1

My suggested workaround - see tetromino/rules_rust@8755984 - is to move the Stardoc block above @rules_rust's prost and proto_protobuf block.

The real solution is bzlmod...

@tetromino
Copy link
Collaborator

I've updated the https://github.com/bazelbuild/stardoc/releases/tag/0.6.2 release page to discuss the WORKSPACE order dependence problem, and will add the text to the template in the maintainer's guide.

@tetromino
Copy link
Collaborator

Maybe someone on the Bazel team who’s familiar with bzlmod can help add support for it in rules_rust 😄

@Wyverald would be a good person to talk to

@Wyverald
Copy link
Member

@UebelAndre please take a look at the Bzlmod migration guide at https://bazel.build/external/migration. @meteorcloudy and I are happy to answer any questions and help with problems you encounter, but we don't have enough cycles to move the entire ecosystem to Bzlmod ourselves.

@UebelAndre
Copy link
Author

@Wyverald thanks, there's open PRs to add bzlmod support but it doesn't appear any existing maintainers have bandwidth to come up to speed on bzlmod to be an effective reviewer. Support would be greatly appreciated.

tetromino added a commit that referenced this issue Aug 29, 2023
* Add blurb about repository fetch errors
* Fix BCR text
* Recommend adding a commented MODULE.bazel setup block and uncommenting (easier than copy/pasting it later)

Fixes #186
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants