python3-pydantic-core: fix TMPDIR path reference
PATCH 1/1 python3-pydantic-core: fix TMPDIR path reference
Backport a new upstream fix to remove the TMPDIR
reference from the rust code.
--- ...Dont-embed-RUSTFLAGS-in-final-binary.patch | 47 +++++++++++++++++++ .../python/python3-pydantic-core_2.18.4.bb | 4 +- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 meta-python/recipes-devtools/python/python3-pydantic-core/0002-Dont-embed-RUSTFLAGS-in-final-binary.patch
meta-python/recipes-devtools/python/python3-pydantic-core/0002-Dont-embed-RUSTFLAGS-in-final-binary.patch new file +47 -0
@@ -0,0 +1,47 @@ +From b3282b301096253a11b1f887f915d0a2a2183597 Mon Sep 17 00:00:00 2001 +From: Frank de Brabander <[email protected]> +Date: Thu, 8 Aug 2024 08:04:48 +0200 +Subject: [PATCH] Dont embed RUSTFLAGS in final binary + +Upstream-Status: Backport [https://github.com/pydantic/pydantic-core/commit/e07c41b3bad75948201a2201387225694c2fb501] +--- + build.rs | 9 +++++++++ + src/lib.rs | 5 ++++- + 2 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/build.rs b/build.rs +index 7f59e1f..7fe6490 100644 +--- a/build.rs ++++ b/build.rs +@@ -35,6 +35,15 @@ fn main() { + if let Some(true) = version_check::supports_feature("coverage_attribute") { + println!("cargo:rustc-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 d55e836..206a7a1 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -111,7 +111,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), + ) + } +
meta-python/recipes-devtools/python/python3-pydantic-core_2.18.4.bb +2 -2
@@ -8,7 +8,8 @@ HOMEPAGE = "https://github.com/pydantic/pydantic-core" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=ab599c188b4a314d2856b3a55030c75c" -SRC_URI += "file://0001-Set-rust-version-from-1.76-to-1.75-in-Cargo.toml.patch" +SRC_URI += "file://0001-Set-rust-version-from-1.76-to-1.75-in-Cargo.toml.patch \ + file://0002-Dont-embed-RUSTFLAGS-in-final-binary.patch" SRC_URI[sha256sum] = "ec3beeada09ff865c344ff3bc2f427f5e6c26401cc6113d77e372c3fdac73864" DEPENDS = "python3-maturin-native python3-typing-extensions"
@@ -25,7 +26,6 @@ RDEPENDS:${PN} += " \ " INSANE_SKIP:${PN} = "already-stripped" -INSANE_SKIP:${PN} += "buildpaths" inherit ptest SRC_URI += "file://run-ptest"
Signature · 1 line
2.39.2
I just included this in a new series to upgrade python3-pydantic-core and python3-pydantic. I'd prefer we take that series instead, so I can stop churning on this.
However, this patch should be backported to scarthgap. I will work on that series next.
Quoted 115 lines · Frank de Brabander via lists.openembedded.org
Backport a new upstream fix to remove the TMPDIR
reference from the rust code.Signed-off-by Frank de Brabander <[email protected]>--- ...Dont-embed-RUSTFLAGS-in-final-binary.patch | 47 +++++++++++++++++++ .../python/python3-pydantic-core_2.18.4.bb | 4 +- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644
meta-python/recipes-devtools/python/python3-pydantic-core/0002-Dont-embed-RUSTFLAGS-in-final-binary.patchdiff --git
a/meta-python/recipes-devtools/python/python3-pydantic-core/0002-Dont-embed-RUSTFLAGS-in-final-binary.patchb/meta-python/recipes-devtools/python/python3-pydantic-core/0002-Dont-embed-RUSTFLAGS-in-final-binary.patchnew file mode 100644
index 000000000..1c195e294
---/dev/null
+++b/meta-python/recipes-devtools/python/python3-pydantic-core/0002-Dont-embed-RUSTFLAGS-in-final-binary.patchmeta-python/recipes-devtools/python/python3-pydantic-core/0002-Dont-embed-RUSTFLAGS-in-final-binary.patch new file +6
-0@@ -0,0 +1,47 @@ +From b3282b301096253a11b1f887f915d0a2a2183597 Mon Sep 17 00:00:00 2001 +From: Frank de Brabander <[email protected]> +Date: Thu, 8 Aug 2024 08:04:48 +0200 +Subject: [PATCH] Dont embed RUSTFLAGS in final binary + +Upstream-Status: Backport [https://github.com/pydantic/pydantic-core/commit/e07c41b3bad75948201a2201387225694c2fb501
]+--- + build.rs | 9 +++++++++ + src/lib.rs | 5 ++++-+ 2 files changed, 13 insertions(+), 1 deletion(-)
meta-python/recipes-devtools/python/python3-pydantic-core/0002-Dont-embed-RUSTFLAGS-in-final-binary.patch new file +7
-0+ +diff --git a/build.rs b/build.rs +index 7f59e1f..7fe6490 100644 +--- a/build.rs ++++ b/build.rs +@@ -35,6 +35,15 @@ fn main() { + if let Some(true) =
version_check::supports_feature("coverage_attribute"){meta-python/recipes-devtools/python/python3-pydantic-core/0002-Dont-embed-RUSTFLAGS-in-final-binary.patch new file +13
-0+ println!("cargo:rustc-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());
+ }meta-python/recipes-devtools/python/python3-pydantic-core/0002-Dont-embed-RUSTFLAGS-in-final-binary.patch new file +9
-0+diff --git a/src/lib.rs b/src/lib.rs +index d55e836..206a7a1 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -111,7 +111,10 @@ pub fn build_info() -> String { + format!( + "profile={} pgo={}", + env!("PROFILE"), +-option_env!("RUSTFLAGS").unwrap_or("").contains("-Cprofile-use="),
++ // We use acfg!here notenv!/option_env!as those would
++ // embedRUSTFLAGSinto the generated binary which causes
problems
++ // with reproducable builds.
++ cfg!(specified_profile_use),meta-python/recipes-devtools/python/python3-pydantic-core/0002-Dont-embed-RUSTFLAGS-in-final-binary.patch new file +3
-0+ ) + } +(quoted diff) +0
-0python3-pydantic-core_2.18.4.bb b/meta-python/recipes-devtools/python/ python3-pydantic-core_2.18.4.bb
indexeb5599199..0ab1873a0100644meta-python/recipes-devtools/python/python3-pydantic-core_2.18.4.bb +0
-1@@ -8,7 +8,8 @@ HOMEPAGE = "https://github.com/pydantic/pydantic-core" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=ab599c188b4a314d2856b3a55030c75c" -SRC_URI +="file://0001-Set-rust-version-from-1.76-to-1.75-in-Cargo.toml.patch" +SRC_URI += "file://0001-Set-rust-version-from-1.76-to-1.75-in-Cargo.toml.patch \
+ file://0002-Dont-embed-RUSTFLAGS-in-final-binary.patch"
SRC_URI[sha256sum] =
"ec3beeada09ff865c344ff3bc2f427f5e6c26401cc6113d77e372c3fdac73864"DEPENDS = "python3-maturin-native python3-typing-extensions"
meta-python/recipes-devtools/python/python3-pydantic-core_2.18.4.bb +0
-2@@ -25,7 +26,6 @@ RDEPENDS:${PN} += " \ " INSANE_SKIP:${PN} = "already-stripped" -INSANE_SKIP:${PN} += "buildpaths" inherit ptest SRC_URI += "file://run-ptest" --2.39.2
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#111648):
https://lists.openembedded.org/g/openembedded-devel/message/111648
Mute This Topic: https://lists.openembedded.org/mt/107786340/924729
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-