[PATCH] buildman: Use git worktrees instead of git clones

Simon Glass sjg at chromium.org
Wed Sep 2 19:07:01 CEST 2020


Hi Alper,

On Wed, 2 Sep 2020 at 06:36, Alper Nebi Yasak <alpernebiyasak at gmail.com> wrote:
>
> This patch makes buildman create linked working trees instead of clones
> of the source repository, but keeps updating the older clones of the
> repository that might already exist. These worktrees share "everything
> except working directory specific files such as HEAD, index, etc." with
> the source repository. See the git-worktree(1) manual page for more
> information.
>
> Signed-off-by: Alper Nebi Yasak <alpernebiyasak at gmail.com>
> ---
> The git-worktree is available since about 2015 (git v2.5), but its
> manual page mentions this in its BUGS section:
>
>    Multiple checkout in general is still experimental, and the
>    support for submodules is incomplete. It is NOT recommended to
>    make multiple checkouts of a superproject.
>
> I think it'll be fine since U-Boot doesn't use submodules, but still
> wanted to let you know.

I'd really like to do this as it cuts the disk space alot,
particularly with a 30-core machine. I tried to do something similar
with symlinks when I first wrote buildman, but it did not seem to be
possible without copying files and doing things under the hood that I
didn't like.

It looks like that version of git was not in Ubuntu 14.04 but appeared
in 16.04. I've just done some patches to make patman work in 14.04, so
I'd prefer to keep buildman working for that also.

So I think we should have an option to keep the old behaviour, or
perhaps detect when 'git worktree' is not available and fall back.

>
>  tools/buildman/builder.py   | 36 ++++++++++++++++++++++++------------
>  tools/buildman/func_test.py |  2 ++
>  tools/patman/gitutil.py     | 28 ++++++++++++++++++++++++++++
>  3 files changed, 54 insertions(+), 12 deletions(-)
>

Regards,
Simon


More information about the U-Boot mailing list