summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core')
-rw-r--r--meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core/0001-Bumps-pyo3-https-github.com-pyo3-pyo3-from-0.20.2-to.patch126
-rw-r--r--meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core/0001-Fix-generate_self_schema-for-Python-3.12-1299.patch29
-rw-r--r--meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core/0001-dont-embed-RUSTFLAGS-in-final-binary-1396.patch58
3 files changed, 58 insertions, 155 deletions
diff --git a/meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core/0001-Bumps-pyo3-https-github.com-pyo3-pyo3-from-0.20.2-to.patch b/meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core/0001-Bumps-pyo3-https-github.com-pyo3-pyo3-from-0.20.2-to.patch
deleted file mode 100644
index 32777e1d03..0000000000
--- a/meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core/0001-Bumps-pyo3-https-github.com-pyo3-pyo3-from-0.20.2-to.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-From a5690f973384bf8cbf4deb3b83d822b7aaefbdd8 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Tue, 27 Feb 2024 11:00:46 -0800
-Subject: [PATCH] Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.20.2 to
- 0.20.3.
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- Cargo.lock | 26 +++++++++++++++++---------
- Cargo.toml | 2 +-
- 2 files changed, 18 insertions(+), 10 deletions(-)
-
---- a/Cargo.lock
-+++ b/Cargo.lock
-@@ -322,6 +322,12 @@ source = "registry+https://github.com/ru
- checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
-
- [[package]]
-+name = "portable-atomic"
-+version = "1.6.0"
-+source = "registry+https://github.com/rust-lang/crates.io-index"
-+checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
-+
-+[[package]]
- name = "proc-macro2"
- version = "1.0.76"
- source = "registry+https://github.com/rust-lang/crates.io-index"
-@@ -357,9 +363,9 @@ dependencies = [
-
- [[package]]
- name = "pyo3"
--version = "0.20.2"
-+version = "0.20.3"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "9a89dc7a5850d0e983be1ec2a463a171d20990487c3cfcd68b5363f1ee3d6fe0"
-+checksum = "53bdbb96d49157e65d45cc287af5f32ffadd5f4761438b527b055fb0d4bb8233"
- dependencies = [
- "cfg-if",
- "indoc",
-@@ -367,6 +373,7 @@ dependencies = [
- "memoffset",
- "num-bigint",
- "parking_lot",
-+ "portable-atomic",
- "pyo3-build-config",
- "pyo3-ffi",
- "pyo3-macros",
-@@ -375,9 +382,9 @@ dependencies = [
-
- [[package]]
- name = "pyo3-build-config"
--version = "0.20.2"
-+version = "0.20.3"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "07426f0d8fe5a601f26293f300afd1a7b1ed5e78b2a705870c5f30893c5163be"
-+checksum = "deaa5745de3f5231ce10517a1f5dd97d53e5a2fd77aa6b5842292085831d48d7"
- dependencies = [
- "once_cell",
- "python3-dll-a",
-@@ -386,9 +393,9 @@ dependencies = [
-
- [[package]]
- name = "pyo3-ffi"
--version = "0.20.2"
-+version = "0.20.3"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "dbb7dec17e17766b46bca4f1a4215a85006b4c2ecde122076c562dd058da6cf1"
-+checksum = "62b42531d03e08d4ef1f6e85a2ed422eb678b8cd62b762e53891c05faf0d4afa"
- dependencies = [
- "libc",
- "pyo3-build-config",
-@@ -396,9 +403,9 @@ dependencies = [
-
- [[package]]
- name = "pyo3-macros"
--version = "0.20.2"
-+version = "0.20.3"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "05f738b4e40d50b5711957f142878cfa0f28e054aa0ebdfc3fd137a843f74ed3"
-+checksum = "7305c720fa01b8055ec95e484a6eca7a83c841267f0dd5280f0c8b8551d2c158"
- dependencies = [
- "proc-macro2",
- "pyo3-macros-backend",
-@@ -408,12 +415,13 @@ dependencies = [
-
- [[package]]
- name = "pyo3-macros-backend"
--version = "0.20.2"
-+version = "0.20.3"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "0fc910d4851847827daf9d6cdd4a823fbdaab5b8818325c5e97a86da79e8881f"
-+checksum = "7c7e9b68bb9c3149c5b0cade5d07f953d6d125eb4337723c4ccdb665f1f96185"
- dependencies = [
- "heck",
- "proc-macro2",
-+ "pyo3-build-config",
- "quote",
- "syn",
- ]
---- a/Cargo.toml
-+++ b/Cargo.toml
-@@ -26,7 +26,7 @@ include = [
- ]
-
- [dependencies]
--pyo3 = { version = "0.20.2", features = ["generate-import-lib", "num-bigint"] }
-+pyo3 = { version = "0.20.3", features = ["generate-import-lib", "num-bigint"] }
- regex = "1.10.2"
- strum = { version = "0.25.0", features = ["derive"] }
- strum_macros = "0.25.3"
-@@ -70,12 +70,12 @@ debug = true
- strip = false
-
- [dev-dependencies]
--pyo3 = { version = "0.20.2", features = ["auto-initialize"] }
-+pyo3 = { version = "0.20.3", features = ["auto-initialize"] }
-
- [build-dependencies]
- version_check = "0.9.4"
- # used where logic has to be version/distribution specific, e.g. pypy
--pyo3-build-config = { version = "0.20.2" }
-+pyo3-build-config = { version = "0.20.3" }
-
- [lints.clippy]
- dbg_macro = "warn"
diff --git a/meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core/0001-Fix-generate_self_schema-for-Python-3.12-1299.patch b/meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core/0001-Fix-generate_self_schema-for-Python-3.12-1299.patch
deleted file mode 100644
index f6aa18e303..0000000000
--- a/meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core/0001-Fix-generate_self_schema-for-Python-3.12-1299.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 0dcca2ed6a83ebbc944ec8cbd2f67ffec8043461 Mon Sep 17 00:00:00 2001
-From: Jelle Zijlstra <jelle.zijlstra@gmail.com>
-Date: Wed, 22 May 2024 07:44:10 -0700
-Subject: [PATCH] Fix generate_self_schema for Python 3.12+ (#1299)
-
-Upstream-Status: Backport [https://github.com/pydantic/pydantic-core/commit/a7620419383a69bd2b28ab953c9a17f6ed35bb9a]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- generate_self_schema.py | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/generate_self_schema.py b/generate_self_schema.py
-index 8d27247..109fca0 100644
---- a/generate_self_schema.py
-+++ b/generate_self_schema.py
-@@ -189,7 +189,12 @@ def all_literal_values(type_: type[core_schema.Literal]) -> list[any]:
-
- def eval_forward_ref(type_: Any) -> Any:
- try:
-- return type_._evaluate(core_schema.__dict__, None, set())
-+ try:
-+ # Python 3.12+
-+ return type_._evaluate(core_schema.__dict__, None, type_params=set(), recursive_guard=set())
-+ except TypeError:
-+ # Python 3.9+
-+ return type_._evaluate(core_schema.__dict__, None, set())
- except TypeError:
- # for Python 3.8
- return type_._evaluate(core_schema.__dict__, None)
diff --git a/meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core/0001-dont-embed-RUSTFLAGS-in-final-binary-1396.patch b/meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core/0001-dont-embed-RUSTFLAGS-in-final-binary-1396.patch
new file mode 100644
index 0000000000..5d732d5bee
--- /dev/null
+++ b/meta-openembedded/meta-python/recipes-devtools/python/python3-pydantic-core/0001-dont-embed-RUSTFLAGS-in-final-binary-1396.patch
@@ -0,0 +1,58 @@
+From e07c41b3bad75948201a2201387225694c2fb501 Mon Sep 17 00:00:00 2001
+From: Boxy <rust@boxyuwu.dev>
+Date: Wed, 7 Aug 2024 17:11:02 +0100
+Subject: [PATCH] dont embed `RUSTFLAGS` in final binary (#1396)
+
+Upstream-Status: Backport [https://github.com/pydantic/pydantic-core/pull/1396]
+
+See discussion upstream in:
+https://github.com/pydantic/pydantic-core/issues/1365
+
+Backport fix from:
+https://github.com/pydantic/pydantic-core/commit/e07c41b3bad75948201a2201387225694c2fb501
+
+Signed-off-by: Tim Orling <tim.orling@konsulko.com>
+---
+ build.rs | 9 +++++++++
+ src/lib.rs | 5 ++++-
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/build.rs b/build.rs
+index d1093c74..f8f66901 100644
+--- a/build.rs
++++ b/build.rs
+@@ -36,6 +36,15 @@ fn main() {
+ println!("cargo:rustc-cfg=has_coverage_attribute");
+ }
+ println!("cargo:rustc-check-cfg=cfg(has_coverage_attribute)");
++
++ if std::env::var("RUSTFLAGS")
++ .unwrap_or_default()
++ .contains("-Cprofile-use=")
++ {
++ println!("cargo:rustc-cfg=specified_profile_use");
++ }
++ println!("cargo:rustc-check-cfg=cfg(specified_profile_use)");
++
+ generate_self_schema();
+ println!("cargo:rustc-env=PROFILE={}", std::env::var("PROFILE").unwrap());
+ }
+diff --git a/src/lib.rs b/src/lib.rs
+index eb598424..eb486da6 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -98,7 +98,10 @@ pub fn build_info() -> String {
+ format!(
+ "profile={} pgo={}",
+ env!("PROFILE"),
+- option_env!("RUSTFLAGS").unwrap_or("").contains("-Cprofile-use="),
++ // We use a `cfg!` here not `env!`/`option_env!` as those would
++ // embed `RUSTFLAGS` into the generated binary which causes problems
++ // with reproducable builds.
++ cfg!(specified_profile_use),
+ )
+ }
+
+--
+2.46.0
+