linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fix make.cross for 0day bot
@ 2022-09-01  6:55 Masahiro Yamada
  2022-09-01  7:06 ` [LKP] " Philip Li
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2022-09-01  6:55 UTC (permalink / raw)
  To: lkp, 0day robot; +Cc: Linux Kernel Mailing List, Linux Kbuild mailing list

Hello,  maintainers of Intel 0day bot,

make.cross is supposed to use the latest GCC by default
(according to the comment "use highest available version")
but actually chooses GCC 9.3.0 rather than gcc-12.1.0.

If both gcc-9.3.0-nolibc and gcc-12.1.0-nolibc exist
in COMPILER_INSTALL_PATH, make.cross chooses gcc-9.3.0.

Likewise, make.cross installs gcc-9.3.0 when no suitable compiler is found.


This is due the fact that compiler is sorted like follows:

gcc-10.2.0-nolibc
gcc-10.3.0-nolibc
gcc-11.1.0-nolibc
gcc-11.2.0-nolibc
gcc-11.3.0-nolibc
gcc-12.1.0-nolibc
gcc-4.9.4-nolibc
gcc-5.5.0-nolibc
gcc-6.4.0-nolibc
gcc-6.5.0-nolibc
gcc-7.5.0-nolibc
gcc-8.1.0-nolibc
gcc-9.2.0-nolibc
gcc-9.3.0-nolibc


Then, gcc-9.3.0-nolibc is picked up since it is listed at the last.



'sort -V' can do natural sort for versions:

gcc-4.9.4-nolibc
gcc-5.5.0-nolibc
gcc-6.4.0-nolibc
gcc-6.5.0-nolibc
gcc-7.5.0-nolibc
gcc-8.1.0-nolibc
gcc-9.2.0-nolibc
gcc-9.3.0-nolibc
gcc-10.2.0-nolibc
gcc-10.3.0-nolibc
gcc-11.1.0-nolibc
gcc-11.2.0-nolibc
gcc-11.3.0-nolibc
gcc-12.1.0-nolibc




One example code change is like follows:



--- make.cross.old      2022-09-01 12:18:20.933154233 +0900
+++ make.cross  2022-09-01 15:06:48.995945712 +0900
@@ -143,7 +143,7 @@
        local URL='https://download.01.org/0day-ci/cross-package'
        local list=/tmp/0day-ci-crosstool-files

-       lftp -c "open $URL && find -d 3 > $list" || return
+       lftp -c "open $URL && find -d 3" | sort -V > $list || return

        local file
        local gcc_arch_pattern=$(echo "${gcc_arch}" | sed 's/*/.*/g')
@@ -206,7 +206,7 @@
        }

        # use highest available version
-       gcc_exec=${gcc_exec[-1]}
+       gcc_evec=$(tr ' ' '\n' <<< ${gcc_exec[@]} | sort -V | tail -n1)
 }

 update_path_env_for_parisc()
@@ -340,7 +340,7 @@

                # load build-in depends libs
                local
deplibs_path=($COMPILER_INSTALL_PATH/${COMPILER}*/${gcc_arch}/libexec/gcc/${gcc_arch}/*)
-               deplibs_path=${deplibs_path[-1]}
+               deplibs_path=$(tr ' ' '\n' <<< ${deplibs_path[@]} |
sort -V | tail -n1)
                [[ -d $deplibs_path ]] && export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$deplibs_path

                install_dependence "$gcc_exec" || return



-- 
Best Regards
Masahiro Yamada

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

* Re: [LKP] Fix make.cross for 0day bot
  2022-09-01  6:55 Fix make.cross for 0day bot Masahiro Yamada
@ 2022-09-01  7:06 ` Philip Li
  2022-09-01  8:20   ` Masahiro Yamada
  0 siblings, 1 reply; 3+ messages in thread
From: Philip Li @ 2022-09-01  7:06 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: lkp, 0day robot, Linux Kernel Mailing List, Linux Kbuild mailing list

On Thu, Sep 01, 2022 at 03:55:52PM +0900, Masahiro Yamada wrote:
> Hello,  maintainers of Intel 0day bot,
> 
> make.cross is supposed to use the latest GCC by default
> (according to the comment "use highest available version")
> but actually chooses GCC 9.3.0 rather than gcc-12.1.0.

thanks a lot for pointing out the issue and fixing it. Do you mind to send
a PR to https://github.com/intel/lkp-tests, or you suggest we composing
a patch based on your fix below?

> 
> If both gcc-9.3.0-nolibc and gcc-12.1.0-nolibc exist
> in COMPILER_INSTALL_PATH, make.cross chooses gcc-9.3.0.
> 
> Likewise, make.cross installs gcc-9.3.0 when no suitable compiler is found.
> 
> 
> This is due the fact that compiler is sorted like follows:
> 
> gcc-10.2.0-nolibc
> gcc-10.3.0-nolibc
> gcc-11.1.0-nolibc
> gcc-11.2.0-nolibc
> gcc-11.3.0-nolibc
> gcc-12.1.0-nolibc
> gcc-4.9.4-nolibc
> gcc-5.5.0-nolibc
> gcc-6.4.0-nolibc
> gcc-6.5.0-nolibc
> gcc-7.5.0-nolibc
> gcc-8.1.0-nolibc
> gcc-9.2.0-nolibc
> gcc-9.3.0-nolibc
> 
> 
> Then, gcc-9.3.0-nolibc is picked up since it is listed at the last.
> 
> 
> 
> 'sort -V' can do natural sort for versions:
> 
> gcc-4.9.4-nolibc
> gcc-5.5.0-nolibc
> gcc-6.4.0-nolibc
> gcc-6.5.0-nolibc
> gcc-7.5.0-nolibc
> gcc-8.1.0-nolibc
> gcc-9.2.0-nolibc
> gcc-9.3.0-nolibc
> gcc-10.2.0-nolibc
> gcc-10.3.0-nolibc
> gcc-11.1.0-nolibc
> gcc-11.2.0-nolibc
> gcc-11.3.0-nolibc
> gcc-12.1.0-nolibc
> 
> 
> 
> 
> One example code change is like follows:
> 
> 
> 
> --- make.cross.old      2022-09-01 12:18:20.933154233 +0900
> +++ make.cross  2022-09-01 15:06:48.995945712 +0900
> @@ -143,7 +143,7 @@
>         local URL='https://download.01.org/0day-ci/cross-package'
>         local list=/tmp/0day-ci-crosstool-files
> 
> -       lftp -c "open $URL && find -d 3 > $list" || return
> +       lftp -c "open $URL && find -d 3" | sort -V > $list || return
> 
>         local file
>         local gcc_arch_pattern=$(echo "${gcc_arch}" | sed 's/*/.*/g')
> @@ -206,7 +206,7 @@
>         }
> 
>         # use highest available version
> -       gcc_exec=${gcc_exec[-1]}
> +       gcc_evec=$(tr ' ' '\n' <<< ${gcc_exec[@]} | sort -V | tail -n1)
>  }
> 
>  update_path_env_for_parisc()
> @@ -340,7 +340,7 @@
> 
>                 # load build-in depends libs
>                 local
> deplibs_path=($COMPILER_INSTALL_PATH/${COMPILER}*/${gcc_arch}/libexec/gcc/${gcc_arch}/*)
> -               deplibs_path=${deplibs_path[-1]}
> +               deplibs_path=$(tr ' ' '\n' <<< ${deplibs_path[@]} |
> sort -V | tail -n1)
>                 [[ -d $deplibs_path ]] && export
> LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$deplibs_path
> 
>                 install_dependence "$gcc_exec" || return
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada
> _______________________________________________
> LKP mailing list -- lkp@lists.01.org
> To unsubscribe send an email to lkp-leave@lists.01.org

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

* Re: [LKP] Fix make.cross for 0day bot
  2022-09-01  7:06 ` [LKP] " Philip Li
@ 2022-09-01  8:20   ` Masahiro Yamada
  0 siblings, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2022-09-01  8:20 UTC (permalink / raw)
  To: Philip Li
  Cc: lkp, 0day robot, Linux Kernel Mailing List, Linux Kbuild mailing list

On Thu, Sep 1, 2022 at 4:06 PM Philip Li <philip.li@intel.com> wrote:
>
> On Thu, Sep 01, 2022 at 03:55:52PM +0900, Masahiro Yamada wrote:
> > Hello,  maintainers of Intel 0day bot,
> >
> > make.cross is supposed to use the latest GCC by default
> > (according to the comment "use highest available version")
> > but actually chooses GCC 9.3.0 rather than gcc-12.1.0.
>
> thanks a lot for pointing out the issue and fixing it. Do you mind to send
> a PR to https://github.com/intel/lkp-tests, or you suggest we composing
> a patch based on your fix below?
>


Sure, I will make a PR.
Thanks.


-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2022-09-01  8:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01  6:55 Fix make.cross for 0day bot Masahiro Yamada
2022-09-01  7:06 ` [LKP] " Philip Li
2022-09-01  8:20   ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).