public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Improve cachability of isar-bootstrap
@ 2022-08-12  8:08 Felix Moessbauer
  2022-08-12  8:08 ` [PATCH v2 1/2] isar-sstate lint: strip variable value Felix Moessbauer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Felix Moessbauer @ 2022-08-12  8:08 UTC (permalink / raw)
  To: isar-users; +Cc: amikan, adriaan.schmidt, Felix Moessbauer

Changes since v1:

- fix bug when using multiple DISTRO_BOOTSTRAP_KEYFILES

Felix Moessbauer (2):
  isar-sstate lint: strip variable value
  improve cachability of isar-bootstrap

 meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 10 +++++-----
 scripts/isar-sstate                                 |  7 +++++--
 2 files changed, 10 insertions(+), 7 deletions(-)

-- 
2.30.2


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

* [PATCH v2 1/2] isar-sstate lint: strip variable value
  2022-08-12  8:08 [PATCH v2 0/2] Improve cachability of isar-bootstrap Felix Moessbauer
@ 2022-08-12  8:08 ` Felix Moessbauer
  2022-08-12  8:09 ` [PATCH v2 2/2] improve cachability of isar-bootstrap Felix Moessbauer
  2022-08-24  7:08 ` [PATCH v2 0/2] Improve " Anton Mikanovich
  2 siblings, 0 replies; 4+ messages in thread
From: Felix Moessbauer @ 2022-08-12  8:08 UTC (permalink / raw)
  To: isar-users; +Cc: amikan, adriaan.schmidt, Felix Moessbauer

By stripping any leading whitespaces, the script now also detects
cachability problems in variables that are just appended to.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 scripts/isar-sstate | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/isar-sstate b/scripts/isar-sstate
index 3a1945e7..5972144d 100755
--- a/scripts/isar-sstate
+++ b/scripts/isar-sstate
@@ -824,9 +824,12 @@ def sstate_lint(target, verbose, sources_dir, build_dir, exit_code, **kwargs):
                    sigdata['taskwhitelist'] and name in sigdata['taskwhitelist'] or \
                    name in ADDITIONAL_IGNORED_VARNAMES:
                     continue
-                if not val or not val[0] == '/':
+                if not val:
+                    continue
+                # remove leading whitespaces possibly added by appending
+                val = val.lstrip()
+                if not val[0] == '/':
                     continue
-                task = sigdata['task']
                 if val.startswith(build_dir):
                     pn_issues.append(f'\033[0;31m-> path in build-dir:   {name} = "{val}"\033[0m')
                     hits_builddir += 1
-- 
2.30.2


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

* [PATCH v2 2/2] improve cachability of isar-bootstrap
  2022-08-12  8:08 [PATCH v2 0/2] Improve cachability of isar-bootstrap Felix Moessbauer
  2022-08-12  8:08 ` [PATCH v2 1/2] isar-sstate lint: strip variable value Felix Moessbauer
@ 2022-08-12  8:09 ` Felix Moessbauer
  2022-08-24  7:08 ` [PATCH v2 0/2] Improve " Anton Mikanovich
  2 siblings, 0 replies; 4+ messages in thread
From: Felix Moessbauer @ 2022-08-12  8:09 UTC (permalink / raw)
  To: isar-users; +Cc: amikan, adriaan.schmidt, Felix Moessbauer

This patch makes all paths used in the bootstrapping relative
to TOPDIR to be able to cache the isar-bootstrap task.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 604cd24c..fdaad61b 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -35,8 +35,8 @@ inherit deb-dl-dir
 
 python () {
     distro_bootstrap_keys = (d.getVar("DISTRO_BOOTSTRAP_KEYS") or "").split()
-
     third_party_apt_keys = (d.getVar("THIRD_PARTY_APT_KEYS") or "").split()
+    topdir = d.getVar("TOPDIR", True)
 
     # The cached repo key can be both for bootstrapping and apt package
     # installation afterwards. However, debootstrap will include the key into
@@ -50,14 +50,14 @@ python () {
     for key in distro_bootstrap_keys:
         d.appendVar("SRC_URI", " %s" % key)
         fetcher = bb.fetch2.Fetch([key], d)
-        filename = fetcher.localpath(key)
-        d.appendVar("DISTRO_BOOTSTRAP_KEYFILES", " %s" % filename)
+        filename = os.path.relpath(fetcher.localpath(key), topdir)
+        d.appendVar("DISTRO_BOOTSTRAP_KEYFILES", " ${TOPDIR}/%s" % filename)
 
     for key in third_party_apt_keys:
         d.appendVar("SRC_URI", " %s" % key)
         fetcher = bb.fetch2.Fetch([key], d)
-        filename = fetcher.localpath(key)
-        d.appendVar("THIRD_PARTY_APT_KEYFILES", " %s" % filename)
+        filename = os.path.relpath(fetcher.localpath(key), topdir)
+        d.appendVar("THIRD_PARTY_APT_KEYFILES", " ${TOPDIR}/%s" % filename)
 
     distro_apt_sources = d.getVar(d.getVar("DISTRO_VARS_PREFIX") + "DISTRO_APT_SOURCES", True) or ""
     for file in distro_apt_sources.split():
-- 
2.30.2


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

* Re: [PATCH v2 0/2] Improve cachability of isar-bootstrap
  2022-08-12  8:08 [PATCH v2 0/2] Improve cachability of isar-bootstrap Felix Moessbauer
  2022-08-12  8:08 ` [PATCH v2 1/2] isar-sstate lint: strip variable value Felix Moessbauer
  2022-08-12  8:09 ` [PATCH v2 2/2] improve cachability of isar-bootstrap Felix Moessbauer
@ 2022-08-24  7:08 ` Anton Mikanovich
  2 siblings, 0 replies; 4+ messages in thread
From: Anton Mikanovich @ 2022-08-24  7:08 UTC (permalink / raw)
  To: Felix Moessbauer, isar-users; +Cc: adriaan.schmidt

12.08.2022 11:08, Felix Moessbauer wrote:
> Changes since v1:
>
> - fix bug when using multiple DISTRO_BOOTSTRAP_KEYFILES
>
> Felix Moessbauer (2):
>    isar-sstate lint: strip variable value
>    improve cachability of isar-bootstrap
>
>   meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 10 +++++-----
>   scripts/isar-sstate                                 |  7 +++++--
>   2 files changed, 10 insertions(+), 7 deletions(-)
>
Applied to next, thanks.


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

end of thread, other threads:[~2022-08-24  7:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-12  8:08 [PATCH v2 0/2] Improve cachability of isar-bootstrap Felix Moessbauer
2022-08-12  8:08 ` [PATCH v2 1/2] isar-sstate lint: strip variable value Felix Moessbauer
2022-08-12  8:09 ` [PATCH v2 2/2] improve cachability of isar-bootstrap Felix Moessbauer
2022-08-24  7:08 ` [PATCH v2 0/2] Improve " Anton Mikanovich

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