[v2] doc: fix doc build when sphinx reports version to stderr

Message ID 20200622140002.555035-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] doc: fix doc build when sphinx reports version to stderr |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Bruce Richardson June 22, 2020, 2 p.m. UTC
  When sphinx-build reports its version information to stderr rather
than stdout, the wrapper script misses it, and then fails to run.
We can fix this by redirecting stderr to stdout for the version
query call.

Fixes: f5ab2074cfba ("doc: rebuild with meson whenever a file changes")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
V2: no changes to this patch, dropped patch 2 from series.
---
 buildtools/call-sphinx-build.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Comments

Power, Ciara June 22, 2020, 2:09 p.m. UTC | #1
>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Bruce Richardson
>Sent: Monday 22 June 2020 15:00
>To: david.marchand@redhat.com
>Cc: dev@dpdk.org; Richardson, Bruce <bruce.richardson@intel.com>
>Subject: [dpdk-dev] [PATCH v2] doc: fix doc build when sphinx reports version
>to stderr
>
>When sphinx-build reports its version information to stderr rather than
>stdout, the wrapper script misses it, and then fails to run.
>We can fix this by redirecting stderr to stdout for the version query call.
>
>Fixes: f5ab2074cfba ("doc: rebuild with meson whenever a file changes")
>
>Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
>---
>V2: no changes to this patch, dropped patch 2 from series.
>---
> buildtools/call-sphinx-build.py | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py
>index b9a3994e1..85c9e0156 100755
>--- a/buildtools/call-sphinx-build.py
>+++ b/buildtools/call-sphinx-build.py
>@@ -6,13 +6,14 @@
> import sys
> import os
> from os.path import join
>-from subprocess import run, PIPE
>+from subprocess import run, PIPE, STDOUT
> from distutils.version import StrictVersion
>
> (sphinx, src, dst) = sys.argv[1:]  # assign parameters to variables
>
> # for sphinx version >= 1.7 add parallelism using "-j auto"
>-ver = run([sphinx, '--version'], stdout=PIPE).stdout.decode().split()[-1]
>+ver = run([sphinx, '--version'], stdout=PIPE,
>+          stderr=STDOUT).stdout.decode().split()[-1]
> sphinx_cmd = [sphinx]
> if StrictVersion(ver) >= StrictVersion('1.7'):
>     sphinx_cmd += ['-j', 'auto']
>--
>2.25.1


Hi Bruce,

I hit the issue described here, and this patch fixed it for me.
Thanks!

Tested-by: Ciara Power <ciara.power@intel.com>
  
David Marchand June 22, 2020, 2:20 p.m. UTC | #2
On Mon, Jun 22, 2020 at 4:00 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> When sphinx-build reports its version information to stderr rather
> than stdout, the wrapper script misses it, and then fails to run.
> We can fix this by redirecting stderr to stdout for the version
> query call.
>
> Fixes: f5ab2074cfba ("doc: rebuild with meson whenever a file changes")
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> V2: no changes to this patch, dropped patch 2 from series.

Tested-by: David Marchand <david.marchand@redhat.com>

I initially encountered the issue on a fc30 when checking doc generation.
fc30 is now EOL and the problem does not happen anymore on fc31.

Still worth fixing from my pov.

Thanks Bruce.
  
Thomas Monjalon July 30, 2020, 11 p.m. UTC | #3
22/06/2020 16:20, David Marchand:
> On Mon, Jun 22, 2020 at 4:00 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > When sphinx-build reports its version information to stderr rather
> > than stdout, the wrapper script misses it, and then fails to run.
> > We can fix this by redirecting stderr to stdout for the version
> > query call.
> >
> > Fixes: f5ab2074cfba ("doc: rebuild with meson whenever a file changes")
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> > V2: no changes to this patch, dropped patch 2 from series.
> 
> Tested-by: David Marchand <david.marchand@redhat.com>
> 
> I initially encountered the issue on a fc30 when checking doc generation.
> fc30 is now EOL and the problem does not happen anymore on fc31.
> 
> Still worth fixing from my pov.
> 
> Thanks Bruce.

Applied, thanks
  

Patch

diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py
index b9a3994e1..85c9e0156 100755
--- a/buildtools/call-sphinx-build.py
+++ b/buildtools/call-sphinx-build.py
@@ -6,13 +6,14 @@ 
 import sys
 import os
 from os.path import join
-from subprocess import run, PIPE
+from subprocess import run, PIPE, STDOUT
 from distutils.version import StrictVersion
 
 (sphinx, src, dst) = sys.argv[1:]  # assign parameters to variables
 
 # for sphinx version >= 1.7 add parallelism using "-j auto"
-ver = run([sphinx, '--version'], stdout=PIPE).stdout.decode().split()[-1]
+ver = run([sphinx, '--version'], stdout=PIPE,
+          stderr=STDOUT).stdout.decode().split()[-1]
 sphinx_cmd = [sphinx]
 if StrictVersion(ver) >= StrictVersion('1.7'):
     sphinx_cmd += ['-j', 'auto']