All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Alexander Kanavin <alex.kanavin@gmail.com>
Cc: openembedded-core@lists.openembedded.org,
	Alexander Kanavin <alex@linutronix.de>
Subject: Re: [OE-core] [PATCH 13/55] glib-2.0: backport a patch to address ptest fails caused by coreutils 9.2+
Date: Fri, 16 Jun 2023 00:26:59 +0200	[thread overview]
Message-ID: <20230615222659f26b3e59@mail.local> (raw)
In-Reply-To: <20230614092918.4065570-13-alex@linutronix.de>

Hello,

Which ptest are you trying to fix?

I got:
https://autobuilder.yoctoproject.org/typhoon/#/builders/82/builds/5023/steps/13/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/81/builds/5207/steps/12/logs/stdio
{'glib-2.0': ['glib/file.test']}

On 14/06/2023 11:28:36+0200, Alexander Kanavin wrote:
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
>  ...pparent-size-only-for-files-and-syml.patch | 105 ++++++++++++++++++
>  meta/recipes-core/glib-2.0/glib-2.0_2.76.3.bb |   1 +
>  2 files changed, 106 insertions(+)
>  create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/0001-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch
> 
> diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0001-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch b/meta/recipes-core/glib-2.0/glib-2.0/0001-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch
> new file mode 100644
> index 00000000000..a881b25ef3e
> --- /dev/null
> +++ b/meta/recipes-core/glib-2.0/glib-2.0/0001-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch
> @@ -0,0 +1,105 @@
> +From d1a2117dc18dbcf87685891de7e2898108b66fc9 Mon Sep 17 00:00:00 2001
> +From: Joan Bruguera <joanbrugueram@gmail.com>
> +Date: Thu, 23 Mar 2023 02:24:30 +0000
> +Subject: [PATCH] glocalfile: Sum apparent size only for files and symlinks
> +
> +Since GNU Coreutils 9.2 (commit 110bcd28386b1f47a4cd876098acb708fdcbbb25),
> +`du --apparent-size` (including `du --bytes`) no longer counts all kinds of
> +files (directories, FIFOs, etc.), but only those for which `st_size` in
> +`struct stat` is defined by POSIX, namely regular files and symlinks
> +(and also rarely supported memory objects).
> +
> +This aligns the behaviour of GLib's `G_FILE_MEASURE_APPARENT_SIZE` flag
> +with the new GNU Coreutils `du` and correct POSIX use.
> +
> +Note that this may be a breaking change for some uses.
> +
> +Link: https://lists.gnu.org/archive/html/bug-coreutils/2023-03/msg00007.html
> +Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2965
> +
> +Upstream-Status: Backport
> +Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> +---
> + gio/gioenums.h   |  3 +++
> + gio/glocalfile.c | 37 +++++++++++++++++++++++++++++++++++++
> + 2 files changed, 40 insertions(+)
> +
> +diff --git a/gio/gioenums.h b/gio/gioenums.h
> +index 7fd74a43e..c820cd36d 100644
> +--- a/gio/gioenums.h
> ++++ b/gio/gioenums.h
> +@@ -224,6 +224,9 @@ typedef enum {
> +  *   sizes.  Normally, the block-size is used, if available, as this is a
> +  *   more accurate representation of disk space used.
> +  *   Compare with `du --apparent-size`.
> ++ *   Since GLib 2.78. and similarly to `du` since GNU Coreutils 9.2, this will
> ++ *   ignore the sizes of file types other than regular files and links, as the
> ++ *   sizes of other file types are not specified in a standard way.
> +  * @G_FILE_MEASURE_NO_XDEV: Do not cross mount point boundaries.
> +  *   Compare with `du -x`.
> +  *
> +diff --git a/gio/glocalfile.c b/gio/glocalfile.c
> +index 67d4b99fb..dbb56902d 100644
> +--- a/gio/glocalfile.c
> ++++ b/gio/glocalfile.c
> +@@ -86,6 +86,9 @@
> + #define FILE_READ_ONLY_VOLUME           0x00080000
> + #endif
> + 
> ++#ifndef S_ISREG
> ++#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
> ++#endif
> + #ifndef S_ISDIR
> + #define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
> + #endif
> +@@ -2777,6 +2780,39 @@ g_local_file_measure_size_of_contents (gint           fd,
> +                                        MeasureState  *state,
> +                                        GError       **error);
> + 
> ++/*
> ++ * _g_stat_is_size_usable:
> ++ * @buf: a #GLocalFileStat.
> ++ *
> ++ * Checks if the file type is such that the `st_size` field of `struct stat` is
> ++ * well-defined by POSIX.
> ++ * (see https://pubs.opengroup.org/onlinepubs/009696799/basedefs/sys/stat.h.html)
> ++ *
> ++ * This behaviour is aligned with `du` from GNU Coreutils 9.2+
> ++ * (see https://lists.gnu.org/archive/html/bug-coreutils/2023-03/msg00007.html)
> ++ * and makes apparent size sums well-defined; formerly, they depended on the
> ++ * implementation, and could differ across filesystems.
> ++ *
> ++ * Returns: %TRUE if the size field is well-defined, %FALSE otherwise.
> ++ **/
> ++inline static gboolean
> ++_g_stat_is_size_usable (const GLocalFileStat *buf)
> ++{
> ++#ifndef HAVE_STATX
> ++  /* Memory objects are defined by POSIX, but are not supported by statx nor Windows */
> ++#ifdef S_TYPEISSHM
> ++  if (S_TYPEISSHM (buf))
> ++    return TRUE;
> ++#endif
> ++#ifdef S_TYPEISTMO
> ++  if (S_TYPEISTMO (buf))
> ++    return TRUE;
> ++#endif
> ++#endif
> ++
> ++  return S_ISREG (_g_stat_mode (buf)) || S_ISLNK (_g_stat_mode (buf));
> ++}
> ++
> + static gboolean
> + g_local_file_measure_size_of_file (gint           parent_fd,
> +                                    GSList        *name,
> +@@ -2836,6 +2872,7 @@ g_local_file_measure_size_of_file (gint           parent_fd,
> +     state->disk_usage += _g_stat_blocks (&buf) * G_GUINT64_CONSTANT (512);
> +   else
> + #endif
> ++  if (_g_stat_is_size_usable (&buf))
> +     state->disk_usage += _g_stat_size (&buf);
> + 
> +   if (S_ISDIR (_g_stat_mode (&buf)))
> +-- 
> +2.39.2
> +
> diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.76.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.76.3.bb
> index a60e7688367..4327a133450 100644
> --- a/meta/recipes-core/glib-2.0/glib-2.0_2.76.3.bb
> +++ b/meta/recipes-core/glib-2.0/glib-2.0_2.76.3.bb
> @@ -15,6 +15,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
>             file://0001-meson-Run-atomics-test-on-clang-as-well.patch \
>             file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \
>             file://0001-gio-tests-portal-support-Fix-snap-test-ordering-race.patch \
> +           file://0001-glocalfile-Sum-apparent-size-only-for-files-and-syml.patch \
>             "
>  SRC_URI:append:class-native = " file://relocate-modules.patch"
>  
> -- 
> 2.30.2
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#182758): https://lists.openembedded.org/g/openembedded-core/message/182758
> Mute This Topic: https://lists.openembedded.org/mt/99524149/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


  reply	other threads:[~2023-06-15 22:27 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14  9:28 [PATCH 01/55] insane.bbclass: add a SUMMARY/HOMEPAGE check (oe-core recipes only) Alexander Kanavin
2023-06-14  9:28 ` [PATCH 02/55] insane.bbclass: add a RECIPE_MAINTAINER " Alexander Kanavin
2023-06-14  9:28 ` [PATCH 03/55] apmd: remove recipe and apm MACHINE_FEATURE Alexander Kanavin
2023-06-14  9:28 ` [PATCH 04/55] qemu: a pending patch was submitted and accepted upstream Alexander Kanavin
2023-06-14  9:28 ` [PATCH 05/55] sysfsutils: fetch a supported fork from github Alexander Kanavin
2023-06-14  9:28 ` [PATCH 06/55] sysfsutils: update 2.1.0 -> 2.1.1 Alexander Kanavin
2023-06-15 15:10   ` [OE-core] " Ross Burton
2023-06-15 15:24     ` Ross Burton
2023-06-15 17:40       ` Alexander Kanavin
2023-06-14  9:28 ` [PATCH 07/55] grub: submit determinism.patch upstream Alexander Kanavin
2023-06-14  9:28 ` [PATCH 08/55] ghostscript: remove mkdir-p.patch Alexander Kanavin
2023-06-16 10:39   ` [OE-core] " Ross Burton
2023-06-14  9:28 ` [PATCH 09/55] apr: upgrade 1.7.3 -> 1.7.4 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 10/55] at-spi2-core: upgrade 2.48.0 -> 2.48.3 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 11/55] btrfs-tools: upgrade 6.3 -> 6.3.1 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 12/55] attr: package /etc/xattr.conf with the library that consumes it Alexander Kanavin
2023-06-14  9:28 ` [PATCH 13/55] glib-2.0: backport a patch to address ptest fails caused by coreutils 9.2+ Alexander Kanavin
2023-06-15 22:26   ` Alexandre Belloni [this message]
2023-06-15 22:34     ` [OE-core] " Alexandre Belloni
2023-06-16  8:17       ` Alexander Kanavin
2023-06-14  9:28 ` [PATCH 14/55] coreutils: upgrade 9.1 -> 9.3 Alexander Kanavin
2023-06-15  8:14   ` [OE-core] " Ross Burton
2023-06-15  8:57     ` Alexander Kanavin
2023-06-14  9:28 ` [PATCH 15/55] diffoscope: upgrade 236 -> 242 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 16/55] dnf: upgrade 4.14.0 -> 4.16.1 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 17/55] ethtool: upgrade 6.2 -> 6.3 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 18/55] gawk: upgrade 5.2.1 -> 5.2.2 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 19/55] gdb: upgrade 13.1 -> 13.2 Alexander Kanavin
2023-06-14 17:12   ` [OE-core] " Khem Raj
2023-06-14  9:28 ` [PATCH 20/55] gnupg: upgrade 2.4.0 -> 2.4.2 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 21/55] gobject-introspection: upgrade 1.74.0 -> 1.76.1 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 22/55] kmscube: upgrade to latest revision Alexander Kanavin
2023-06-14  9:28 ` [PATCH 23/55] libmodulemd: upgrade 2.14.0 -> 2.15.0 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 24/55] libuv: license file was split in two in the 1.45.0 version update Alexander Kanavin
2023-06-14  9:28 ` [PATCH 25/55] libx11: upgrade 1.8.4 -> 1.8.5 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 26/55] libxcrypt: upgrade 4.4.33 -> 4.4.34 Alexander Kanavin
2023-06-14 17:11   ` [OE-core] " Khem Raj
2023-06-15  7:24     ` Alexander Kanavin
2023-06-14  9:28 ` [PATCH 27/55] libxslt: upgrade 1.1.37 -> 1.1.38 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 28/55] linux-firmware: upgrade 20230404 -> 20230515 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 29/55] ltp: upgrade 20230127 -> 20230516 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 30/55] mesa: upgrade 23.0.3 -> 23.1.1 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 31/55] meson: upgrade 1.1.0 -> 1.1.1 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 32/55] mmc-utils: upgrade to latest revision Alexander Kanavin
2023-06-14  9:28 ` [PATCH 33/55] nettle: upgrade 3.8.1 -> 3.9 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 34/55] nghttp2: upgrade 1.52.0 -> 1.53.0 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 35/55] parted: upgrade 3.5 -> 3.6 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 36/55] puzzles: upgrade to latest revision Alexander Kanavin
2023-06-14  9:29 ` [PATCH 37/55] python3: upgrade 3.11.2 -> 3.11.3 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 38/55] python3-certifi: upgrade 2022.12.7 -> 2023.5.7 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 39/55] python3-docutils: upgrade 0.19 -> 0.20.1 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 40/55] python3-flit-core: upgrade 3.8.0 -> 3.9.0 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 41/55] python3-importlib-metadata: upgrade 6.2.0 -> 6.6.0 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 42/55] python3-pyasn1: upgrade 0.4.8 -> 0.5.0 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 43/55] python3-pyopenssl: upgrade 23.1.1 -> 23.2.0 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 44/55] python3-sphinx: remove BSD-3-Clause from LICENSE Alexander Kanavin
2023-06-14  9:29 ` [PATCH 45/55] serf: upgrade 1.3.9 -> 1.3.10 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 46/55] shaderc: upgrade 2023.2 -> 2023.4 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 47/55] squashfs-tools: upgrade 4.5.1 -> 4.6.1 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 48/55] strace: upgrade 6.2 -> 6.3 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 49/55] vala: upgrade 0.56.6 -> 0.56.8 Alexander Kanavin
2023-06-16 16:51   ` [OE-core] " Khem Raj
2023-06-14  9:29 ` [PATCH 50/55] vulkan: upgrade 1.3.243.0 -> 1.3.250.0 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 51/55] wget: upgrade 1.21.3 -> 1.21.4 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 52/55] wireless-regdb: upgrade 2023.02.13 -> 2023.05.03 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 53/55] xf86-input-libinput: upgrade 1.2.1 -> 1.3.0 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 54/55] xf86-input-mouse: upgrade 1.9.4 -> 1.9.5 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 55/55] zstd: upgrade 1.5.4 -> 1.5.5 Alexander Kanavin
2023-06-14 11:33 ` [OE-core] [PATCH 01/55] insane.bbclass: add a SUMMARY/HOMEPAGE check (oe-core recipes only) Richard Purdie
2023-06-14 15:02   ` Ross Burton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230615222659f26b3e59@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=alex.kanavin@gmail.com \
    --cc=alex@linutronix.de \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.