Bug 256532

Summary: textproc/docproj: does not install python3
Product: Ports & Packages Reporter: Ceri Davies <ceri>
Component: Individual Port(s)Assignee: Document Engineering Group (Nobody) <doceng>
Status: Open ---    
Severity: Affects Only Me CC: dbaio, lwhsu, ygy
Priority: --- Flags: bugzilla: maintainer-feedback? (doceng)
Version: Latest   
Hardware: Any   
OS: Any   

Description Ceri Davies freebsd_committer 2021-06-10 09:45:56 UTC
The doc build requires /usr/local/build/python3, and the doc build needs it.
If you don't have it installed, it tells you install the docproj package, but that doesn't install python3 either.

{ceri@threebsd}-{~/git/f} % sudo pkg install docproj
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
{ceri@threebsd}-{git/f} % git clone https://git.freebsd.org/doc.git -o freebsd freebsd-doc
{ceri@threebsd}-{~/git/f} % cd freebsd-doc
{ceri@threebsd}-{git/f/freebsd-doc} % make
===> documentation (all)
/usr/local/bin/python3 not found, please run pkg install docproj
*** Error code 1

Stop.
make[1]: stopped in /home/ceri/git/f/freebsd-doc/documentation
*** Error code 1

Stop.
make: stopped in /home/ceri/git/f/freebsd-doc
{ceri@threebsd}-{git/f/freebsd-doc} % ls /usr/local/bin/pyth*
/usr/local/bin/python3.7                /usr/local/bin/python3.7m
/usr/local/bin/python3.7-config         /usr/local/bin/python3.7m-config
{ceri@threebsd}-{git/f/freebsd-doc} %
Comment 1 Ceri Davies freebsd_committer 2021-06-10 09:51:42 UTC
Ignore this, I have ended up with docproj-2 for some reason.
Comment 2 Li-Wen Hsu freebsd_committer 2021-06-10 10:36:15 UTC
I feel this is still an issue, the scripts in doc are using `#!/usr/local/bin/python3` as shebang, but docproj is marking `USES=python:3.6+,run` this only implies installing lang/python.38 as 3.8 is the current default python version, and only /usr/local/bin/python3.8 will be provided. This would cause a problem on a vanilla installed system where has no lang/python or lang/python3 installed.
Comment 3 Danilo G. Baio freebsd_committer 2021-06-10 23:57:46 UTC
As we can't direct depend on lang/python3 metaport, what about checking for default Python versions in the doc Makefile?

At this moment we have:
 ports latest/main branch == Python 3.8 /usr/local/bin/python3.8
 ports quarterly 2021Q2   == Python 3.7 /usr/local/bin/python3.7
 fallback to /usr/local/bin/python3 as a PYTHON_CMD? variable.

And change the error message if it not find a Python interpreter, to set a PYTHON_CMD env.