Files
meta-openembedded/meta-python/recipes-devtools/python/python3-orjson/0002-Guard-x86-feature-detection-macro-in-pystrref-object.patch
Tim Orling 6c19c5e0d4 python3-orjson: upgrade 3.10.17 -> 3.11.6
Update python3-orjson-crates.inc

Add patches to fix compilation for arm64/riscv64 by gating x86/x86_64 only
AVX512 feature(s). The approach has thus far been rejected by upstream:
https://github.com/ijl/orjson/pull/609.

Release Notes:
https://github.com/ijl/orjson/blob/master/CHANGELOG.md#3116---2026-01-29

* orjson now includes code licensed under the Mozilla Public License 2.0
  (MPL-2.0).
* Drop support for Python 3.9.
* ABI compatibility with CPython 3.15 alpha 5.
* Build now depends on Rust 1.89 or later instead of 1.85.
* Fix sporadic crash serializing deeply nested list of dict.
* Show simple error message instead of traceback when attempting to build
  on unsupported Python versions.
* ABI compatibility with CPython 3.15 alpha 1.
* Publish PyPI wheels for 3.14 and manylinux i686, manylinux arm7, manylinux
  ppc64le, manylinux s390x.
* Build now requires a C compiler.
* Fix PyPI project metadata when using maturin 1.9.2 or later.
* Fix build using Rust 1.89 on amd64.
* Build now depends on Rust 1.85 or later instead of 1.82.
* Publish PyPI wheels for CPython 3.14.
* Fix str on big-endian architectures. This was introduced in 3.11.0.
* Use a deserialization buffer allocated per request instead of a shared
  buffer allocated on import.
* ABI compatibility with CPython 3.14 beta 4.
* Fix incorrect escaping of the vertical tabulation character. This was
  introduced in 3.10.17.

Comparing changes:
https://github.com/ijl/orjson/compare/3.10.17...3.11.6

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2026-02-04 21:01:38 -08:00

35 lines
1.3 KiB
Diff

From 7ef16220caaa82f7a90047c8c9b5ff2eeb15b9ce Mon Sep 17 00:00:00 2001
From: Tim Orling <tim.orling@konsulko.com>
Date: Thu, 29 Jan 2026 10:22:31 -0800
Subject: [PATCH 2/2] Guard x86 feature detection macro in pystrref/object.rs
The std::is_x86_feature_detected! macro only works on x86/x86_64
targets. This patch wraps the feature detection and AVX-512 code path
with cfg guards to allow compilation on non-x86 architectures.
On non-x86 targets, the code will fall through to the generic
implementation instead of attempting AVX-512 optimizations.
Upstream-Status: Inappropriate [Rejected by upstream https://github.com/ijl/orjson/pull/609]
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
src/ffi/pystrref/object.rs | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/ffi/pystrref/object.rs b/src/ffi/pystrref/object.rs
index 9ef12eb..7c2c046 100644
--- a/src/ffi/pystrref/object.rs
+++ b/src/ffi/pystrref/object.rs
@@ -29,6 +29,7 @@ static mut STR_CREATE_FN: StrDeserializer = super::scalar::str_impl_kind_scalar;
pub fn set_str_create_fn() {
unsafe {
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[cfg(all(CPython, feature = "avx512"))]
if std::is_x86_feature_detected!("avx512vl") {
STR_CREATE_FN = super::avx512::create_str_impl_avx512vl;
--
2.39.5