[PATCH v2] build-many-glibcs.py: Avoid loading user/system configurations

Palmer Dabbelt palmer@rivosinc.com
Wed Mar 13 00:04:30 GMT 2024


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>
---
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



More information about the Libc-alpha mailing list