diff mbox series

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

Message ID 20210212161311.28915-1-peter.maydell@linaro.org (mailing list archive)
State New, archived
Headers show
Series docs/sphinx/qapidoc.py: Handle change of QAPI's builtin module name | expand

Commit Message

Peter Maydell Feb. 12, 2021, 4:13 p.m. UTC
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
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 docs/sphinx/qapidoc.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paolo Bonzini Feb. 12, 2021, 4:26 p.m. UTC | #1
On 12/02/21 17:13, Peter Maydell wrote:
> 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
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   docs/sphinx/qapidoc.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py
> index e03abcbb959..b7b86b5dffb 100644
> --- a/docs/sphinx/qapidoc.py
> +++ b/docs/sphinx/qapidoc.py
> @@ -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)
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Eric Blake Feb. 12, 2021, 4:51 p.m. UTC | #2
On 2/12/21 10:13 AM, Peter Maydell wrote:
> 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
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  docs/sphinx/qapidoc.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Eric Blake <eblake@redhat.com>

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

> 
> diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py
> index e03abcbb959..b7b86b5dffb 100644
> --- a/docs/sphinx/qapidoc.py
> +++ b/docs/sphinx/qapidoc.py
> @@ -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)
>
Peter Maydell Feb. 15, 2021, 4:07 p.m. UTC | #3
On Fri, 12 Feb 2021 at 16:13, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> 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
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  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
John Snow Feb. 15, 2021, 6:10 p.m. UTC | #4
On 2/12/21 11:13 AM, Peter Maydell wrote:
> 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
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   docs/sphinx/qapidoc.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py
> index e03abcbb959..b7b86b5dffb 100644
> --- a/docs/sphinx/qapidoc.py
> +++ b/docs/sphinx/qapidoc.py
> @@ -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)
> 

Reviewed-by: John Snow <jsnow@redhat.com>
diff mbox series

Patch

diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py
index e03abcbb959..b7b86b5dffb 100644
--- a/docs/sphinx/qapidoc.py
+++ b/docs/sphinx/qapidoc.py
@@ -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)