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
Using bzlmod makes stardoc unable to find dependencies #117
Comments
Ah maybe the same as bazelbuild/bazel#14140 |
We need to update Stardoc's bundled jars - so I think we can fix this together with #119. |
I was wrong about my diagnosis; merely updating the jars from current Bazel HEAD doesn't fix it. It seems we need to explicitly make Stardoc aware of modules, otherwise it doesn't know where on disk to find the imports when processing .bzl files. @Wyverald - any advice? |
This is actually just the same issue as bazelbuild/bazel#14140 (as Keith noted above). So yes, we need to make Stardoc aware of modules (more precisely, of repo mappings -- since it could break even today). It's been on the back of my mind but I haven't come up with a great solution. I was thinking maybe we need something like the runfiles library. |
Based on my understanding of Stardoc, it would actually be quite difficult to wire repo mapping support into the Java part of Stardoc. While Stardoc uses some Bazel classes (mostly the However, I think there might be an alternative approach that actually almost works today: If every Bazel module that wants to be documented by Stardoc uses a tag offered by the This comes with two caveats:
@Wyverald What do you think, is this approach promising? |
Well, I forgot about the important caveat that this won't work if Maybe Bazel should just dump the full repo mapping as a file (e.g. JSON) to a well-known location under |
Any update on this? It's making adopting bzlmod quite tricky. |
@Wyverald @meteorcloudy If we agree on where to dump the repo mapping, I could work on this at some point during the next couple of weeks. |
I submitted a proposal on how to locate runfiles with Bzlmod: bazelbuild/proposals#269. |
What's the status of this with that merged? Looks to me like I still see the same issue with today's last_green bazel |
This will be fixed by bazelbuild/bazel#16775 and #141, which @comius is currently reviewing. The process to merge them is somewhat tricky as there is a cyclic dependency between Bazel and stardoc. |
"me too" -- I was trying to use stardoc in rules_testing with bzlmod enabled and ran into this, too. |
Fixed by #141 and released as https://github.com/bazelbuild/stardoc/releases/tag/0.5.4 |
With apple_support we have initial bzlmod support checked in, but it seems like with bazel 5.0.0, stardoc cannot find the dependencies defined by the MODULE.bzl:
To repro checkout that repo at
0c8647eeabdb0943649dbdee07f3aee870079a51
, and run:If you disable bzlmod it works correctly.
The text was updated successfully, but these errors were encountered: