[Buildroot] [for-next] package/rust: allow using python3 interpreter

Romain Naour romain.naour at gmail.com
Sun May 31 14:12:37 UTC 2020


Hello Thomas,

Le 31/05/2020 à 15:10, Thomas Petazzoni a écrit :
> On Fri, 29 May 2020 23:45:23 +0200
> Romain Naour <romain.naour at gmail.com> wrote:
> 
>>> Shouldn't we try to find an upstreamable solution here, such as perhaps
>>> a PYTHON environment variable, or an argument to configure that allows
>>> to specify the path to the Python interpreter ?
>>>
>>> But in fact, this path to the Python interpreter is already in the
>>> config.toml file that we generate, why isn't this path used ?  
>>
>> humm, It seems that this configure script is not used at all by rust package
>> since we use directly x.py...
>> So we can just drop this patch.
> 
> Could you send a follow-up patch ?

http://patchwork.ozlabs.org/project/buildroot/patch/20200530134344.24976-1-romain.naour@gmail.com/

> 
>>>> +ifeq ($(BR2_PACKAGE_PYTHON3),y)
>>>> +HOST_RUST_PYTHON_VERSION = $(PYTHON3_VERSION_MAJOR)
>>>> +HOST_RUST_DEPENDENCIES += host-python3
>>>> +else
>>>> +HOST_RUST_PYTHON_VERSION = $(PYTHON_VERSION_MAJOR)
>>>> +HOST_RUST_DEPENDENCIES += host-python
>>>> +endif  
>>>
>>> I think we should start inverting this logic, i.e use host-python3 by
>>> default if there is no python interpreter selected for the target. We
>>> should do that not only here, but in all packages that have a logic
>>> like that: python3 should become our default, and python2 should become
>>> the exception.  
>>
>> Yes, with this change we can remove python3-<module> added to provide python3
>> modules. I hope packages that still use python2 will only require the python2
>> interpreter without any additional modules.
> 
> That is not what I meant. What I meant was to change:
> 
> ifeq ($(BR2_PACKAGE_PYTHON3),y)
> HOST_RUST_PYTHON_VERSION = $(PYTHON3_VERSION_MAJOR)
> HOST_RUST_DEPENDENCIES += host-python3
> else
> HOST_RUST_PYTHON_VERSION = $(PYTHON_VERSION_MAJOR)
> HOST_RUST_DEPENDENCIES += host-python
> endif  
> 
> to:
> 
> ifeq ($(BR2_PACKAGE_PYTHON),y)
> HOST_RUST_PYTHON_VERSION = $(PYTHON_VERSION_MAJOR)
> HOST_RUST_DEPENDENCIES += host-python
> else
> HOST_RUST_PYTHON_VERSION = $(PYTHON3_VERSION_MAJOR)
> HOST_RUST_DEPENDENCIES += host-python3
> endif  
> 
> i.e: our default becomes python3.

Ok, I guess this can be done in a patch series that also use host-python3 by
default for python packages.

Best regards,
Romain


> 
> Thomas
> 



More information about the buildroot mailing list