From patchwork Thu Dec 3 15:57:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 107217 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.17034.1796313431268450935 for ; Thu, 03 Dec 2026 07:57:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=pmL+QPCT; spf=pass (domain: linaro.org, ip: 209.85.218.49, mailfrom: andre.draszik@linaro.org) Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-c5126505cb3so3344766b.0 for ; Thu, 03 Dec 2026 07:57:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796313430; x=1796918230; darn=lists.openembedded.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Oki16Yoqw1Z1pS9MWDhmbCo0hhYCw/AvgjOG+eh6N/0=; b=pmL+QPCT6ZwMAnVzaD9DkM3qIOdCr2cAZKyU9jJM7aQ9m5TpbNHwS+VxB/c4bhHyFF 1VYEQhnnU8h2gx3GhTe3r9YIAWKoAib/G8qrUdkVMa+ADRFTWfPm7/FHLFLHxVqAYqT/ AlplRl6+lx4YwJj5Pw+qcYXq0gvXsPdalK1u9GnS3qeREFU+H/RrM7QKvJj8Q2Cjsrxb Yk6TfNx0VHVK70Docg6DvoZnn6LiCs7DtHI4Gcxk75jvLmCRrF2iAWDJwl9/zciBV0k4 ElpjCL+x1NArE3vYJbgjUDxtKMxJXg8f7xpF/uRKw2zkWL2pKKM+zA9bcLQv2J53Yf34 QGuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796313430; x=1796918230; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Oki16Yoqw1Z1pS9MWDhmbCo0hhYCw/AvgjOG+eh6N/0=; b=Q8vf7TRCxt/UqchLaEYEtkezj0e5EjEpt8mpLF2chkmVL1D79+O1iNRbBqcmazluT5 pglm5wTdyGrDrdg1xt+L7bmgPpWwgBJlMViNX7corRpTi+yzA1aeUyEUc+6gYUWaTYQQ jII1yPDWrpcEHB4jN/OaJRxnVgBYGwlsPNSqtkr6KUpP6VDYnrX8ihyetPNjuNfCGy5V pftQTze5ghDozJZ9mSmxFqnWlEwcfq77p/wNsnU+jhvT9cjIxqWfpPAT5CVjgk1KGzDL LIIQYcMIAfXIrPaCJsL10h6j3EVFky2YMyf3qzAkUFGHWEBrLVYej1oJH4ZkEjlF1jG/ QXQg== X-Gm-Message-State: APuU4Z87Tfq0b6CieznEkxQ/Ib1GImB0WGmsAYkN9vkTLUur6GCJysGX +vjfuT2QVUS1T42mgjT4IFmdJ5t/+B9RNV5fdxXBIO9F9BvjwBE+MrbpPGttZLCfGTkagtejjy5 JyvISZ1Y= X-Gm-Gg: AZFdTZcQzouxAZ+F3cBDaLxAF+YX1veJMBSbBJG1fSHeHyM9WbB5OvWPStYMc1miGVj f/0K1DUZuaqOysoIvaUPx/JPHPcEtk6N0gjpkuiGuyMAYdzx68/H1JtkuAQ2rafx5twnX3G18X+ lBKcnwxYXWKmH1X3VaSCZfBapc19CbeRbhP/hN1w+l9XGSeyzB7SUU+qTzyxsXiQ3TcXNyNEaX9 G+j+f59ctl2K9TftHIy1mSMhb5MTglnq3M8Giwv3egw2iQcE595U/eFfuw8JACcNAxe5X714UQM h+VuKRbmOvzkNeRZxHcJljDKINFjeylRGAofpJbfbwybzALHIix4oIhZyw7Em0O2atvrbBiineV GaIL5JJD9wAJ7FBEeVZlFUKTgiY7Gf1BFK2Gl8yrdFuXi2UH4iPhTOtOlQRUKi2dTuaRPAG+GZN /BxVN5HJGqRZS1wPAH0uX/Tc09ucVowJQcM5sszwwu0OZp7eynLyzhpAlGus3xSpHv54EhGwiU7 8hoxYu+j7Qf3huhYgBa7d397DhdyMrcI5fVLAeicK/RP8/qxzX/Gn6tP/KGtr0/q7VfzFk08YWB WbGXXf06I/CmkQdBpZTi1FLCs1PZzxX3VuJt/4yYJj4JXtYqqVDQ7H4LI5AQ5jKySnPIULSwhjT s+CZsQrXqXNzcGpenp57Yo4k= X-Received: by 2002:a17:907:1b1a:b0:c42:102f:15e8 with SMTP id a640c23a62f3a-c513a999e27mr3468233166b.14.1796313429497; Thu, 03 Dec 2026 07:57:09 -0800 (PST) Return-Path: Received: from puffmais2.c.googlers.com.com (226.124.90.34.bc.googleusercontent.com. [34.90.124.226]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513aec5115sm1455862666b.51.2026.12.03.07.57.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 07:57:08 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= To: openembedded-core@lists.openembedded.org Subject: [OE-core][PATCH] buildhistory: ignore system git config for local operations Date: Thu, 3 Dec 2026 15:57:06 +0000 Message-ID: <20261203155706.535421-1-andre.draszik@linaro.org> X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Thu, 03 Dec 2026 15:57:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251907 BitBake restricts PATH to HOSTTOOLS_DIR rather than the host's /usr/bin, but git still reads /etc/gitconfig. When the system git config enables hooks or helpers backed by host binaries outside HOSTTOOLS (for example, config-based hooks invoking git-secrets), git commit fails with: git: 'secrets' is not a git command. See 'git --help'. Because buildhistory_commit() runs inside `(...) || true`, the failure is silently ignored and no buildhistory commit is created. Neither --no-verify (which does not skip prepare-commit-msg) nor `-c core.hooksPath=/dev/null` (which does not disable config-based `[hook "..."]` entries) prevents the failure. Export GIT_CONFIG_NOSYSTEM=1 for the local repository operations in buildhistory_commit() -- including check_git_config so it does not rely on user.name/user.email from /etc/gitconfig that git commit would then ignore -- and run git push in a separate subshell so BUILDHISTORY_PUSH_REPO can still use system proxy, CA, or credential settings. Tested under /bin/sh -e with a minimal PATH (without git-secrets) across initial and no-change runs with BUILDHISTORY_PUSH_REPO set, verifying GIT_CONFIG_NOSYSTEM=1 on all local git calls and unset on git push. AI-Generated: Uses Gemini Signed-off-by: André Draszik --- meta/classes/buildhistory.bbclass | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index ce6ef8971a..5c66447973 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -811,6 +811,9 @@ ${@buildhistory_get_metadata_revs(d)} END ( cd ${BUILDHISTORY_DIR}/ + # Ignore system git config for local operations so host hooks or + # helpers absent from HOSTTOOLS cannot break buildhistory. + export GIT_CONFIG_NOSYSTEM=1 # Initialise the repo if necessary if [ ! -e .git ] ; then git init -q @@ -833,10 +836,12 @@ END buildhistory_single_commit "$CMDLINE" "$HOSTNAME" dummy else buildhistory_single_commit "$CMDLINE" "$HOSTNAME" - fi - if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then - git push -q ${BUILDHISTORY_PUSH_REPO} fi) || true + if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then + # Keep system git config enabled for push (proxies, CAs, credentials). + ( cd ${BUILDHISTORY_DIR}/ + git push -q ${BUILDHISTORY_PUSH_REPO} ) || true + fi } python buildhistory_eventhandler() {