* Re: [PATCH] Updates Documentation/Makefile to use Python3 as fallback [not found] <20210129113544.25946-1-noasakurajin@web.de> @ 2021-01-30 0:15 ` Jonathan Corbet 2021-02-01 1:06 ` Masahiro Yamada 0 siblings, 1 reply; 2+ messages in thread From: Jonathan Corbet @ 2021-01-30 0:15 UTC (permalink / raw) To: Noa Sakurajin Cc: Noa Sakurajin, linux-doc, linux-kernel, Masahiro Yamada, Michal Marek Noa Sakurajin <noasakurajin@web.de> writes: [CC += kbuild maintainers] > Before the command python was needed for the documentation to build. > This patch checks if python is available and uses python3 as > fallback. > > This is needed because a lot of distribution (at least Ubuntu) > only provide python3 and not python. scripts/sphinx-pre-install > checks for python3 first and does not check if python exists > which causes it to report that everything is installed even > if the documentation build failed. > > Signed-off-by: Noa Sakurajin <noasakurajin@web.de> > --- > Documentation/Makefile | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/Documentation/Makefile b/Documentation/Makefile > index 61a7310b49e0..8a4a7df3b74a 100644 > --- a/Documentation/Makefile > +++ b/Documentation/Makefile > @@ -75,7 +75,8 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4) > cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media $2 && \ > PYTHONDONTWRITEBYTECODE=1 \ > BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \ > - $(PYTHON) $(srctree)/scripts/jobserver-exec \ > + PY=$(shell command -v $(PYTHON) 2> /dev/null) \ > + $${PY:-"$(PYTHON3)"} $(srctree)/scripts/jobserver-exec \ So I see what you're trying to do, and we definitely want this to work. I susped this isn't the right fix, though; it could leave us open to similar issues elsewhere in the tree. Personally, I think that $(PYTHON) should get a working Python if it's installed, so I would suggest fixing the top-level Makefile to set it correctly. Masahiro, thoughts on that? Alternatively, we could just say $(PYTHON3) and explicitly leave Python2 behind; that needs to happen in the not-too-distant future regardless but we haven't decided to actually do it yet. Thanks, jon ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Updates Documentation/Makefile to use Python3 as fallback 2021-01-30 0:15 ` [PATCH] Updates Documentation/Makefile to use Python3 as fallback Jonathan Corbet @ 2021-02-01 1:06 ` Masahiro Yamada 0 siblings, 0 replies; 2+ messages in thread From: Masahiro Yamada @ 2021-02-01 1:06 UTC (permalink / raw) To: Jonathan Corbet Cc: Noa Sakurajin, open list:DOCUMENTATION, Linux Kernel Mailing List, Michal Marek On Sat, Jan 30, 2021 at 9:15 AM Jonathan Corbet <corbet@lwn.net> wrote: > > Noa Sakurajin <noasakurajin@web.de> writes: > > [CC += kbuild maintainers] > > > Before the command python was needed for the documentation to build. > > This patch checks if python is available and uses python3 as > > fallback. > > > > This is needed because a lot of distribution (at least Ubuntu) > > only provide python3 and not python. scripts/sphinx-pre-install > > checks for python3 first and does not check if python exists > > which causes it to report that everything is installed even > > if the documentation build failed. > > > > Signed-off-by: Noa Sakurajin <noasakurajin@web.de> > > --- > > Documentation/Makefile | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/Makefile b/Documentation/Makefile > > index 61a7310b49e0..8a4a7df3b74a 100644 > > --- a/Documentation/Makefile > > +++ b/Documentation/Makefile > > @@ -75,7 +75,8 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4) > > cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media $2 && \ > > PYTHONDONTWRITEBYTECODE=1 \ > > BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \ > > - $(PYTHON) $(srctree)/scripts/jobserver-exec \ > > + PY=$(shell command -v $(PYTHON) 2> /dev/null) \ > > + $${PY:-"$(PYTHON3)"} $(srctree)/scripts/jobserver-exec \ > > So I see what you're trying to do, and we definitely want this to work. > I susped this isn't the right fix, though; it could leave us open to > similar issues elsewhere in the tree. > > Personally, I think that $(PYTHON) should get a working Python if it's > installed, so I would suggest fixing the top-level Makefile to set it > correctly. Masahiro, thoughts on that? > > Alternatively, we could just say $(PYTHON3) and explicitly leave Python2 > behind; that needs to happen in the not-too-distant future regardless > but we haven't decided to actually do it yet. We are already doing this in linux-next. I will apply this. https://lore.kernel.org/patchwork/patch/1373422/ > Thanks, > > jon -- Best Regards Masahiro Yamada ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-01 1:08 UTC | newest] Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20210129113544.25946-1-noasakurajin@web.de> 2021-01-30 0:15 ` [PATCH] Updates Documentation/Makefile to use Python3 as fallback Jonathan Corbet 2021-02-01 1:06 ` Masahiro Yamada
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).