diff mbox series

[master-next,meta-oe,01/11] libgpiod: improve FILESEXTRAPATHS

Message ID 20241031134114.2791747-1-martin.jansa@gmail.com
State New
Headers show
Series [master-next,meta-oe,01/11] libgpiod: improve FILESEXTRAPATHS | expand

Commit Message

Martin Jansa Oct. 31, 2024, 1:41 p.m. UTC
* I thought that PN in FILESEXTRAPATHS worked as everywhere else and
  as described in:
  https://lore.kernel.org/all/2261745fc01a4e3887ee98f98a425e88@vivavis.com/T/

* but surprisingly (to me)
  FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-2.x:"
  ends with effectively ${BPN}-2.x in bitbake -e (and the build doesn't fail
  to fetch file://gpio-manager.init in lib32-libgpiod build

* I've tried with kirkstone and dunfell as well and it ends with
  "libgpiod-2.x" for all 3 PNs:
  dunfell $ grep ^FILESEXTRAPATHS= env.* | sed 's@/OE.*dunfell/@@g'
  env.lib32-libgpiod:FILESEXTRAPATHS="meta-oe/meta-oe/recipes-support/libgpiod/libgpiod-2.x:__default:"
  env.libgpiod:FILESEXTRAPATHS="meta-oe/meta-oe/recipes-support/libgpiod/libgpiod-2.x:__default:"
  env.libgpiod-native:FILESEXTRAPATHS="meta-oe/meta-oe/recipes-support/libgpiod/libgpiod-2.x:__default:"

  dunfell $ grep ^PN= env.*
  env.lib32-libgpiod:PN="lib32-libgpiod"
  env.libgpiod:PN="libgpiod"
  env.libgpiod-native:PN="libgpiod-native"

  There is the QA check for PN in SRC_URI, maybe I took it a bit
  further and updated all FILESEXTRAPATHS references as well in our
  layers (in 2023) even when it wasn't causing build failures, e.g.:
  https://github.com/webosose/meta-webosose/commit/38d3cbf010a5e4e112d82ee473eecc718d9cc687

* so it's not so important to use BPN, but it's a bit clearer as that's
  what it ends evaluated into and what default FILESPATH is using as well:

  meta/classes-global/base.bbclass:FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files"], d)}"
  meta/conf/bitbake.conf:#FILESPATH = "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/${BP}:${FILE_DIRNAME}/${BPN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}"

  BPN was added in denzil 2009 (and FILESPATH moved to base.bbclass,
  bitbake.conf has commented-out value since then):
  https://git.openembedded.org/openembedded-core/commit/?h=denzil&id=94c895aad5ad286f172b04bc33ba670220d5eba8

  PF was dropped in dylan 2012:
  https://git.openembedded.org/openembedded-core/commit/?h=dylan&id=3efa13cd76bbd5611805021945fc9def88d9fd93

  P and PN were dropped shortly after in dylan 2012:
  https://git.openembedded.org/openembedded-core/commit/?h=dylan&id=fb359583b659cda643973fa285002aaffb729a51

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
 meta-oe/recipes-support/libgpiod/libgpiod_1.6.5.bb | 2 +-
 meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Khem Raj Oct. 31, 2024, 2:48 p.m. UTC | #1
Thanks for this series, such cleanups are very important.

On Thu, Oct 31, 2024 at 6:41 AM Martin Jansa via
lists.openembedded.org <martin.jansa=gmail.com@lists.openembedded.org>
wrote:
>
> * I thought that PN in FILESEXTRAPATHS worked as everywhere else and
>   as described in:
>   https://lore.kernel.org/all/2261745fc01a4e3887ee98f98a425e88@vivavis.com/T/
>
> * but surprisingly (to me)
>   FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-2.x:"
>   ends with effectively ${BPN}-2.x in bitbake -e (and the build doesn't fail
>   to fetch file://gpio-manager.init in lib32-libgpiod build
>
> * I've tried with kirkstone and dunfell as well and it ends with
>   "libgpiod-2.x" for all 3 PNs:
>   dunfell $ grep ^FILESEXTRAPATHS= env.* | sed 's@/OE.*dunfell/@@g'
>   env.lib32-libgpiod:FILESEXTRAPATHS="meta-oe/meta-oe/recipes-support/libgpiod/libgpiod-2.x:__default:"
>   env.libgpiod:FILESEXTRAPATHS="meta-oe/meta-oe/recipes-support/libgpiod/libgpiod-2.x:__default:"
>   env.libgpiod-native:FILESEXTRAPATHS="meta-oe/meta-oe/recipes-support/libgpiod/libgpiod-2.x:__default:"
>
>   dunfell $ grep ^PN= env.*
>   env.lib32-libgpiod:PN="lib32-libgpiod"
>   env.libgpiod:PN="libgpiod"
>   env.libgpiod-native:PN="libgpiod-native"
>
>   There is the QA check for PN in SRC_URI, maybe I took it a bit
>   further and updated all FILESEXTRAPATHS references as well in our
>   layers (in 2023) even when it wasn't causing build failures, e.g.:
>   https://github.com/webosose/meta-webosose/commit/38d3cbf010a5e4e112d82ee473eecc718d9cc687
>
> * so it's not so important to use BPN, but it's a bit clearer as that's
>   what it ends evaluated into and what default FILESPATH is using as well:
>
>   meta/classes-global/base.bbclass:FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files"], d)}"
>   meta/conf/bitbake.conf:#FILESPATH = "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/${BP}:${FILE_DIRNAME}/${BPN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}"
>
>   BPN was added in denzil 2009 (and FILESPATH moved to base.bbclass,
>   bitbake.conf has commented-out value since then):
>   https://git.openembedded.org/openembedded-core/commit/?h=denzil&id=94c895aad5ad286f172b04bc33ba670220d5eba8
>
>   PF was dropped in dylan 2012:
>   https://git.openembedded.org/openembedded-core/commit/?h=dylan&id=3efa13cd76bbd5611805021945fc9def88d9fd93
>
>   P and PN were dropped shortly after in dylan 2012:
>   https://git.openembedded.org/openembedded-core/commit/?h=dylan&id=fb359583b659cda643973fa285002aaffb729a51
>
> Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
> ---
>  meta-oe/recipes-support/libgpiod/libgpiod_1.6.5.bb | 2 +-
>  meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.5.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.5.bb
> index 0795839492..dac7dd36fc 100644
> --- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.5.bb
> +++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.5.bb
> @@ -7,7 +7,7 @@ SRC_URI += "file://0001-bindings-cxx-disable-tests.patch"
>
>  SRC_URI[sha256sum] = "ae280f697bf035a1fb780c9972e5c81d0d2712b7ab6124fb3fba24619daa72bc"
>
> -FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-1.x:"
> +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}-1.x:"
>
>  inherit python3native
>
> diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> index 8d8a2cc3a4..224918a55a 100644
> --- a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> +++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> @@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = " \
>      file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \
>  "
>
> -FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-2.x:"
> +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}-2.x:"
>
>  SRC_URI += "file://gpio-manager.init"
>
> --
> 2.47.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#113358): https://lists.openembedded.org/g/openembedded-devel/message/113358
> Mute This Topic: https://lists.openembedded.org/mt/109314377/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-support/libgpiod/libgpiod_1.6.5.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.5.bb
index 0795839492..dac7dd36fc 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.5.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.5.bb
@@ -7,7 +7,7 @@  SRC_URI += "file://0001-bindings-cxx-disable-tests.patch"
 
 SRC_URI[sha256sum] = "ae280f697bf035a1fb780c9972e5c81d0d2712b7ab6124fb3fba24619daa72bc"
 
-FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-1.x:"
+FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}-1.x:"
 
 inherit python3native
 
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
index 8d8a2cc3a4..224918a55a 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
@@ -9,7 +9,7 @@  LIC_FILES_CHKSUM = " \
     file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \
 "
 
-FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-2.x:"
+FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}-2.x:"
 
 SRC_URI += "file://gpio-manager.init"