[PATCH 2/5] build: Use CSafeLoader if available

Chris Johns chrisj at rtems.org
Sun May 21 23:48:52 UTC 2023


On 19/5/2023 4:46 pm, Sebastian Huber wrote:
> On 15.05.23 01:44, Chris Johns wrote:
>> On 5/5/2023 8:16 pm, Sebastian Huber wrote:
>>> On 05.05.23 01:38, Chris Johns wrote:
>>>>> When I install it
>>>>> through pip, I get the CSafeLoader on my machine. I don't have a libyaml
>>>>> development package installed.
>>>> This is what I was not understanding. If it can be loaded in a python.org
>>>> install on a N2 MacOS with a virtual env then I think we are close to a
>>>> resolution.
>>> I tried to understand how the PyYAML package is built. It seems that libyaml and
>>> its header files need to be installed to use the C bindings.
>> This is what I thought happened with this package. It depends on the base OS
>> packaging system. The documentation at
>> https://pyyaml.org/wiki/PyYAMLDocumentation  says:
>>
>>   $ python setup.py install
>>
>>   If you want to use LibYAML bindings, which are much faster than the pure
>>   Python version, you need to download and install LibYAML. Then you may
>>   build and install the bindings by executing
>>
>>   $ python setup.py --with-libyaml install
>>
>> I cannot see if pip has any further detail on the nature of the build it
>> contains so this is not looking good. This leaves building and installing when
>> the tools are built by the RSB.
> 
> The current approach with the pickle cache works reasonably fine and requires
> not extra packages. I don't think this implementation should be removed in any
> case. 

Agreed.

> The support for the CSafeLoader is just about 60 lines of additional code.
> It would be a nice improvement for systems supporting this feature. I don't have
> time to work on adding PyYAML with libyaml to the RTEMS Tools right now and I
> think this would open another maintenance issues. If someone would be unable to
> get a yaml module with a CSafeLoader, then he would be no longer able to build
> RTEMS.

It is not about the size of the implementation, it is about making 2 classes of
performance, those with and those without csafe. I am a firm believer all
developers and especially core developers need to be using the exact same tools
and code our community users are using. We did not always do this and it
resulted in the developers being disconnected from the user experience and I
decided I would do what I could to avoid this happening again.

In regards to PyYAML there are a few basic issues with it that I am not sure
about. The package can be built without support for the C library even if it is
installed. I cannot tell if a pip installed version is using the C YAML package
or not. I would like more certainty across our supported hosts before agreeing
to us using it.

Chris


More information about the devel mailing list