Closed Bug 2082313 Opened 1 month ago Closed 23 days ago

Source docs build fails when two flat enums in a UniFFI module share a variant name

Categories

(Toolkit :: UniFFI Bindings, defect)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: dimi, Unassigned)

References

Details

uniffi-bindgen-gecko-js writes a doc comment for every variant of a flat enum, using the variant name when the variant has no docstring (map_variant in pipeline/enums.rs). The flat-enum branch of templates/js/Enum.sys.mjs puts those comments inside Object.freeze({ ... }), where JSDoc does not attach them to the enum, so it files each one at module scope as <Module>.sys.<VARIANT>.

When two flat enums in one module share a variant name, those doclets collide, and sphinx-js aborts the whole docs build in builder-inited:

sphinx_js.suffix_tree.PathsTaken: Your code contains multiple documented objects at each of these paths:
  ./toolkit/components/uniffi-bindgen-gecko-js/components/generated/RustSearch.sys.FIREFOX_ANDROID
  ./toolkit/components/uniffi-bindgen-gecko-js/components/generated/RustSearch.sys.UNKNOWN
  ...

application-services search-config-v3 (#7645 and related) added SearchApplicationNameV3, SearchEngineClassificationV3 and other enums that reuse the variant names of the existing ones in RustSearch.sys.mjs, so any application-services vendor from that point on fails source-test-doc-generate. Bug 2080179 was backed out for this:

Does https://bugzilla.mozilla.org/show_bug.cgi?id=2082341 fix this? It adds @lends which is intended to tell JSDoc which enum to link them to.

The severity field is not set for this bug.
:bdk, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(bdeankawamura)
Severity: -- → S4
Flags: needinfo?(bdeankawamura)

Yes, I think Bug 2082341 fixes this issue

Status: NEW → RESOLVED
Closed: 23 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.