[Buildroot] [PATCH v2 2/2] package/python-orjson: bump to version 3.6.8
Graeme Smecher
gsmecher at threespeedlogic.com
Wed May 11 17:17:24 UTC 2022
Hi James and Arnout,
On 2022-05-10 13:03, James Hilliard wrote:
> On Tue, May 10, 2022 at 1:01 PM Arnout Vandecappelle <arnout at mind.be> wrote:
>>
>>
>>
>> On 10/05/2022 02:31, James Hilliard wrote:
>>> Convert package to use python infrastructure instead of cargo
>>> infrastructure.
>>
>> AFAIU, maturin was already available in 3.6.7, so the conversion should be
>> separate from the bump.
>
> I mostly did it at the same time to avoid any potential conflicts/confusion
> with mirrored assets.
>
>>
>> That said, I think Graeme intentionally did not use maturin because it doesn't
>> really offer much benefit over calling cargo directly. Do you have a reason to
>> prefer using maturin?
>
> It should be more correct, I mean calling cargo directly doesn't really properly
> install say pure python files and is more likely to break in weird ways.
The python-maturin package wasn't available when I initially packaged
orjson (3.6.7).
I suspect if this patch works, then shifting python-orjson to
python-maturin will be less brittle (or, brittle in ways that are less
isolated) than the current maturin bypass.
If the extra information would be helpful, I can give this
python-maturin approach a try and see if it works in my application.
best,
Graeme
>
>>
>>>
>>> Signed-off-by: James Hilliard <james.hilliard1 at gmail.com>
>>> ---
>>> package/python-orjson/python-orjson.hash | 5 +++--
>>> package/python-orjson/python-orjson.mk | 24 ++++++++++++------------
>>> 2 files changed, 15 insertions(+), 14 deletions(-)
>>>
>>> diff --git a/package/python-orjson/python-orjson.hash b/package/python-orjson/python-orjson.hash
>>> index 5ef2726d82..06cc5cae79 100644
>>> --- a/package/python-orjson/python-orjson.hash
>>> +++ b/package/python-orjson/python-orjson.hash
>>> @@ -1,4 +1,5 @@
>>> -# Locally calculated
>>> -sha256 4713b120ad86b1b273f5952cbf9578c13d0f453064bd26d823e04a10c84824e6 python-orjson-3.6.7.tar.gz
>>> +# Locally calculated after vendoring
>>> +sha256 40b95576b81916d167f7a44829401acb3b6cbbfe9840b5ed88c9535a86507d7b orjson-3.6.8.tar.gz
>>> +# Locally computed sha256 checksums
>>> sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2 LICENSE-APACHE
>>> sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3 LICENSE-MIT
>>> diff --git a/package/python-orjson/python-orjson.mk b/package/python-orjson/python-orjson.mk
>>> index 5de4b2c5fa..ccbaf37c6d 100644
>>> --- a/package/python-orjson/python-orjson.mk
>>> +++ b/package/python-orjson/python-orjson.mk
>>> @@ -4,19 +4,19 @@
>>> #
>>> ################################################################################
>>>
>>> -PYTHON_ORJSON_VERSION = 3.6.7
>>> -PYTHON_ORJSON_SITE = $(call github,ijl,orjson,$(PYTHON_ORJSON_VERSION))
>>> +PYTHON_ORJSON_VERSION = 3.6.8
>>> +PYTHON_ORJSON_SOURCE = orjson-$(PYTHON_ORJSON_VERSION).tar.gz
>>> +PYTHON_ORJSON_SITE = https://files.pythonhosted.org/packages/14/8e/7e745d867466bdafb12ab7b0179d40f23f55639f7cd14bd375acfa74aca2
>>
>> Kind of an aside, since this applies to many other packages: is there a reason
>> we prefer to get Python packages from pypi rather than the upstream source itself?
>
> These are sdist's(release tarball equivalents for python packages)
> while upstream
> source is not.
>
>>
>>> +PYTHON_ORJSON_SETUP_TYPE = pep517
>>> PYTHON_ORJSON_LICENSE = Apache-2.0 or MIT
>>> PYTHON_ORJSON_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
>>> -PYTHON_ORJSON_DEPENDENCIES = host-python-cffi
>>> -PYTHON_ORJSON_CARGO_ENV = \
>>> +PYTHON_ORJSON_DEPENDENCIES = host-python-cffi host-python-maturin
>>> +PYTHON_ORJSON_ENV = \
>>> + $(PKG_CARGO_ENV) \
>>> PYO3_CROSS_LIB_DIR="$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)"
>>> +# We need to vendor the Cargo crates at download time
>>> +PYTHON_ORJSON_DOWNLOAD_POST_PROCESS = cargo
>>> +PYTHON_ORJSON_DOWNLOAD_DEPENDENCIES = host-rustc
>>> +PYTHON_ORJSON_DL_ENV = $(PKG_CARGO_ENV)
>>
>> Is this going to be needed for all maturin packages? If yes, it will make
>> sense to move this into a maturin setup type (but preferably only after we have
>> at least 3 packages that use it).
>
> Yes, I'm planning on adding that along with a setuptools-rust setup type, I have
> some upstream work that should making things clearer as well like this:
> https://github.com/PyO3/maturin/pull/909
>
> I'm going to rework this to handle maturin as well(both are pyo3 build tools):
> https://patchwork.ozlabs.org/project/buildroot/patch/20220501074401.1135229-1-james.hilliard1@gmail.com/
>
>>
>> Regards,
>> Arnout
>>
>>>
>>> -# orjson uses "maturin" to generate distribution packages - rather than teach
>>> -# buildroot how to understand this, we reach in and install directly.
>>> -define PYTHON_ORJSON_INSTALL_TARGET_CMDS
>>> - $(INSTALL) -m 0755 -D $(@D)/target/$(RUSTC_TARGET_NAME)/release/liborjson.so \
>>> - $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/orjson.so
>>> -endef
>>> -
>>> -$(eval $(cargo-package))
>>> +$(eval $(python-package))
More information about the buildroot
mailing list