From patchwork Wed May 31 13:58:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeffery To X-Patchwork-Id: 1788386 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=ggmDasiS; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=jmATxPM1; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QWWCG6XK2z20PW for ; Thu, 1 Jun 2023 00:01:30 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Fk9Ux2l/It2aTjs/G/rMvN5Bfb2XzLIz8q6Q83i7SSg=; b=ggmDasiSw7uWnY E1MKJKTxOOj1PkbmMk5xPAogKG/W6j6mflEprKPydTfR4iJqPDS0dmfCkGWpCkz6trtClr3zuw9g8 AXpmLFKyJ6ZvnxiP0VbtTN5H2qwRJ7C2TG0FXseVD9bzaVw+14siMzcDynUkDnExHb92OWXaWU1G4 7bReJBAETrgxFvLHJzphP8OIXPA/h4ayDSTnyI0zY+OdEs3YoNEywpU1zq6bTut6jDg5zuTD4CjTy 00tpZIo958rJzhrIuw5n3f2qhmOrrOeutkS/5NQPeHlVLPsbzuuDiQY+jTlqJvZRJVh2ygUbuNzwE Tcpm0kHslLO0u56hMIGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q4MLk-0003kG-1u; Wed, 31 May 2023 13:58:52 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q4MLi-0003jS-0U for openwrt-devel@lists.openwrt.org; Wed, 31 May 2023 13:58:51 +0000 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5144a9c11c7so5157668a12.2 for ; Wed, 31 May 2023 06:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685541526; x=1688133526; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UA3MWTgHk6f9qiGgHOtENQU03tml5gCgBkcxXOmoUOM=; b=jmATxPM1bQJRHaGZmmq+GMBuw0ZLi2j1jCcqy4NCyFmoBjuIwX3KJ0ckc/vJecC8K+ UhvME87CaCR38WkWa0VCFZ3BAuIXsrj+tiSGelbN7yFs9hK+rWryJl7b9QUc13EW4MOS fAHfkJKj1+uKzdj+RVqD1cRTr+Bt1ymYYDOosdSaB1XePJmlA/tNCd3dRkMK5tGv8Fq5 gqobcfX3/ublyhjofiiKT4iwF04k4kj/btnJMJYU7FfOUf5PXm9TXZ01WZwIsOuen+bu awyM6fhS0W6o5lvuDNZxux5Bk1IYM5bKr5mMOYOOf+QrhDbioJmbzBq3Z853l2S1PPgz m60A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685541526; x=1688133526; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UA3MWTgHk6f9qiGgHOtENQU03tml5gCgBkcxXOmoUOM=; b=Lz5McVzOe36m9rIwx12pF0AZR/dX4GBdaXFKzbywjIvEz6yjn0WtROEDNilU+ZpPBM uwHK8/t+NcLf7OmSiVaK0tr6+oo3Xq9KT6Jnjesv83SsT1l0I+WN2gDbkHftTNBHqp0/ QniN4pz2N6RWVI9tNrMA36k5cz+ep3ykSjemzjVJZQPLVTwAlat+IHc2HbjgVoPbIO6n 4jx/QesjGz+r72Bt4C3yyDf7X9h4g/I0/Z12LqK29PZxrFeR6V4baWIaEsWXW2lsTZ14 nBXwHlLR8yAYW4pM56N0ti8gnfWyTo0ajl+5SPhvyRupPUnSgilVlURf5NPk5uK5BDAz wNyQ== X-Gm-Message-State: AC+VfDy/svPZF99zWcXaighaHT4Xz0PnOTq3wp241pN/b0CNG0noglcx mj5lo2t8d3zIxqEMOzmc6JDBi+gBMgQ= X-Google-Smtp-Source: ACHHUZ67OXWrgqAQsK8Xuuks/q2MEl4vmI3oWrdT5BiQ4hYuuHQtuhUhm7MzVTGH7UmM00o/uCYdBA== X-Received: by 2002:a17:903:cd:b0:1af:fd3a:2b4d with SMTP id x13-20020a17090300cd00b001affd3a2b4dmr4870339plc.58.1685541525905; Wed, 31 May 2023 06:58:45 -0700 (PDT) Received: from computer.fishbiscuits (014136003020.ctinets.com. [14.136.3.20]) by smtp.gmail.com with ESMTPSA id v9-20020a170902b7c900b001ae3b51269dsm1369490plz.262.2023.05.31.06.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 06:58:45 -0700 (PDT) From: Jeffery To To: openwrt-devel@lists.openwrt.org Cc: Jeffery To Subject: [PATCH] build: export GIT_CEILING_DIRECTORIES for package builds Date: Wed, 31 May 2023 21:58:34 +0800 Message-Id: <20230531135834.2150795-1-jeffery.to@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230531_065850_192965_88AAF293 X-CRM114-Status: UNSURE ( 9.33 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: A package may run git as part of its build process, and if the package source code is not from a git checkout, then git may traverse up the directory tree to find buildroot's repository directory (.gi [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:535 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jeffery.to[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org A package may run git as part of its build process, and if the package source code is not from a git checkout, then git may traverse up the directory tree to find buildroot's repository directory (.git). For instance, Poetry Core, a Python build backend, will read the contents of .gitignore for paths to exclude when creating a Python package. If it finds buildroot's .gitignore file, then Poetry Core will exclude all of the package's files[1]. This exports GIT_CEILING_DIRECTORIES for both package and host builds so that git will not traverse beyond $(BUILD_DIR)/$(BUILD_DIR_HOST). [1]: https://github.com/python-poetry/poetry/issues/5547 Signed-off-by: Jeffery To --- include/host-build.mk | 1 + include/package.mk | 1 + 2 files changed, 2 insertions(+) diff --git a/include/host-build.mk b/include/host-build.mk index b7fb0a737f14..7485f91e422e 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -131,6 +131,7 @@ define Host/Exports/Default $(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX) $(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig $(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig + $(1) : export GIT_CEILING_DIRECTORIES=$$(BUILD_DIR_HOST) $(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE)) $(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG)) endef diff --git a/include/package.mk b/include/package.mk index f03cb15f05d5..c391d320aa2c 100644 --- a/include/package.mk +++ b/include/package.mk @@ -194,6 +194,7 @@ define Build/Exports/Default $(1) : export CONFIG_SITE:=$$(CONFIG_SITE) $(1) : export PKG_CONFIG_PATH:=$$(PKG_CONFIG_PATH) $(1) : export PKG_CONFIG_LIBDIR:=$$(PKG_CONFIG_PATH) + $(1) : export GIT_CEILING_DIRECTORIES:=$$(BUILD_DIR) endef Build/Exports=$(Build/Exports/Default)