-
Notifications
You must be signed in to change notification settings - Fork 45
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
Generating stardoc
target fails in bzlmod on module_extension when using old Bazel 6 and/or legacy extractor
#192
Comments
Defining bzl_library(
name = "library",
srcs = ["library.bzl"],
visibility = ["//visibility:public"],
deps = [
":hmap",
":import_middleman",
":precompiled_apple_resource_bundle",
":utils.bzl",
"//rules/framework:vfs_overlay",
"//rules/library:resources",
"//rules/library:xcconfig",
"@bazel_skylib//lib:paths",
"@bazel_skylib//lib:selects",
"@bazel_skylib//lib:sets",
"@bazel_skylib//rules:write_file",
"@build_bazel_rules_apple//apple", # where the error seems to originate from
"@build_bazel_rules_swift//swift",
],
) Stardoc usage: stardoc(
name = "library_doc",
out = "library.gen.md",
input = "//rules:library.bzl",
tags = [
"no-cache",
"no-sandbox", # https://github.com/bazelbuild/stardoc/issues/112
],
deps = ["//rules:library"],
) This depends on this Snippet of the ...
load("@build_bazel_rules_apple//apple:apple.bzl", "apple_dynamic_framework_import", "apple_static_framework_import")
load("@build_bazel_rules_apple//apple/internal/resource_rules:apple_intent_library.bzl", "apple_intent_library")
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
... |
@luispadron Which version of Bazel are you using? On recent rolling releases of Bazel 7, stardoc use |
This is pre-7. I'm running into the same thing trying to use stardoc 0.6.2 with Bazel 6.3.2. |
Correct, was testing myself with 6.3.2 |
A work around for now for us was to remove the load of the apple.bzl file. We now load from the internal file vs. the umbrella file which means the module extension is no longer loaded and so error is "fixed" |
For rules_apple, we will probably just have to use a version of Bazel 7 to generate our docs 😕. |
This category of errors will be fixed once bazel 7 stable is out. But in the meantime - it sounds like we should update the bundled jar (from bazel 6.3.2) and make a new Stardoc release. Unfortunately, I'm on baby bonding leave at the moment and not able to spend >5 minutes on a computer, but @brandjon may be able to do it. |
This requires workarounds for bazelbuild/stardoc#192 and bazelbuild/bazel#8305.
This requires workarounds for bazelbuild/stardoc#192 and bazelbuild/bazel#8305.
Alas, regenerating the legacy extractor jar (commit cb533e6) did not fix this crash. So if we want to fix this properly, we'd probably need to explicitly add Or alternatively, simply require Bazel 7 (which is now LTS) and the new extractor when generating docs from any .bzl file that uses |
stardoc
target fails in bzlmod on module_extensionstardoc
target fails in bzlmod on module_extension when using old Bazel 6 and/or legacy extractor
Update: we are not planning to fix this; Stardoc 0.7.x will require Bazel 7 or newer, see #212. |
Im trying to update a repository to support stardoc 0.6.2 so we can consume it via bzlmod, and im running into what seems like a bzlmod extensions issue:
This fails during a load of a file defined in a bzl_library that has a dep on a module extension. Looks similar to #123
The text was updated successfully, but these errors were encountered: