public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [RFC 0/4] Warn on PN usage for virtual packages
@ 2024-02-16 14:34 Anton Mikanovich
  2024-02-16 14:34 ` [RFC 1/4] multiarch: Add warning on PN usage fallback Anton Mikanovich
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Anton Mikanovich @ 2024-02-16 14:34 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

Compat and native packages can fail in case variables will have PN in
their content. For correct behaviour BPN (which is PN without suffix)
should be used instead.
We are hiding PN->BPN fallback fix from recipe authors but should warn
them to force moving to BPN usage.
There are also some PN usages in Isar need to be fixed.

This patchset should be placed on top of:
[PATCH v2 0/4] Fix SRC_URI:remove ignoring

Sending it as RFC because of high influence on downstreams by flooding
build log with new warnings.

Anton Mikanovich (4):
  multiarch: Add warning on PN usage fallback
  meta/conf/bitbake.conf: Set global BPN
  base: Fix FILESPATH value for -native and -compat
  hello: Use BPN instead of PN

 meta-isar/recipes-app/hello/hello.bb | 2 +-
 meta/classes/base.bbclass            | 2 +-
 meta/classes/multiarch.bbclass       | 4 ++--
 meta/classes/sdk.bbclass             | 1 -
 meta/conf/bitbake.conf               | 1 +
 5 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC 1/4] multiarch: Add warning on PN usage fallback
  2024-02-16 14:34 [RFC 0/4] Warn on PN usage for virtual packages Anton Mikanovich
@ 2024-02-16 14:34 ` Anton Mikanovich
  2024-02-16 14:34 ` [RFC 2/4] meta/conf/bitbake.conf: Set global BPN Anton Mikanovich
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Anton Mikanovich @ 2024-02-16 14:34 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

Using PN in variables should be avoided in prior to BPN for -compat and
-native compatibility. Add a warning in case of autofixing.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/multiarch.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes/multiarch.bbclass b/meta/classes/multiarch.bbclass
index b3fc9441..d1bad652 100644
--- a/meta/classes/multiarch.bbclass
+++ b/meta/classes/multiarch.bbclass
@@ -52,6 +52,8 @@ python multiarch_virtclass_handler() {
             if v is not None and '${PN}' in v:
                 d.setVar(var + ':remove', v)
                 d.appendVar(var, v.replace('${PN}', '${BPN}'))
+                bb.warn('Variable PN in ' + var + ' is not recommended. ' +
+                        'Use BPN instead.')
 
     # When building compat/native, the corresponding suffix needs to be
     # propagated to all bitbake dependency definitions.
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC 2/4] meta/conf/bitbake.conf: Set global BPN
  2024-02-16 14:34 [RFC 0/4] Warn on PN usage for virtual packages Anton Mikanovich
  2024-02-16 14:34 ` [RFC 1/4] multiarch: Add warning on PN usage fallback Anton Mikanovich
@ 2024-02-16 14:34 ` Anton Mikanovich
  2024-02-16 14:34 ` [RFC 3/4] base: Fix FILESPATH value for -native and -compat Anton Mikanovich
  2024-02-16 14:34 ` [RFC 4/4] hello: Use BPN instead of PN Anton Mikanovich
  3 siblings, 0 replies; 5+ messages in thread
From: Anton Mikanovich @ 2024-02-16 14:34 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

Declare default BPN value in bitbake.conf without duplicating in every
recipe just like it is implemented in OE.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/multiarch.bbclass | 2 --
 meta/classes/sdk.bbclass       | 1 -
 meta/conf/bitbake.conf         | 1 +
 3 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/meta/classes/multiarch.bbclass b/meta/classes/multiarch.bbclass
index d1bad652..785a0f26 100644
--- a/meta/classes/multiarch.bbclass
+++ b/meta/classes/multiarch.bbclass
@@ -3,8 +3,6 @@
 #
 # SPDX-License-Identifier: MIT
 
-BPN = "${PN}"
-
 inherit compat
 python() {
     # provide compat only when we can build it
diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
index 52c3bec5..a81d69cd 100644
--- a/meta/classes/sdk.bbclass
+++ b/meta/classes/sdk.bbclass
@@ -9,7 +9,6 @@ inherit crossvars
 
 # hook up the -sdk image variant
 BBCLASSEXTEND = "sdk"
-BPN = "${PN}"
 
 python sdk_virtclass_handler() {
     pn = e.data.getVar('PN')
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 80dc01c7..7fab8929 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -50,6 +50,7 @@ T = "${WORKDIR}/temp"
 TMPDIR = "${TOPDIR}/tmp"
 PERSISTENT_DIR = "${TMPDIR}/cache"
 GITPKGV = "${@bb.fetch2.get_srcrev(d, 'gitpkgv_revision')}"
+BPN = "${PN}"
 
 # isar specific config
 WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC 3/4] base: Fix FILESPATH value for -native and -compat
  2024-02-16 14:34 [RFC 0/4] Warn on PN usage for virtual packages Anton Mikanovich
  2024-02-16 14:34 ` [RFC 1/4] multiarch: Add warning on PN usage fallback Anton Mikanovich
  2024-02-16 14:34 ` [RFC 2/4] meta/conf/bitbake.conf: Set global BPN Anton Mikanovich
@ 2024-02-16 14:34 ` Anton Mikanovich
  2024-02-16 14:34 ` [RFC 4/4] hello: Use BPN instead of PN Anton Mikanovich
  3 siblings, 0 replies; 5+ messages in thread
From: Anton Mikanovich @ 2024-02-16 14:34 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

Virtual packages with -native and -compat suffix should use BPN instead
of PN inside variables.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/base.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 88004120..3aec2f8c 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -19,7 +19,7 @@
 # OTHER DEALINGS IN THE SOFTWARE.
 
 THISDIR = "${@os.path.dirname(d.getVar('FILE'))}"
-FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}"], d)}"
+FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}"], d)}"
 
 OE_IMPORTS += "os sys time oe.path oe.patch oe.sstatesig oe.utils"
 OE_IMPORTS[type] = "list"
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC 4/4] hello: Use BPN instead of PN
  2024-02-16 14:34 [RFC 0/4] Warn on PN usage for virtual packages Anton Mikanovich
                   ` (2 preceding siblings ...)
  2024-02-16 14:34 ` [RFC 3/4] base: Fix FILESPATH value for -native and -compat Anton Mikanovich
@ 2024-02-16 14:34 ` Anton Mikanovich
  3 siblings, 0 replies; 5+ messages in thread
From: Anton Mikanovich @ 2024-02-16 14:34 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

If building hello-compat package sources for hello package should be
fetched from repository. So use package name value without suffix.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta-isar/recipes-app/hello/hello.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-isar/recipes-app/hello/hello.bb b/meta-isar/recipes-app/hello/hello.bb
index acf8ed73..0700ea6e 100644
--- a/meta-isar/recipes-app/hello/hello.bb
+++ b/meta-isar/recipes-app/hello/hello.bb
@@ -10,7 +10,7 @@ inherit dpkg
 # i.e. "apt://hello=2.10-2".
 # You may also select the desired release in case multiples are configured and
 # you do want to pin the version: "apt://hello/buster".
-SRC_URI = "apt://${PN}"
+SRC_URI = "apt://${BPN}"
 
 MAINTAINER = "isar-users <isar-users@googlegroups.com>"
 CHANGELOG_V = "<orig-version>+isar"
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-16 14:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-16 14:34 [RFC 0/4] Warn on PN usage for virtual packages Anton Mikanovich
2024-02-16 14:34 ` [RFC 1/4] multiarch: Add warning on PN usage fallback Anton Mikanovich
2024-02-16 14:34 ` [RFC 2/4] meta/conf/bitbake.conf: Set global BPN Anton Mikanovich
2024-02-16 14:34 ` [RFC 3/4] base: Fix FILESPATH value for -native and -compat Anton Mikanovich
2024-02-16 14:34 ` [RFC 4/4] hello: Use BPN instead of PN Anton Mikanovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox