public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Arjun Shankar <arjun@redhat.com>
To: Palmer Dabbelt <palmer@rivosinc.com>
Cc: simon.chopin@canonical.com, "Carlos O'Donell" <carlos@redhat.com>,
	 libc-alpha@sourceware.org, Andreas Schwab <schwab@suse.de>
Subject: Re: [PATCH v2] build-many-glibcs.py: Avoid loading user/system configurations
Date: Mon, 18 Mar 2024 14:31:00 +0100	[thread overview]
Message-ID: <CAG_osaYs9uJ4_d4vc9aWsOrAWeH-tiVChORpHOzpmsSOzq=MJw@mail.gmail.com> (raw)
In-Reply-To: <20240313000429.23213-2-palmer@rivosinc.com>

> I have commit verification turned on by default, which trips up pulling
> when there is a non-signed commit at HEAD.  There's likely a whole class
> of similar configuration issues that could crop up, so this just ignores
> user configuration files entirely.
>
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

Looks like this unconditionally sets these environment variables? I'm
wondering if this limits other use cases like e.g., users who set
these environment variables and expect those values to be used during
build-many-glibcs (for whatever reason)?

> ---
> This has been pretty lightly tested, but it seems to not be breaking
> anything on my end.
>
> Changes since v1 <20240112185846.24483-1-palmer@rivosinc.com/>:
> * Ignore the git configs rather than passing "--no-verify-signatures" to
>   "git pull" commands.
> ---
>  scripts/build-many-glibcs.py | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
> index cc30dd5862..0d06ca1ba4 100755
> --- a/scripts/build-many-glibcs.py
> +++ b/scripts/build-many-glibcs.py
> @@ -1976,8 +1976,15 @@ def check_for_required_tools():
>      if count_old_tools > 0 or count_missing_tools > 0:
>          exit (1);
>
> +def setup_env_vars():
> +    # Prevents git from loading configuration files, to avoid tripping over
> +    # user settings like --verify-signatures.
> +    os.environ["GIT_CONFIG_GLOBAL"]   = "/dev/null"
> +    os.environ["GIT_CONFIG_NOSYSTEM"] = "1"
> +
>  def main(argv):
>      """The main entry point."""
> +    setup_env_vars();
>      check_for_required_tools();
>      parser = get_parser()
>      opts = parser.parse_args(argv)
> --
> 2.43.0
>


-- 
Arjun Shankar
he/him/his


  parent reply	other threads:[~2024-03-18 13:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13  0:04 Palmer Dabbelt
2024-03-13  9:01 ` Andreas Schwab
2024-03-18 13:31 ` Arjun Shankar [this message]
2024-03-18 15:41   ` Palmer Dabbelt
2024-03-18 16:07     ` Arjun Shankar

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='CAG_osaYs9uJ4_d4vc9aWsOrAWeH-tiVChORpHOzpmsSOzq=MJw@mail.gmail.com' \
    --to=arjun@redhat.com \
    --cc=carlos@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=palmer@rivosinc.com \
    --cc=schwab@suse.de \
    --cc=simon.chopin@canonical.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).