diff mbox series

[meta-oe] nvme-cli: Fix musl build erros for v2.11

Message ID 20241121121412.490051-1-ryosuke.saito@linaro.org
State Under Review
Headers show
Series [meta-oe] nvme-cli: Fix musl build erros for v2.11 | expand

Commit Message

Ryosuke Saito Nov. 21, 2024, 12:13 p.m. UTC
Backport two patches from https://github.com/linux-nvme/nvme-cli to
resolve musl build errors in v2.11:

  - 0001-nvme-print-add-fallback-for-non-standard-locale-cate.patch
  - 0002-plugins-netapp-add-include-of-libgen.h-for-basename-.patch

Signed-off-by: Ryosuke Saito <ryosuke.saito@linaro.org>
---
 ...allback-for-non-standard-locale-cate.patch | 39 +++++++++++++++++++
 ...dd-include-of-libgen.h-for-basename-.patch | 34 ++++++++++++++++
 meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.11.bb |  4 +-
 3 files changed, 76 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-nvme-print-add-fallback-for-non-standard-locale-cate.patch
 create mode 100644 meta-oe/recipes-bsp/nvme-cli/nvme-cli/0002-plugins-netapp-add-include-of-libgen.h-for-basename-.patch

Comments

Khem Raj Nov. 21, 2024, 4:17 p.m. UTC | #1
I was seeing these build failures in CI, thanks for the patch.

On Thu, Nov 21, 2024 at 4:14 AM Ryosuke Saito via
lists.openembedded.org
<ryosuke.saito=linaro.org@lists.openembedded.org> wrote:
>
> Backport two patches from https://github.com/linux-nvme/nvme-cli to
> resolve musl build errors in v2.11:
>
>   - 0001-nvme-print-add-fallback-for-non-standard-locale-cate.patch
>   - 0002-plugins-netapp-add-include-of-libgen.h-for-basename-.patch
>
> Signed-off-by: Ryosuke Saito <ryosuke.saito@linaro.org>
> ---
>  ...allback-for-non-standard-locale-cate.patch | 39 +++++++++++++++++++
>  ...dd-include-of-libgen.h-for-basename-.patch | 34 ++++++++++++++++
>  meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.11.bb |  4 +-
>  3 files changed, 76 insertions(+), 1 deletion(-)
>  create mode 100644 meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-nvme-print-add-fallback-for-non-standard-locale-cate.patch
>  create mode 100644 meta-oe/recipes-bsp/nvme-cli/nvme-cli/0002-plugins-netapp-add-include-of-libgen.h-for-basename-.patch
>
> diff --git a/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-nvme-print-add-fallback-for-non-standard-locale-cate.patch b/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-nvme-print-add-fallback-for-non-standard-locale-cate.patch
> new file mode 100644
> index 000000000000..981acb1b81f1
> --- /dev/null
> +++ b/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-nvme-print-add-fallback-for-non-standard-locale-cate.patch
> @@ -0,0 +1,39 @@
> +From 9444ce03a27b8d423f8170cf75f56d48d8a0a659 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Daniel=20N=C3=A9ri?= <dne+commits@rb67.eu>
> +Date: Mon, 11 Nov 2024 23:06:03 +0100
> +Subject: [PATCH] nvme-print: add fallback for non-standard locale category
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +LC_MEASUREMENT is a GNU (libc) extension - fall back to LC_ALL if it's
> +not defined.
> +
> +Fixes build with musl libc
> +
> +Signed-off-by: Daniel Néri <dne+commits@rb67.eu>
> +
> +Upstream-Status: Backport [https://github.com/linux-nvme/nvme-cli/commit/9444ce03a27b8d423f8170cf75f56d48d8a0a659]
> +Signed-off-by: Ryosuke Saito <ryosuke.saito@linaro.org>
> +---
> + nvme-print.c | 4 ++++
> + 1 file changed, 4 insertions(+)
> +
> +diff --git a/nvme-print.c b/nvme-print.c
> +index 170e5c12fb22..5b1f2e827aef 100644
> +--- a/nvme-print.c
> ++++ b/nvme-print.c
> +@@ -797,6 +797,10 @@ static bool is_fahrenheit_country(const char *country)
> +       return false;
> + }
> +
> ++#ifndef LC_MEASUREMENT
> ++#define LC_MEASUREMENT LC_ALL
> ++#endif
> ++
> + static bool is_temperature_fahrenheit(void)
> + {
> +       const char *locale, *underscore;
> +--
> +2.47.0
> +
> diff --git a/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0002-plugins-netapp-add-include-of-libgen.h-for-basename-.patch b/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0002-plugins-netapp-add-include-of-libgen.h-for-basename-.patch
> new file mode 100644
> index 000000000000..42ca7f534092
> --- /dev/null
> +++ b/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0002-plugins-netapp-add-include-of-libgen.h-for-basename-.patch
> @@ -0,0 +1,34 @@
> +From ac4818952c872ba465a2d0f48634f9a79aae064f Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Daniel=20N=C3=A9ri?= <dne+commits@rb67.eu>
> +Date: Mon, 11 Nov 2024 22:34:57 +0100
> +Subject: [PATCH] plugins/netapp: add include of libgen.h for basename(3)
> + prototype
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Fixes build with musl libc.
> +
> +Signed-off-by: Daniel Néri <dne+commits@rb67.eu>
> +
> +Upstream-Status: Backport [https://github.com/linux-nvme/nvme-cli/commit/ac4818952c872ba465a2d0f48634f9a79aae064f]
> +Signed-off-by: Ryosuke Saito <ryosuke.saito@linaro.org>
> +---
> + plugins/netapp/netapp-nvme.c | 1 +
> + 1 file changed, 1 insertion(+)
> +
> +diff --git a/plugins/netapp/netapp-nvme.c b/plugins/netapp/netapp-nvme.c
> +index 5c2e3d4989b8..9f05ffc5d97e 100644
> +--- a/plugins/netapp/netapp-nvme.c
> ++++ b/plugins/netapp/netapp-nvme.c
> +@@ -22,6 +22,7 @@
> + #include <unistd.h>
> + #include <errno.h>
> + #include <string.h>
> ++#include <libgen.h>
> +
> + #include "common.h"
> + #include "nvme.h"
> +--
> +2.47.0
> +
> diff --git a/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.11.bb b/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.11.bb
> index 13b7c4227e8c..7c030cd847f8 100644
> --- a/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.11.bb
> +++ b/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.11.bb
> @@ -8,7 +8,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=8264535c0c4e9c6c335635c4026a8022 \
>  DEPENDS = "json-c libnvme"
>  SRCREV = "9f34fcb12e3ab098e9b30e0f31e92cefb497cc42"
>
> -SRC_URI = "git://github.com/linux-nvme/nvme-cli.git;branch=master;protocol=https"
> +SRC_URI = "git://github.com/linux-nvme/nvme-cli.git;branch=master;protocol=https \
> +           file://0001-nvme-print-add-fallback-for-non-standard-locale-cate.patch \
> +           file://0002-plugins-netapp-add-include-of-libgen.h-for-basename-.patch"
>
>  S = "${WORKDIR}/git"
>
> --
> 2.47.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#113969): https://lists.openembedded.org/g/openembedded-devel/message/113969
> Mute This Topic: https://lists.openembedded.org/mt/109702243/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-nvme-print-add-fallback-for-non-standard-locale-cate.patch b/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-nvme-print-add-fallback-for-non-standard-locale-cate.patch
new file mode 100644
index 000000000000..981acb1b81f1
--- /dev/null
+++ b/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-nvme-print-add-fallback-for-non-standard-locale-cate.patch
@@ -0,0 +1,39 @@ 
+From 9444ce03a27b8d423f8170cf75f56d48d8a0a659 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20N=C3=A9ri?= <dne+commits@rb67.eu>
+Date: Mon, 11 Nov 2024 23:06:03 +0100
+Subject: [PATCH] nvme-print: add fallback for non-standard locale category
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+LC_MEASUREMENT is a GNU (libc) extension - fall back to LC_ALL if it's
+not defined.
+
+Fixes build with musl libc
+
+Signed-off-by: Daniel Néri <dne+commits@rb67.eu>
+
+Upstream-Status: Backport [https://github.com/linux-nvme/nvme-cli/commit/9444ce03a27b8d423f8170cf75f56d48d8a0a659]
+Signed-off-by: Ryosuke Saito <ryosuke.saito@linaro.org>
+---
+ nvme-print.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/nvme-print.c b/nvme-print.c
+index 170e5c12fb22..5b1f2e827aef 100644
+--- a/nvme-print.c
++++ b/nvme-print.c
+@@ -797,6 +797,10 @@ static bool is_fahrenheit_country(const char *country)
+ 	return false;
+ }
+ 
++#ifndef LC_MEASUREMENT
++#define LC_MEASUREMENT LC_ALL
++#endif
++
+ static bool is_temperature_fahrenheit(void)
+ {
+ 	const char *locale, *underscore;
+-- 
+2.47.0
+
diff --git a/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0002-plugins-netapp-add-include-of-libgen.h-for-basename-.patch b/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0002-plugins-netapp-add-include-of-libgen.h-for-basename-.patch
new file mode 100644
index 000000000000..42ca7f534092
--- /dev/null
+++ b/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0002-plugins-netapp-add-include-of-libgen.h-for-basename-.patch
@@ -0,0 +1,34 @@ 
+From ac4818952c872ba465a2d0f48634f9a79aae064f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20N=C3=A9ri?= <dne+commits@rb67.eu>
+Date: Mon, 11 Nov 2024 22:34:57 +0100
+Subject: [PATCH] plugins/netapp: add include of libgen.h for basename(3)
+ prototype
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes build with musl libc.
+
+Signed-off-by: Daniel Néri <dne+commits@rb67.eu>
+
+Upstream-Status: Backport [https://github.com/linux-nvme/nvme-cli/commit/ac4818952c872ba465a2d0f48634f9a79aae064f]
+Signed-off-by: Ryosuke Saito <ryosuke.saito@linaro.org>
+---
+ plugins/netapp/netapp-nvme.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/plugins/netapp/netapp-nvme.c b/plugins/netapp/netapp-nvme.c
+index 5c2e3d4989b8..9f05ffc5d97e 100644
+--- a/plugins/netapp/netapp-nvme.c
++++ b/plugins/netapp/netapp-nvme.c
+@@ -22,6 +22,7 @@
+ #include <unistd.h>
+ #include <errno.h>
+ #include <string.h>
++#include <libgen.h>
+ 
+ #include "common.h"
+ #include "nvme.h"
+-- 
+2.47.0
+
diff --git a/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.11.bb b/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.11.bb
index 13b7c4227e8c..7c030cd847f8 100644
--- a/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.11.bb
+++ b/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.11.bb
@@ -8,7 +8,9 @@  LIC_FILES_CHKSUM = "file://LICENSE;md5=8264535c0c4e9c6c335635c4026a8022 \
 DEPENDS = "json-c libnvme"
 SRCREV = "9f34fcb12e3ab098e9b30e0f31e92cefb497cc42"
 
-SRC_URI = "git://github.com/linux-nvme/nvme-cli.git;branch=master;protocol=https"
+SRC_URI = "git://github.com/linux-nvme/nvme-cli.git;branch=master;protocol=https \
+           file://0001-nvme-print-add-fallback-for-non-standard-locale-cate.patch \
+           file://0002-plugins-netapp-add-include-of-libgen.h-for-basename-.patch"
 
 S = "${WORKDIR}/git"