Skip to content

Commit cb3ddf4

Browse files
kartbennashif
authored andcommitted
doc: extensions: fix kconfig extension in parallel build environment
kconfig options should be *merged* instead of *appended*, otherwise search index can be huge, among other side effects. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent 6956674 commit cb3ddf4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/_extensions/zephyr/kconfig/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,14 @@ class KconfigDomain(Domain):
231231
object_types = {"option": ObjType("option", "option")}
232232
roles = {"option": XRefRole()}
233233
directives = {"search": KconfigSearch}
234-
initial_data: Dict[str, Any] = {"options": []}
234+
initial_data: Dict[str, Any] = {"options": set()}
235235

236236
def get_objects(self) -> Iterable[Tuple[str, str, str, str, str, int]]:
237237
for obj in self.data["options"]:
238238
yield obj
239239

240240
def merge_domaindata(self, docnames: List[str], otherdata: Dict) -> None:
241-
self.data["options"] += otherdata["options"]
241+
self.data["options"].update(otherdata["options"])
242242

243243
def resolve_xref(
244244
self,
@@ -268,7 +268,7 @@ def resolve_xref(
268268
def add_option(self, option):
269269
"""Register a new Kconfig option to the domain."""
270270

271-
self.data["options"].append(
271+
self.data["options"].add(
272272
(option, option, "option", self.env.docname, option, 1)
273273
)
274274

0 commit comments

Comments
 (0)