Skip to contentSkip to conversation

docs/sphinx/qapidoc.py: Handle change of QAPI's builtin module name

PATCH In review Peter Maydell 4 participants 5 messages Feb 12, 2021 – Feb 15, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs/sphinx/qapidoc.py: Handle change of QAPI's builtin module name

In commit e2bbc4eaa7f0 we changed the QAPI modules to name the built-in module "./builtin" rather than None, but forgot to update the Sphinx plugin. The effect of this was that when the plugin generated a dependency file it was including a bogus dependency on a non-existent file named "builtin", which meant that ninja would run Sphinx and rebuild all the documentation every time even if nothing had changed.

Update the plugin to use the new name of the builtin module.

Fixes e2bbc4eaa7f0
---
 docs/sphinx/qapidoc.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/sphinx/qapidoc.py +1 -1
index e03abcbb959..b7b86b5dffb 100644
@@ -464,7 +464,7 @@ class QAPISchemaGenDepVisitor(QAPISchemaVisitor):
         self._qapidir = qapidir
 
     def visit_module(self, name):
-        if name is not None:
+        if name != "./builtin":
             qapifile = self._qapidir + '/' + name
             self._env.note_dependency(os.path.abspath(qapifile))
         super().visit_module(name)
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · Peter Maydell

In commit e2bbc4eaa7f0 we changed the QAPI modules to name the built-in module "./builtin" rather than None, but forgot to update the Sphinx plugin. The effect of this was that when the plugin generated a dependency file it was including a bogus dependency on a non-existent file named "builtin", which meant that ninja would run Sphinx and rebuild all the documentation every time even if nothing had changed.

Update the plugin to use the new name of the builtin module.

Fixes e2bbc4eaa7f0
---
  docs/sphinx/qapidoc.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
docs/sphinx/qapidoc.py +0 -0
index e03abcbb959..b7b86b5dffb 100644

docs/sphinx/qapidoc.py class QAPISchemaGenDepVisitor(QAPISchemaVisitor): · line 470

Quoted 8 lines
docs/sphinx/qapidoc.py +1 -1
@@ -464,7 +464,7 @@ class QAPISchemaGenDepVisitor(QAPISchemaVisitor):
          self._qapidir = qapidir
 
      def visit_module(self, name):
-        if name is not None:
+        if name != "./builtin":
              qapifile = self._qapidir + '/' + name
              self._env.note_dependency(os.path.abspath(qapifile))
          super().visit_module(name)
Tested-by on v1 1/1
#2 lore raw
In reply to Peter Maydell
Quoted 7 lines · Peter Maydell

In commit e2bbc4eaa7f0 we changed the QAPI modules to name the built-in module "./builtin" rather than None, but forgot to update the Sphinx plugin. The effect of this was that when the plugin generated a dependency file it was including a bogus dependency on a non-existent file named "builtin", which meant that ninja would run Sphinx and rebuild all the documentation every time even if nothing had changed.

Quoted 7 lines

Update the plugin to use the new name of the builtin module.

Fixes e2bbc4eaa7f0
---
 docs/sphinx/qapidoc.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(I had wondered why my builds were taking so much longer lately...)

Quoted 15 lines
docs/sphinx/qapidoc.py +1 -1
index e03abcbb959..b7b86b5dffb 100644
@@ -464,7 +464,7 @@ class QAPISchemaGenDepVisitor(QAPISchemaVisitor):
         self._qapidir = qapidir
 
     def visit_module(self, name):
-        if name is not None:
+        if name != "./builtin":
             qapifile = self._qapidir + '/' + name
             self._env.note_dependency(os.path.abspath(qapifile))
         super().visit_module(name)
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
#3 lore raw
In reply to Peter Maydell
Quoted 8 lines · Peter Maydell

In commit e2bbc4eaa7f0 we changed the QAPI modules to name the built-in module "./builtin" rather than None, but forgot to update the Sphinx plugin. The effect of this was that when the plugin generated a dependency file it was including a bogus dependency on a non-existent file named "builtin", which meant that ninja would run Sphinx and rebuild all the documentation every time even if nothing had changed.

Quoted 7 lines

Update the plugin to use the new name of the builtin module.

Fixes e2bbc4eaa7f0
---
 docs/sphinx/qapidoc.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to master so we can all stop wasting CPU cycles rebuilding the documentation :-)

thanks
-- PMM

Reviewed-by on v1 1/1
#4 lore raw
In reply to Peter Maydell
Quoted 21 lines · Peter Maydell

In commit e2bbc4eaa7f0 we changed the QAPI modules to name the built-in module "./builtin" rather than None, but forgot to update the Sphinx plugin. The effect of this was that when the plugin generated a dependency file it was including a bogus dependency on a non-existent file named "builtin", which meant that ninja would run Sphinx and rebuild all the documentation every time even if nothing had changed.

Update the plugin to use the new name of the builtin module.

Fixes e2bbc4eaa7f0
---
  docs/sphinx/qapidoc.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
docs/sphinx/qapidoc.py +0 -0
index e03abcbb959..b7b86b5dffb 100644

docs/sphinx/qapidoc.py class QAPISchemaGenDepVisitor(QAPISchemaVisitor): · line 470

Quoted 8 lines
docs/sphinx/qapidoc.py +1 -1
@@ -464,7 +464,7 @@ class QAPISchemaGenDepVisitor(QAPISchemaVisitor):
          self._qapidir = qapidir
 
      def visit_module(self, name):
-        if name is not None:
+        if name != "./builtin":
              qapifile = self._qapidir + '/' + name
              self._env.note_dependency(os.path.abspath(qapifile))
          super().visit_module(name)