Hi Bruce,

Bruce Ashfield <[email protected]> escreveu no dia quinta,
29/09/2022 à(s) 17:42:

> If this broke another use case, send the details and I'll debug it here.
> But these changes are required for some configurations, so I'm not going to
> simply revert.
>

I've been trying to figure out why this is happening but unfortunately I
haven't been able to.
I have added some details in the commit message about the differences I
found.

Anyway I have another patch that fixes the issue but as I don't understand
the reason
behind this I chose to revert. This patch is:

diff --git a/tools/spp b/tools/spp
index f9bb76b..f379205 100755
--- a/tools/spp
+++ b/tools/spp
@@ -300,8 +300,19 @@ search_include_paths()
     done
 }

+expand_if_full_path()
+{
+        for i in $@; do
+            if [ "${i:0:1}" = "/" ]; then
+                i=$(readlink -f $i)
+            fi
+            echo $i
+        done
+}
+
+
 # args are the input files
-infiles=$@
+infiles=$(expand_if_full_path $@)

 processed_files=""


>
> Bruce
>
>
> On Thu, Sep 29, 2022 at 12:37 PM Jose Quaresma <[email protected]>
> wrote:
>
>> This reverts commit 9320c2a1aaa085e94abd15ede0d93ffdab578e9d.
>>
>> The strip_common_prefix function is changed in a way that they will
>> use the expanded path of the input argument.
>> There are some changes in the process_file function for the *.cfg files
>> only and not none for *.scc, *.patch and *defconfig.
>>
>> This doesn't work for cases where we have the defconfig files
>> provided in the some meta-layer and fail with:
>>
>> [ERROR]: processing of file /tmp/tmp.8hcr45TMiO failed
>>
>> The content of the '/tmp/tmp.8hcr45TMiO' file is currently:
>>
>> | #
>> | # spp v0.8
>> | # processed: Thu Sep 29 04:15:36 PM UTC 2022
>> | #
>> | # This is a preprocessor output file, do not edit
>> | #
>> | #
>> | prefix
>> | kconf non-hardware
>> /build/conf/../../layers/meta-lmp/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-dev-mfgtool/imx8mq-evk/defconfig
>> | # run time: 0 seconds
>> | # processed files:
>> | # _cfg
>> /build/conf/../../layers/meta-lmp/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-dev-mfgtool/imx8mq-evk/defconfig
>>
>> and with this patch applied (without 9320c2a):
>>
>> | #
>> | # spp v0.8
>> | # processed: Thu Sep 29 04:18:21 PM UTC 2022
>> | #
>> | # This is a preprocessor output file, do not edit
>> | #
>> | #
>> | prefix
>> /build/conf/../../layers/meta-lmp/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-dev-mfgtool/imx8mq-evk/defconfig
>> | kconf non-hardware
>> /build/conf/../../layers/meta-lmp/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-dev-mfgtool/imx8mq-evk/defconfig
>> | # run time: 0 seconds
>> | # processed files:
>> | # _cfg
>> /build/conf/../../layers/meta-lmp/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-dev-mfgtool/imx8mq-evk/defconfig
>>
>> so the 9320c2a patch removes the prefix in this use case.
>>
>> Signed-off-by: Jose Quaresma <[email protected]>
>> ---
>>  tools/scc-cmds/kconf.cmd |  4 ----
>>  tools/spp                | 17 ++---------------
>>  2 files changed, 2 insertions(+), 19 deletions(-)
>>
>> diff --git a/tools/scc-cmds/kconf.cmd b/tools/scc-cmds/kconf.cmd
>> index e0d4351..a98ae99 100644
>> --- a/tools/scc-cmds/kconf.cmd
>> +++ b/tools/scc-cmds/kconf.cmd
>> @@ -53,10 +53,6 @@ kconf() {
>>      eval echo
>> "configs/${cbranch_name}/${relative_config_dir}/${simple_config_name} \#
>> ${type}" >> "${configqueue}"
>>      eval echo "\$text" $outfile_append
>>
>> -    if [ -n "${verbose}" ]; then
>> -        echo "config: rel: ${relative_config_dir} name:
>> ${simple_config_name} [${cbranch_name}][${prefix}]" >&2
>> -    fi
>> -
>>      if [ "${type}" == "hardware" ]; then
>>          echo
>> "${outdir}/configs/${cbranch_name}/${relative_config_dir}/${simple_config_name}"
>> >> ${outdir}/hardware_frags.txt
>>      fi
>> diff --git a/tools/spp b/tools/spp
>> index f9bb76b..4d3fa10 100755
>> --- a/tools/spp
>> +++ b/tools/spp
>> @@ -113,11 +113,6 @@ warn()
>>  strip_common_prefix()
>>  {
>>      in_name=$1
>> -    if [ -n "$in_name" ]; then
>> -       in_name=$(readlink -f $in_name)
>> -    fi
>> -
>> -    # >&2 echo "strip_common_prefix: $1 -> $in_name"
>>
>>      # this takes an input name and searches all known paths.
>>      # the relocation that removes the MOST from the original is
>> @@ -437,7 +432,6 @@ header()
>>             one_less_dir=${d%/}
>>             # strip last path component
>>             one_less_dir=${one_less_dir%/*}
>> -           one_less_dir=$(readlink -f $one_less_dir)
>>
>>             echo "reloc_dir $one_less_dir"
>>         done
>> @@ -516,17 +510,10 @@ process_file()
>>                  echo "[ERROR]: could not find config fragment: $in"
>>                  exit 1
>>              fi
>> -            # old
>> -            # relative_kconf=$(strip_common_prefix $kconf_name)
>> -            # containing_dir=${kconf_name/$relative_kconf}
>> -            # new
>> -            relative_kconf=$(strip_common_prefix $kconf_name_new)
>> -            containing_dir=${kconf_name_new/$relative_kconf}
>> +            relative_kconf=$(strip_common_prefix $kconf_name)
>> +            containing_dir=${kconf_name/$relative_kconf}
>>              echo "prefix ${containing_dir}"
>>              echo "kconf non-hardware ${kconf_name_new}"
>> -
>> -            # >&2 echo "kconf_name: $kconf_name kconf_name_new:
>> $kconf_name_new"
>> -            # >&2 echo "relative_kconf: $relative_kconf prefix:
>> $containing_dir"
>>              return
>>              ;;
>>          *defconfig)
>> --
>> 2.34.1
>>
>>
>> 
>>
>>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await thee
> at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>
>

-- 
Best regards,

José Quaresma
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11743): 
https://lists.yoctoproject.org/g/linux-yocto/message/11743
Mute This Topic: https://lists.yoctoproject.org/mt/93998449/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to