mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: "Sven Püschel" <s.pueschel@pengutronix.de>
To: Christian Melki <christian.melki@t2data.com>
Cc: ptxdist@pengutronix.de
Subject: Re: [ptxdist] Globally define GIT_CEILING_DIRECTORIES?
Date: Mon, 13 Feb 2023 16:03:05 +0100	[thread overview]
Message-ID: <a360cdfa-6d39-74e1-01c7-028abaafa4c0@pengutronix.de> (raw)
In-Reply-To: <4aceca32-4f80-a657-f375-b0bcf8b3c16e@t2data.com>

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




  reply	other threads:[~2023-02-13 15:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 13:58 Sven Püschel
2023-02-13 14:24 ` Christian Melki
2023-02-13 15:03   ` Sven Püschel [this message]
2023-02-13 19:27     ` Christian Melki
2023-02-14 10:32 ` Michael Riesch
2023-02-14 14:21 ` Michael Olbrich
2023-02-27 21:22   ` Michael Riesch
2023-03-03  7:25     ` Michael Olbrich
2023-03-06  8:34       ` Michael Riesch

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=a360cdfa-6d39-74e1-01c7-028abaafa4c0@pengutronix.de \
    --to=s.pueschel@pengutronix.de \
    --cc=christian.melki@t2data.com \
    --cc=ptxdist@pengutronix.de \
    /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