diff mbox series

[ovs-dev] doc: automake: Add support for sphinx 4.0.

Message ID 20210510155745.3853602-1-i.maximets@ovn.org
State Accepted
Headers show
Series [ovs-dev] doc: automake: Add support for sphinx 4.0. | expand

Commit Message

Ilya Maximets May 10, 2021, 3:57 p.m. UTC
File layout for man pages in sphinx 4 by default changed [1] from:

  Documentation/_ref/man/page.section

 to:

  Documentation/_ref/man/section/page.section

Ajusting our build scripts so they will be able to locate files
in new places.  This fixes our CI build.

[1] https://github.com/sphinx-doc/sphinx/issues/7996

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---

Successful build:
  https://github.com/igsilya/ovs/actions/runs/828587071

 Documentation/automake.mk | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Ilya Maximets May 10, 2021, 6:03 p.m. UTC | #1
On 5/10/21 5:57 PM, Ilya Maximets wrote:
> File layout for man pages in sphinx 4 by default changed [1] from:
> 
>   Documentation/_ref/man/page.section
> 
>  to:
> 
>   Documentation/_ref/man/section/page.section
> 
> Ajusting our build scripts so they will be able to locate files
> in new places.  This fixes our CI build.
> 
> [1] https://github.com/sphinx-doc/sphinx/issues/7996
> 
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---
> 
> Successful build:
>   https://github.com/igsilya/ovs/actions/runs/828587071

As soon as I'm fixing one CI issue, another one appears immediately.
This time it's a malformed /etc/hosts that breaks our testsuite.
So, even with this patch applied we can't unblock CI right now.

This patch could still use some review, though, so we could apply it
once github engineers will fix their environment.

Here is a bug for github actions about /etc/hosts:
  https://github.com/actions/virtual-environments/issues/3353

I'm giving up for today.

Best regards, Ilya Maximets.

> 
>  Documentation/automake.mk | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/automake.mk b/Documentation/automake.mk
> index ea3475f35..2a590b3a7 100644
> --- a/Documentation/automake.mk
> +++ b/Documentation/automake.mk
> @@ -216,8 +216,13 @@ install-man-rst: docs-check
>  	    $(extract_stem_and_section); \
>  	    echo " $(MKDIR_P) '$(DESTDIR)'\"$$mandir\""; \
>  	    $(MKDIR_P) '$(DESTDIR)'"$$mandir"; \
> -	    echo " $(INSTALL_DATA) $(SPHINXBUILDDIR)/man/$$stem.$$section '$(DESTDIR)'\"$$mandir/$$stem.$$section\""; \
> -	    $(INSTALL_DATA) $(SPHINXBUILDDIR)/man/$$stem.$$section '$(DESTDIR)'"$$mandir/$$stem.$$section"; \
> +	    if test -f $(SPHINXBUILDDIR)/man/$$stem.$$section; then \
> +	        filepath=$(SPHINXBUILDDIR)/man/$$stem.$$section; \
> +	    else \
> +	        filepath=$(SPHINXBUILDDIR)/man/$$section/$$stem.$$section; \
> +	    fi; \
> +	    echo " $(INSTALL_DATA) $$filepath '$(DESTDIR)'\"$$mandir/$$stem.$$section\""; \
> +	    $(INSTALL_DATA) $$filepath '$(DESTDIR)'"$$mandir/$$stem.$$section"; \
>  	done
>  else
>  install-man-rst:
>
Ben Pfaff May 10, 2021, 6:52 p.m. UTC | #2
On Mon, May 10, 2021 at 05:57:45PM +0200, Ilya Maximets wrote:
> File layout for man pages in sphinx 4 by default changed [1] from:
> 
>   Documentation/_ref/man/page.section
> 
>  to:
> 
>   Documentation/_ref/man/section/page.section
> 
> Ajusting our build scripts so they will be able to locate files
> in new places.  This fixes our CI build.
> 
> [1] https://github.com/sphinx-doc/sphinx/issues/7996
> 
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>

The patch looks good, although I didn't test this.

Acked-by: Ben Pfaff <blp@ovn.org>
David Marchand May 11, 2021, 10:51 a.m. UTC | #3
On Mon, May 10, 2021 at 5:57 PM Ilya Maximets <i.maximets@ovn.org> wrote:
>
> File layout for man pages in sphinx 4 by default changed [1] from:
>
>   Documentation/_ref/man/page.section
>
>  to:
>
>   Documentation/_ref/man/section/page.section
>
> Ajusting our build scripts so they will be able to locate files
> in new places.  This fixes our CI build.
>
> [1] https://github.com/sphinx-doc/sphinx/issues/7996
>
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>

Reviewed-by: David Marchand <david.marchand@redhat.com>
Aaron Conole May 11, 2021, 1:44 p.m. UTC | #4
Ilya Maximets <i.maximets@ovn.org> writes:

> File layout for man pages in sphinx 4 by default changed [1] from:
>
>   Documentation/_ref/man/page.section
>
>  to:
>
>   Documentation/_ref/man/section/page.section
>
> Ajusting our build scripts so they will be able to locate files
> in new places.  This fixes our CI build.
>
> [1] https://github.com/sphinx-doc/sphinx/issues/7996
>
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---

Reviewed-by: Aaron Conole <aconole@redhat.com>
Ilya Maximets May 11, 2021, 3:54 p.m. UTC | #5
On 5/10/21 5:57 PM, Ilya Maximets wrote:
> File layout for man pages in sphinx 4 by default changed [1] from:
> 
>   Documentation/_ref/man/page.section
> 
>  to:
> 
>   Documentation/_ref/man/section/page.section
> 
> Ajusting our build scripts so they will be able to locate files
> in new places.  This fixes our CI build.
> 
> [1] https://github.com/sphinx-doc/sphinx/issues/7996
> 
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---

Applied to master and backported down to 2.12 to unblock CI.

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/Documentation/automake.mk b/Documentation/automake.mk
index ea3475f35..2a590b3a7 100644
--- a/Documentation/automake.mk
+++ b/Documentation/automake.mk
@@ -216,8 +216,13 @@  install-man-rst: docs-check
 	    $(extract_stem_and_section); \
 	    echo " $(MKDIR_P) '$(DESTDIR)'\"$$mandir\""; \
 	    $(MKDIR_P) '$(DESTDIR)'"$$mandir"; \
-	    echo " $(INSTALL_DATA) $(SPHINXBUILDDIR)/man/$$stem.$$section '$(DESTDIR)'\"$$mandir/$$stem.$$section\""; \
-	    $(INSTALL_DATA) $(SPHINXBUILDDIR)/man/$$stem.$$section '$(DESTDIR)'"$$mandir/$$stem.$$section"; \
+	    if test -f $(SPHINXBUILDDIR)/man/$$stem.$$section; then \
+	        filepath=$(SPHINXBUILDDIR)/man/$$stem.$$section; \
+	    else \
+	        filepath=$(SPHINXBUILDDIR)/man/$$section/$$stem.$$section; \
+	    fi; \
+	    echo " $(INSTALL_DATA) $$filepath '$(DESTDIR)'\"$$mandir/$$stem.$$section\""; \
+	    $(INSTALL_DATA) $$filepath '$(DESTDIR)'"$$mandir/$$stem.$$section"; \
 	done
 else
 install-man-rst: