All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cml1.bbclass: Return sorted list of cfg files
@ 2021-05-03  6:36 Khem Raj
  2021-05-03  6:57 ` [OE-core] " Konrad Weihmann
  0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2021-05-03  6:36 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

Since these files are passed to merge_config.sh its better to use a
sorted list, so we can be sure that this list is always fed in same
order irrespective of python versions on host

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/cml1.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/cml1.bbclass b/meta/classes/cml1.bbclass
index d319d66ab2..1c3d70b48d 100644
--- a/meta/classes/cml1.bbclass
+++ b/meta/classes/cml1.bbclass
@@ -6,7 +6,7 @@ def find_cfgs(d):
         if s.endswith('.cfg'):
             sources_list.append(s)
 
-    return sources_list
+    return sorted(sources_list)
 
 cml1_do_configure() {
 	set -e
-- 
2.31.1


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

* Re: [OE-core] [PATCH] cml1.bbclass: Return sorted list of cfg files
  2021-05-03  6:36 [PATCH] cml1.bbclass: Return sorted list of cfg files Khem Raj
@ 2021-05-03  6:57 ` Konrad Weihmann
  2021-05-04  1:11   ` Denys Dmytriyenko
  0 siblings, 1 reply; 3+ messages in thread
From: Konrad Weihmann @ 2021-05-03  6:57 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

On 03.05.21 08:36, Khem Raj wrote:
> Since these files are passed to merge_config.sh its better to use a
> sorted list, so we can be sure that this list is always fed in same
> order irrespective of python versions on host
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>   meta/classes/cml1.bbclass | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/cml1.bbclass b/meta/classes/cml1.bbclass
> index d319d66ab2..1c3d70b48d 100644
> --- a/meta/classes/cml1.bbclass
> +++ b/meta/classes/cml1.bbclass
> @@ -6,7 +6,7 @@ def find_cfgs(d):
>           if s.endswith('.cfg'):
>               sources_list.append(s)
>   
> -    return sources_list
> +    return sorted(sources_list)

Just as a thought, wouldn't it be better to have the ordering defined 
based on recipe/layer meta data?

Previously ordering was more or less based on the inode number of the 
files - now it's alphabetically.

I know that config fragments should be self containing, but seen enough 
real world examples where that isn't the case, so for them this might 
cause a breaking change (tbf the behavior before wasn't fully 
deterministic as well)

But this issue isn't limited to this particular piece of code here and 
might need some more general solution.

>   
>   cml1_do_configure() {
>   	set -e
> 
> 
> 
> 
> 

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

* Re: [OE-core] [PATCH] cml1.bbclass: Return sorted list of cfg files
  2021-05-03  6:57 ` [OE-core] " Konrad Weihmann
@ 2021-05-04  1:11   ` Denys Dmytriyenko
  0 siblings, 0 replies; 3+ messages in thread
From: Denys Dmytriyenko @ 2021-05-04  1:11 UTC (permalink / raw)
  To: Konrad Weihmann; +Cc: openembedded-core, Khem Raj

On Mon, May 03, 2021 at 08:57:02AM +0200, Konrad Weihmann wrote:
> On 03.05.21 08:36, Khem Raj wrote:
> >Since these files are passed to merge_config.sh its better to use a
> >sorted list, so we can be sure that this list is always fed in same
> >order irrespective of python versions on host
> >
> >Signed-off-by: Khem Raj <raj.khem@gmail.com>
> >---
> >  meta/classes/cml1.bbclass | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/meta/classes/cml1.bbclass b/meta/classes/cml1.bbclass
> >index d319d66ab2..1c3d70b48d 100644
> >--- a/meta/classes/cml1.bbclass
> >+++ b/meta/classes/cml1.bbclass
> >@@ -6,7 +6,7 @@ def find_cfgs(d):
> >          if s.endswith('.cfg'):
> >              sources_list.append(s)
> >-    return sources_list
> >+    return sorted(sources_list)
> 
> Just as a thought, wouldn't it be better to have the ordering
> defined based on recipe/layer meta data?
> 
> Previously ordering was more or less based on the inode number of
> the files - now it's alphabetically.
> 
> I know that config fragments should be self containing, but seen
> enough real world examples where that isn't the case, so for them
> this might cause a breaking change (tbf the behavior before wasn't
> fully deterministic as well)

Correct, config fragments can come from different places and it's quite 
common for latter fragments to amend some former fragments in the list. 
So, sorting them either way would sure enhance determinism, but surely 
break a lot of existing functionality out there...


> But this issue isn't limited to this particular piece of code here
> and might need some more general solution.
> 
> >  cml1_do_configure() {
> >  	set -e
> >

-- 
Regards,
Denys Dmytriyenko <denis@denix.org>
PGP: 0x420902729A92C964 - https://denix.org/0x420902729A92C964
Fingerprint: 25FC E4A5 8A72 2F69 1186  6D76 4209 0272 9A92 C964

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

end of thread, other threads:[~2021-05-04  1:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-03  6:36 [PATCH] cml1.bbclass: Return sorted list of cfg files Khem Raj
2021-05-03  6:57 ` [OE-core] " Konrad Weihmann
2021-05-04  1:11   ` Denys Dmytriyenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.