[meta-python] python3-pyruvate: Fix build with mips/glibc

Message ID 20220126065910.3023993-1-raj.khem@gmail.com
State New
Headers show
Series [meta-python] python3-pyruvate: Fix build with mips/glibc | expand

Commit Message

Khem Raj Jan. 26, 2022, 6:59 a.m. UTC
mips/glibc systems have interesting problem where dev_t is not defined
properly for O32 ABI, therefore address it for libsystemd crate, it
works fine for musl therefore apply it for glibc alone.

network is now required to be enabled since the replacement crate for
systemd will have to be refetched after patching the manifest which
happens during do_patch and hence after do_fetch

Fixes
error[E0308]: mismatched types
   --> /usr/src/debug/python3-pyruvate/1.1.2-r0/cargo_home/bitbake/libsystemd-0.4.1/src/logging.rs:296:25
    |
296 |                 device: stat.st_dev,
    |                         ^^^^^^^^^^^ expected `u64`, found `u32`

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Tim Orling <tim.orling@konsulko.com>
---
 ...-targets-for-stat.st_dev-definitions.patch | 32 +++++++++++++++++++
 .../python/python3-pyruvate_1.1.2.bb          |  2 ++
 2 files changed, 34 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-pyruvate/0001-check-for-mips-targets-for-stat.st_dev-definitions.patch

Patch

diff --git a/meta-python/recipes-devtools/python/python3-pyruvate/0001-check-for-mips-targets-for-stat.st_dev-definitions.patch b/meta-python/recipes-devtools/python/python3-pyruvate/0001-check-for-mips-targets-for-stat.st_dev-definitions.patch
new file mode 100644
index 0000000000..3bd80359f4
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pyruvate/0001-check-for-mips-targets-for-stat.st_dev-definitions.patch
@@ -0,0 +1,32 @@ 
+From 24328cffebbc91bf15fbff51e9c50daf6eede4a7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 25 Jan 2022 22:28:11 -0800
+Subject: [PATCH] check for mips targets for stat.st_dev definitions
+
+See
+https://sourceware.org/bugzilla/show_bug.cgi?id=17786
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/logging.rs | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/logging.rs b/src/logging.rs
+index ed12ce9..535a48f 100644
+--- a/src/logging.rs
++++ b/src/logging.rs
+@@ -293,7 +293,10 @@ impl JournalStream {
+     pub fn from_fd<F: AsRawFd>(fd: F) -> std::io::Result<Self> {
+         nix::sys::stat::fstat(fd.as_raw_fd())
+             .map(|stat| JournalStream {
++        #[cfg(all(not(target_arch = "mips")))]
+                 device: stat.st_dev,
++        #[cfg(all(target_arch = "mips"))]
++                device: stat.st_dev as u64,
+                 inode: stat.st_ino,
+             })
+             .map_err(std::io::Error::from)
+-- 
+2.35.0
+
diff --git a/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb b/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
index dad18b78c2..03bb45e767 100644
--- a/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
+++ b/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
@@ -22,6 +22,8 @@  RUSTFLAGS:append:mipsel = " --cfg crossbeam_no_atomic_64"
 RUSTFLAGS:append:powerpc = " --cfg crossbeam_no_atomic_64"
 RUSTFLAGS:append:riscv32 = " --cfg crossbeam_no_atomic_64"
 
+SRC_URI:append:mips:libc-glibc = " file://0001-check-for-mips-targets-for-stat.st_dev-definitions.patch;patchdir=../cargo_home/bitbake/libsystemd-0.4.1/"
+
 SRC_URI += " \
     crate://crates.io/aho-corasick/0.7.18 \
     crate://crates.io/atty/0.2.14 \