From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 13 Feb 2023 16:03:28 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pRaMb-006KDs-Rc for lore@lore.pengutronix.de; Mon, 13 Feb 2023 16:03:28 +0100 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pRaMZ-0008E8-J3; Mon, 13 Feb 2023 16:03:27 +0100 Received: from luzerne.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::52]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pRaME-0008Da-1V; Mon, 13 Feb 2023 16:03:06 +0100 Message-ID: Date: Mon, 13 Feb 2023 16:03:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Content-Language: en-US To: Christian Melki References: <7a6848be-61a6-6e2b-eb1c-7f9490676f82@pengutronix.de> <4aceca32-4f80-a657-f375-b0bcf8b3c16e@t2data.com> From: =?UTF-8?Q?Sven_P=c3=bcschel?= In-Reply-To: <4aceca32-4f80-a657-f375-b0bcf8b3c16e@t2data.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [ptxdist] Globally define GIT_CEILING_DIRECTORIES? X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Hi Christian, > Just to summarize so I understand this. > You want to limit the searching for git repos, > so that if it isn't found in the current posix PWD (cwd), it's not a > git repo? > I'm assuming it's expandable by doing an export to $PWD? I only want to limit the parent search at a specific directory, not to the current directory. Practically I'm using DistroKit as a BSP with PTXDist. The target package (e.g. sockperf) is downloaded and extracted to /path/to/DistroKit/platform-v8a/build-target/sockperf-3.10 . Currently sockperf executes "git rev-parse HEAD" to get the current commit, that is attached to the version number. As the sockperf-3.10 directory itself isn't a Git directory, git checks the parent directories until it finds the Git repository of DistroKit and returns it's commit hash. This results in sockperf having a Distrokit commit as part of it's version number. lshw as another example used the version tag of Distrokit as it's own version. When setting GIT_CEILING_DIR=/path/to/DistroKit/platform-v8a/build-target , then Git will still backtrack, but stop when it reaches the build-target directory. E.g. when /path/to/Distrokit/platform-v8a/build-target/sockperf-3.10 is a Git repository and some buildscript calls git from /path/to/DistroKit/platform-v8a/build-target/sockperf-3.10/src , then Git still traverses the parent directory to find the sockperf Git repository. But if sockperf-3.10 isn't a git repo, it will stop backtracking to the build-target directory and return that it didn't find a git repository. > Have you tried this as an global? > Afaict, sockperf treats this locally? I've added it locally to sockperf via SOCKPERF_CONF_ENV := $(CROSS_ENV) GIT_CEILING_DIRECTORIES="$(BUILDDIR)" SOCKPERF_MAKE_ENV := $(CROSS_ENV) GIT_CEILING_DIRECTORIES="$(BUILDDIR)" I haven't tried this globally yet, as I'm not that familiar with the PTXDist internals and didn't wanted to spend multiple hours creating a patch and then get the feedback, that there might be a better way to do it. > Also, do you have any anecdotal or factual history from other build > environments? > Some of them rely extensively on git hashes, ie, repos. > They've likely stumbled upon the same question. Nope, PTXDist is my first embedded build environment. Best regards Sven