Source docs build fails when two flat enums in a UniFFI module share a variant name
Categories
(Toolkit :: UniFFI Bindings, defect)
Tracking
()
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:
Comment 1•1 month ago
|
||
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.
Comment 2•1 month ago
|
||
The severity field is not set for this bug.
:bdk, could you have a look please?
For more information, please visit BugBot documentation.
Updated•1 month ago
|
| Reporter | ||
Comment 3•23 days ago
|
||
Yes, I think Bug 2082341 fixes this issue
Description
•