All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anthony PERARD" <anthony.perard@vates.tech>
To: "Stefano Stabellini" <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, "Doug Goldstein" <cardoe@cardoe.com>
Subject: Re: [XEN PATCH] automation: Avoid changing source files for randconfig tests
Date: Thu, 27 Mar 2025 10:58:26 +0000	[thread overview]
Message-ID: <Z-UvUUwUToTr5OgD@l14> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2503261910100.563920@ubuntu-linux-20-04-desktop>

On Wed, Mar 26, 2025 at 07:10:52PM -0700, Stefano Stabellini wrote:
> On Wed, 26 Mar 2025, Anthony PERARD wrote:
> > diff --git a/automation/scripts/build b/automation/scripts/build
> > index 522efe774e..8a3b8fb6b2 100755
> > --- a/automation/scripts/build
> > +++ b/automation/scripts/build
> > @@ -12,12 +12,12 @@ $cc --version
> >  # random config or default config
> >  if [[ "${RANDCONFIG}" == "y" ]]; then
> >  
> > -    # Append job-specific fixed configuration
> > -    if [[ -n "${EXTRA_FIXED_RANDCONFIG}" ]]; then
> > -        echo "${EXTRA_FIXED_RANDCONFIG}" >> xen/tools/kconfig/allrandom.config
> > -    fi
> > +    cp -f xen/tools/kconfig/allrandom.config xen/allrandom.config.tmp
> 
> Wouldn't it be better to use mktemp?
> 
> local tmpconfig=$(mktemp)

I though of it and I wasn't sure if we could use it in the CI, but it's
already been used so that's an option. (Actually, there's only a single
use by ./check-endbr.sh, ./configure does use it as well but to create
temporary directory within the build tree.)

But, to avoid overflowing /tmp with loads of leftover temporary files,
we need to clean it, with:

    trap "rm $tmpconfig" EXIT

The advantage of using an in-tree files with a predefined name is that
it isn't going to create more than one file, no matter how many time you
run ./build. The '*.tmp' files are already ignored by our .gitignore. I
could rename it to with a "." to hide it a bit more.

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


  reply	other threads:[~2025-03-27 10:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-26 14:28 [XEN PATCH] automation: Avoid changing source files for randconfig tests Anthony PERARD
2025-03-27  2:10 ` Stefano Stabellini
2025-03-27 10:58   ` Anthony PERARD [this message]
2025-03-27 22:59     ` Stefano Stabellini
2025-04-04 14:18       ` Anthony PERARD
2025-04-16  0:04         ` Stefano Stabellini

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=Z-UvUUwUToTr5OgD@l14 \
    --to=anthony.perard@vates.tech \
    --cc=cardoe@cardoe.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 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.