* [PATCH] isar-bootstrap: Avoid absolute path in SRC_URI
@ 2023-09-08 6:11 Uladzimir Bely
2023-09-08 6:29 ` Schmidt, Adriaan
0 siblings, 1 reply; 2+ messages in thread
From: Uladzimir Bely @ 2023-09-08 6:11 UTC (permalink / raw)
To: isar-users
After commit ae3c091c, absolute path to source list file appears in
SRC_URI for isar-bootstrap tasks.
This leads to broken SSTATE_DIR sharing between different copies of
isar on the same machine, since almost all tasks depend on bootstrap
one.
This patch fixes the issue by leaving relative paths returned by
get_aptsources_list() function.
Users of kas are not affected since it internally uses fixed paths.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 8af73a9b..be462b91 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -152,19 +152,17 @@ def get_aptsources_list(d):
from collections import OrderedDict
apt_sources_var = d.getVar("DISTRO_VARS_PREFIX") + "DISTRO_APT_SOURCES"
apt_sources_list = list(OrderedDict.fromkeys((d.getVar(apt_sources_var) or "").split()))
- ret = []
for p in apt_sources_list:
try:
f = bb.parse.resolve_file(p, d)
- ret.append(f)
except FileNotFoundError as e:
bb.fatal(os.strerror(errno.ENOENT) + ' "' + p + '"')
- return ret
+ return apt_sources_list
def generate_distro_sources(d):
apt_sources_list = get_aptsources_list(d)
for entry in apt_sources_list:
- with open(entry, "r") as in_fd:
+ with open(bb.parse.resolve_file(entry, d), "r") as in_fd:
for line in in_fd:
parsed = parse_aptsources_list_line(line)
if parsed:
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] isar-bootstrap: Avoid absolute path in SRC_URI
2023-09-08 6:11 [PATCH] isar-bootstrap: Avoid absolute path in SRC_URI Uladzimir Bely
@ 2023-09-08 6:29 ` Schmidt, Adriaan
0 siblings, 0 replies; 2+ messages in thread
From: Schmidt, Adriaan @ 2023-09-08 6:29 UTC (permalink / raw)
To: Uladzimir Bely, isar-users
Hi Uladzimir,
I also had another look at the problem, and came up with exactly the same solution.
Just one minor comment below.
Uladzimir Bely, Friday, September 8, 2023 8:12 AM:
> After commit ae3c091c, absolute path to source list file appears in
> SRC_URI for isar-bootstrap tasks.
>
> This leads to broken SSTATE_DIR sharing between different copies of
> isar on the same machine, since almost all tasks depend on bootstrap
> one.
>
> This patch fixes the issue by leaving relative paths returned by
> get_aptsources_list() function.
>
> Users of kas are not affected since it internally uses fixed paths.
>
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
> meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> index 8af73a9b..be462b91 100644
> --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> @@ -152,19 +152,17 @@ def get_aptsources_list(d):
> from collections import OrderedDict
> apt_sources_var = d.getVar("DISTRO_VARS_PREFIX") + "DISTRO_APT_SOURCES"
> apt_sources_list = list(OrderedDict.fromkeys((d.getVar(apt_sources_var)
> or "").split()))
> - ret = []
> for p in apt_sources_list:
> try:
> f = bb.parse.resolve_file(p, d)
f is never used, so we no longer need "f = " here.
Adriaan
> - ret.append(f)
> except FileNotFoundError as e:
> bb.fatal(os.strerror(errno.ENOENT) + ' "' + p + '"')
> - return ret
> + return apt_sources_list
>
> def generate_distro_sources(d):
> apt_sources_list = get_aptsources_list(d)
> for entry in apt_sources_list:
> - with open(entry, "r") as in_fd:
> + with open(bb.parse.resolve_file(entry, d), "r") as in_fd:
> for line in in_fd:
> parsed = parse_aptsources_list_line(line)
> if parsed:
> --
> 2.20.1
>
> --
> You received this message because you are subscribed to the Google Groups
> "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/isar-users/20230908061159.19001-1-
> ubely%40ilbers.de.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-08 6:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-08 6:11 [PATCH] isar-bootstrap: Avoid absolute path in SRC_URI Uladzimir Bely
2023-09-08 6:29 ` Schmidt, Adriaan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox