tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PYTHON_FOR_BUILD_ONLY in lang/python/tool.mk



On Wed, Nov 22, 2023 at 11:37:10AM +0000, Jonathan Perkin wrote:
> By far the biggest offender with the implicit DEPENDS issue is python.
> 
> The problem is that lots of packages simply do this:
> 
>   .include "../../lang/python/tool.mk"
> 
> assuming that this will pull python in as a tool only.
> 
> However, it doesn't.  Unless PYTHON_FOR_BUILD_ONLY is specifically set to
> "tool" prior to pulling it in, pyversion.mk will include the python
> buildlink3.mk and we end up with the gettext/iconv issues.
> 
> I'd like to propose we at least do the following:
> 
>   --- a/lang/python/tool.mk
>   +++ b/lang/python/tool.mk
>   @@ -12,6 +12,7 @@
>    PYTHON_TOOL_MK=        defined
>    .if !defined(PYTHON_PYVERSION_MK)
>   +PYTHON_FOR_BUILD_ONLY?=        tool
>    .include "../../lang/python/pyversion.mk"
>    .endif
> 
> so that packages that simply include tool.mk on the assumption that it will
> only be used as a tool (a pretty reasonable assumption in my opinion?) will
> DTRT.
> 
> I'll obviously test this in the next bulk build first, but any objections to
> the logic?

I was wondering about this for a long time. Yes, please do this.

> After that we'll need to go around and remove PYTHON_FOR_BUILD_ONLY=yes from
> packages that really mean "tool".  These two changes fix fontconfig, etc.

I think 'yes' is ok but 'no' is a really bad description of what happens.
Should we replace this with USE_PYTHON with the allowed values of "build tool test run"?

 Thomas


Home | Main Index | Thread Index | Old Index