Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Matthew Weber <matthew.weber@collins.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/3] utils/test-pkg: add support for externals
Date: Mon, 3 Jan 2022 21:59:31 +0100	[thread overview]
Message-ID: <20220103205931.GN69135@scaer> (raw)
In-Reply-To: <20211201230827.35080-1-matthew.weber@collins.com>

Matthew, All,

On 2021-12-01 17:08 -0600, Matthew Weber via buildroot spake thusly:
> Add support to test-pkg to allow the usage br2-externals, so that
> it may be leveraged for packages outside of upstream buildroot as well.

Why is it even needed? Just pass BR2_EXTERNAL in the environment:

    BR2_EXTERNAL=/path/to/foo:/path/to/bar ./utils/test-pkg

Maybe we should change the manual to state that BR2_EXTERNAL can be set
in the environment as well, and the help for ./utils/test-pkg could also
mention that.

Oh, and by the way: we should not have added the -e option to
support/kconfig/merge_config.sh either, because even in that case,
BR2_EXTERNAL in the environment works as well.

Regards,
Yann E. MORIN.

> Signed-off-by: Matthew Weber <matthew.weber@collins.com>
> ---
>  utils/test-pkg | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/utils/test-pkg b/utils/test-pkg
> index 526b95b1fb..d0472f176b 100755
> --- a/utils/test-pkg
> +++ b/utils/test-pkg
> @@ -3,6 +3,7 @@ set -e
>  
>  TOOLCHAINS_CSV='support/config-fragments/autobuild/toolchain-configs.csv'
>  TEMP_CONF=""
> +BR2_EXTERNALS=""
>  
>  do_clean() {
>      if [ ! -z "${TEMP_CONF}" ]; then
> @@ -17,8 +18,8 @@ main() {
>      local -a toolchains
>      local pkg_br_name
>  
> -    o='hakc:d:n:p:r:t:'
> -    O='help,all,keep,prepare-only,config-snippet:,build-dir:,number:,package:,random:,toolchains-csv:'
> +    o='hakc:d:n:p:r:t:e:'
> +    O='help,all,keep,prepare-only,config-snippet:,build-dir:,number:,package:,random:,toolchains-csv:,externals:,'
>      opts="$(getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}")"
>      eval set -- "${opts}"
>  
> @@ -61,6 +62,9 @@ main() {
>          (-t|--toolchains-csv)
>              toolchains_csv="${2}"; shift 2
>              ;;
> +        (-e|--externals)
> +            BR2_EXTERNALS="${2}"; shift 2
> +            ;;
>          (--)
>              shift; break
>              ;;
> @@ -155,7 +159,7 @@ build_one() {
>  
>      mkdir -p "${dir}"
>  
> -    CONFIG_= support/kconfig/merge_config.sh -O "${dir}" \
> +    CONFIG_= support/kconfig/merge_config.sh -e "${BR2_EXTERNALS}" -O "${dir}" \
>          "${toolchainconfig}" "support/config-fragments/minimal.config" "${cfg}" \
>          >> "${dir}/logfile" 2>&1
>      # We want all the options from the snippet to be present as-is (set
> @@ -181,7 +185,7 @@ build_one() {
>      fi
>  
>      if [ -n "${pkg}" ]; then
> -        if ! make O="${dir}" "${pkg}-dirclean" >> "${dir}/logfile" 2>&1; then
> +        if ! make BR2_EXTERNAL="${BR2_EXTERNALS}" O="${dir}" "${pkg}-dirclean" >> "${dir}/logfile" 2>&1; then
>              return 2
>          fi
>      fi
> @@ -193,14 +197,14 @@ build_one() {
>  
>      # legal-info done systematically, because some packages have different
>      # sources depending on the configuration (e.g. lua-5.2 vs. lua-5.3)
> -    if ! make O="${dir}" legal-info >> "${dir}/logfile" 2>&1; then
> +    if ! make BR2_EXTERNAL="${BR2_EXTERNALS}" O="${dir}" legal-info >> "${dir}/logfile" 2>&1; then
>          return 3
>      fi
>  
>      # If we get here, the build was successful. Clean up the build/host
>      # directories to save disk space, unless 'keep' was set.
>      if [ ${keep} -ne 1 ]; then
> -        make O="${dir}" clean >> "${dir}/logfile" 2>&1
> +        make BR2_EXTERNAL="${BR2_EXTERNALS}" O="${dir}" clean >> "${dir}/logfile" 2>&1
>      fi
>  }
>  
> @@ -271,6 +275,10 @@ Options:
>          Only prepare the .config files, but do not build them. Output the
>          list of build directories to stdout, and the status on stderr.
>  
> +    -e, --externals
> +        Externals to be used as part of the build process. Packages from
> +        within these externals may be tested.
> +
>  Example:
>  
>      Testing libcec would require a config snippet that contains:
> -- 
> 2.17.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      parent reply	other threads:[~2022-01-03 20:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 23:08 [Buildroot] [PATCH 1/3] utils/test-pkg: add support for externals Matthew Weber via buildroot
2021-12-01 23:08 ` [Buildroot] [PATCH 2/3] utils/test-pkg: add ability to fail when skipped Matthew Weber via buildroot
2022-01-01 21:08   ` Yann E. MORIN
2022-01-31 20:54     ` Arnout Vandecappelle
2021-12-01 23:08 ` [Buildroot] [PATCH 3/3] docs/manual: add section describing testing external applications Matthew Weber via buildroot
2022-01-03 20:59 ` Yann E. MORIN [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220103205931.GN69135@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=matthew.weber@collins.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox