diff mbox series

[meta-oe,master,mickledore,langdale,kirkstone] redis: use the files path correctly

Message ID 20230613072303.3170646-1-Qi.Chen@windriver.com
State New
Headers show
Series [meta-oe,master,mickledore,langdale,kirkstone] redis: use the files path correctly | expand

Commit Message

ChenQi June 13, 2023, 7:23 a.m. UTC
From: Chen Qi <Qi.Chen@windriver.com>

Recipes are not expected to set FILESPATH directly, they are
expected to use FILESEXTRAPATH.

I can see the seting of FILESPATH in this recipe only wants to
find redis-7 specific patches and files. This could be easily
achieved by using redis-7.0.11/ directory to hold all those files.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 .../0001-src-Do-not-reset-FINAL_LIBS.patch                      | 0
 .../0006-Define-correct-gregs-for-RISCV32.patch                 | 0
 .../redis/{redis-7 => redis-7.0.11}/GNU_SOURCE-7.patch          | 0
 .../hiredis-use-default-CC-if-it-is-set.patch                   | 0
 .../redis/{redis-7 => redis-7.0.11}/init-redis-server           | 0
 .../lua-update-Makefile-to-use-environment-build-setting.patch  | 0
 .../redis/{redis-7 => redis-7.0.11}/oe-use-libc-malloc.patch    | 0
 .../recipes-extended/redis/{redis-7 => redis-7.0.11}/redis.conf | 0
 .../redis/{redis-7 => redis-7.0.11}/redis.service               | 0
 meta-oe/recipes-extended/redis/redis_7.0.11.bb                  | 2 --
 10 files changed, 2 deletions(-)
 rename meta-oe/recipes-extended/redis/{redis-7 => redis-7.0.11}/0001-src-Do-not-reset-FINAL_LIBS.patch (100%)
 rename meta-oe/recipes-extended/redis/{redis-7 => redis-7.0.11}/0006-Define-correct-gregs-for-RISCV32.patch (100%)
 rename meta-oe/recipes-extended/redis/{redis-7 => redis-7.0.11}/GNU_SOURCE-7.patch (100%)
 rename meta-oe/recipes-extended/redis/{redis-7 => redis-7.0.11}/hiredis-use-default-CC-if-it-is-set.patch (100%)
 rename meta-oe/recipes-extended/redis/{redis-7 => redis-7.0.11}/init-redis-server (100%)
 rename meta-oe/recipes-extended/redis/{redis-7 => redis-7.0.11}/lua-update-Makefile-to-use-environment-build-setting.patch (100%)
 rename meta-oe/recipes-extended/redis/{redis-7 => redis-7.0.11}/oe-use-libc-malloc.patch (100%)
 rename meta-oe/recipes-extended/redis/{redis-7 => redis-7.0.11}/redis.conf (100%)
 rename meta-oe/recipes-extended/redis/{redis-7 => redis-7.0.11}/redis.service (100%)

Comments

Martin Jansa June 13, 2023, 9:27 a.m. UTC | #1
On Tue, Jun 13, 2023 at 9:23 AM Chen Qi via lists.openembedded.org <Qi.Chen=
windriver.com@lists.openembedded.org> wrote:

> From: Chen Qi <Qi.Chen@windriver.com>
>
> Recipes are not expected to set FILESPATH directly, they are
> expected to use FILESEXTRAPATH.


> I can see the seting of FILESPATH in this recipe only wants to
> find redis-7 specific patches and files. This could be easily
> achieved by using redis-7.0.11/ directory to hold all those files.
>

What's the issue with this, yes it's a bit uncommon but since:
https://git.openembedded.org/meta-openembedded/commit/?h=kirkstone&id=3deca451692e99d269812959e6b5e0b519a82f30

which correctly uses BPN in FILESPATH I don't see any patching issues with
redis in my world builds. Before it was failing in multilib builds because
it was searching in lib32-redis-7 directory and when not found there it
used GNU_SOURCE.patch from the other directory and failed with patch-fuzz.

If you still want to go ahead with this then you can also
undo GNU_SOURCE.patch to GNU_SOURCE-7.patch rename (which is IMHO the only
file which isn't unnecessary duplicated between redis-6 and redis-7.
ChenQi June 13, 2023, 9:42 a.m. UTC | #2
Hi Martin,

Sorry I didn’t put enough explanation in the commit.

Using FILESPATH in this way removes the possibility of overriding some files (e.g., the redis service file) from other layers via FILESEXTRAPATH:prepend, which is kind of a common practice and is actually working for basically all other recipes.

Because we have:
meta/classes-global/base.bbclass:FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files"], d)}"
And FILESEXTRAPATH is handled in base_set_filespath.

The issue is not about multilib. And undoing the GNU_SOURCE patch is not necessary, because it does not change any output.

Regards,
Qi


From: Martin Jansa <martin.jansa@gmail.com>
Sent: Tuesday, June 13, 2023 5:28 PM
To: Chen, Qi <Qi.Chen@windriver.com>
Cc: openembedded-devel@lists.openembedded.org
Subject: Re: [oe][meta-oe][master][mickledore][langdale][kirkstone][PATCH] redis: use the files path correctly



On Tue, Jun 13, 2023 at 9:23 AM Chen Qi via lists.openembedded.org<https://urldefense.com/v3/__http:/lists.openembedded.org__;!!AjveYdw8EvQ!dAF2fW0oHh2Z5vsexUKQehAWQ2GlwvfpgVWBV5LzXf4GUqD1fVHhhnT-TFPqz477ae1kW6Fhjx9z63m6cTvw92E$> <Qi.Chen=windriver.com@lists.openembedded.org<mailto:windriver.com@lists.openembedded.org>> wrote:
From: Chen Qi <Qi.Chen@windriver.com<mailto:Qi.Chen@windriver.com>>

Recipes are not expected to set FILESPATH directly, they are
expected to use FILESEXTRAPATH.

I can see the seting of FILESPATH in this recipe only wants to
find redis-7 specific patches and files. This could be easily
achieved by using redis-7.0.11/ directory to hold all those files.

What's the issue with this, yes it's a bit uncommon but since:
https://git.openembedded.org/meta-openembedded/commit/?h=kirkstone&id=3deca451692e99d269812959e6b5e0b519a82f30<https://urldefense.com/v3/__https:/git.openembedded.org/meta-openembedded/commit/?h=kirkstone&id=3deca451692e99d269812959e6b5e0b519a82f30__;!!AjveYdw8EvQ!dAF2fW0oHh2Z5vsexUKQehAWQ2GlwvfpgVWBV5LzXf4GUqD1fVHhhnT-TFPqz477ae1kW6Fhjx9z63m6eVSS-FI$>

which correctly uses BPN in FILESPATH I don't see any patching issues with redis in my world builds. Before it was failing in multilib builds because it was searching in lib32-redis-7 directory and when not found there it used GNU_SOURCE.patch from the other directory and failed with patch-fuzz.

If you still want to go ahead with this then you can also undo GNU_SOURCE.patch to GNU_SOURCE-7.patch rename (which is IMHO the only file which isn't unnecessary duplicated between redis-6 and redis-7.
ChenQi June 13, 2023, 9:50 a.m. UTC | #3
V2 sent with commit message updated. Sorry for the confusion.

Regards,
Qi

From: openembedded-devel@lists.openembedded.org <openembedded-devel@lists.openembedded.org> On Behalf Of Chen Qi via lists.openembedded.org
Sent: Tuesday, June 13, 2023 5:42 PM
To: Martin Jansa <martin.jansa@gmail.com>
Cc: openembedded-devel@lists.openembedded.org
Subject: Re: [oe][meta-oe][master][mickledore][langdale][kirkstone][PATCH] redis: use the files path correctly

Hi Martin,

Sorry I didn’t put enough explanation in the commit.

Using FILESPATH in this way removes the possibility of overriding some files (e.g., the redis service file) from other layers via FILESEXTRAPATH:prepend, which is kind of a common practice and is actually working for basically all other recipes.

Because we have:
meta/classes-global/base.bbclass:FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files"], d)}"
And FILESEXTRAPATH is handled in base_set_filespath.

The issue is not about multilib. And undoing the GNU_SOURCE patch is not necessary, because it does not change any output.

Regards,
Qi


From: Martin Jansa <martin.jansa@gmail.com<mailto:martin.jansa@gmail.com>>
Sent: Tuesday, June 13, 2023 5:28 PM
To: Chen, Qi <Qi.Chen@windriver.com<mailto:Qi.Chen@windriver.com>>
Cc: openembedded-devel@lists.openembedded.org<mailto:openembedded-devel@lists.openembedded.org>
Subject: Re: [oe][meta-oe][master][mickledore][langdale][kirkstone][PATCH] redis: use the files path correctly



On Tue, Jun 13, 2023 at 9:23 AM Chen Qi via lists.openembedded.org<https://urldefense.com/v3/__http:/lists.openembedded.org__;!!AjveYdw8EvQ!dAF2fW0oHh2Z5vsexUKQehAWQ2GlwvfpgVWBV5LzXf4GUqD1fVHhhnT-TFPqz477ae1kW6Fhjx9z63m6cTvw92E$> <Qi.Chen=windriver.com@lists.openembedded.org<mailto:windriver.com@lists.openembedded.org>> wrote:
From: Chen Qi <Qi.Chen@windriver.com<mailto:Qi.Chen@windriver.com>>

Recipes are not expected to set FILESPATH directly, they are
expected to use FILESEXTRAPATH.

I can see the seting of FILESPATH in this recipe only wants to
find redis-7 specific patches and files. This could be easily
achieved by using redis-7.0.11/ directory to hold all those files.

What's the issue with this, yes it's a bit uncommon but since:
https://git.openembedded.org/meta-openembedded/commit/?h=kirkstone&id=3deca451692e99d269812959e6b5e0b519a82f30<https://urldefense.com/v3/__https:/git.openembedded.org/meta-openembedded/commit/?h=kirkstone&id=3deca451692e99d269812959e6b5e0b519a82f30__;!!AjveYdw8EvQ!dAF2fW0oHh2Z5vsexUKQehAWQ2GlwvfpgVWBV5LzXf4GUqD1fVHhhnT-TFPqz477ae1kW6Fhjx9z63m6eVSS-FI$>

which correctly uses BPN in FILESPATH I don't see any patching issues with redis in my world builds. Before it was failing in multilib builds because it was searching in lib32-redis-7 directory and when not found there it used GNU_SOURCE.patch from the other directory and failed with patch-fuzz.

If you still want to go ahead with this then you can also undo GNU_SOURCE.patch to GNU_SOURCE-7.patch rename (which is IMHO the only file which isn't unnecessary duplicated between redis-6 and redis-7.
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/redis/redis-7/0001-src-Do-not-reset-FINAL_LIBS.patch b/meta-oe/recipes-extended/redis/redis-7.0.11/0001-src-Do-not-reset-FINAL_LIBS.patch
similarity index 100%
rename from meta-oe/recipes-extended/redis/redis-7/0001-src-Do-not-reset-FINAL_LIBS.patch
rename to meta-oe/recipes-extended/redis/redis-7.0.11/0001-src-Do-not-reset-FINAL_LIBS.patch
diff --git a/meta-oe/recipes-extended/redis/redis-7/0006-Define-correct-gregs-for-RISCV32.patch b/meta-oe/recipes-extended/redis/redis-7.0.11/0006-Define-correct-gregs-for-RISCV32.patch
similarity index 100%
rename from meta-oe/recipes-extended/redis/redis-7/0006-Define-correct-gregs-for-RISCV32.patch
rename to meta-oe/recipes-extended/redis/redis-7.0.11/0006-Define-correct-gregs-for-RISCV32.patch
diff --git a/meta-oe/recipes-extended/redis/redis-7/GNU_SOURCE-7.patch b/meta-oe/recipes-extended/redis/redis-7.0.11/GNU_SOURCE-7.patch
similarity index 100%
rename from meta-oe/recipes-extended/redis/redis-7/GNU_SOURCE-7.patch
rename to meta-oe/recipes-extended/redis/redis-7.0.11/GNU_SOURCE-7.patch
diff --git a/meta-oe/recipes-extended/redis/redis-7/hiredis-use-default-CC-if-it-is-set.patch b/meta-oe/recipes-extended/redis/redis-7.0.11/hiredis-use-default-CC-if-it-is-set.patch
similarity index 100%
rename from meta-oe/recipes-extended/redis/redis-7/hiredis-use-default-CC-if-it-is-set.patch
rename to meta-oe/recipes-extended/redis/redis-7.0.11/hiredis-use-default-CC-if-it-is-set.patch
diff --git a/meta-oe/recipes-extended/redis/redis-7/init-redis-server b/meta-oe/recipes-extended/redis/redis-7.0.11/init-redis-server
similarity index 100%
rename from meta-oe/recipes-extended/redis/redis-7/init-redis-server
rename to meta-oe/recipes-extended/redis/redis-7.0.11/init-redis-server
diff --git a/meta-oe/recipes-extended/redis/redis-7/lua-update-Makefile-to-use-environment-build-setting.patch b/meta-oe/recipes-extended/redis/redis-7.0.11/lua-update-Makefile-to-use-environment-build-setting.patch
similarity index 100%
rename from meta-oe/recipes-extended/redis/redis-7/lua-update-Makefile-to-use-environment-build-setting.patch
rename to meta-oe/recipes-extended/redis/redis-7.0.11/lua-update-Makefile-to-use-environment-build-setting.patch
diff --git a/meta-oe/recipes-extended/redis/redis-7/oe-use-libc-malloc.patch b/meta-oe/recipes-extended/redis/redis-7.0.11/oe-use-libc-malloc.patch
similarity index 100%
rename from meta-oe/recipes-extended/redis/redis-7/oe-use-libc-malloc.patch
rename to meta-oe/recipes-extended/redis/redis-7.0.11/oe-use-libc-malloc.patch
diff --git a/meta-oe/recipes-extended/redis/redis-7/redis.conf b/meta-oe/recipes-extended/redis/redis-7.0.11/redis.conf
similarity index 100%
rename from meta-oe/recipes-extended/redis/redis-7/redis.conf
rename to meta-oe/recipes-extended/redis/redis-7.0.11/redis.conf
diff --git a/meta-oe/recipes-extended/redis/redis-7/redis.service b/meta-oe/recipes-extended/redis/redis-7.0.11/redis.service
similarity index 100%
rename from meta-oe/recipes-extended/redis/redis-7/redis.service
rename to meta-oe/recipes-extended/redis/redis-7.0.11/redis.service
diff --git a/meta-oe/recipes-extended/redis/redis_7.0.11.bb b/meta-oe/recipes-extended/redis/redis_7.0.11.bb
index 4626044781..0fdbfe94bd 100644
--- a/meta-oe/recipes-extended/redis/redis_7.0.11.bb
+++ b/meta-oe/recipes-extended/redis/redis_7.0.11.bb
@@ -6,8 +6,6 @@  LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://COPYING;md5=8ffdd6c926faaece928cf9d9640132d2"
 DEPENDS = "readline lua ncurses"
 
-FILESPATH =. "${FILE_DIRNAME}/${BPN}-7:"
-
 SRC_URI = "http://download.redis.io/releases/${BP}.tar.gz \
            file://redis.conf \
            file://init-redis-server \