From: Herve Codina via buildroot <buildroot@buildroot.org>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Brandon Maier <brandon.maier@collins.com>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] ppd-merge: speed up per-package-rsync
Date: Wed, 29 Nov 2023 09:17:10 +0100 [thread overview]
Message-ID: <20231129091710.61738710@bootlin.com> (raw)
In-Reply-To: <20231128210717.GA107928@scaer>
Hi Yann,
On Tue, 28 Nov 2023 22:07:17 +0100
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:
> Brandon, All,
>
> +Thomas for the intial work on this topic
>
> On 2023-11-27 22:41 +0000, Brandon Maier spake thusly:
> > The per-package-rsync stage can add a significant amount of time to
> > builds. They can also be annoying as the slowest rsyncs, the final
> > target-finalize and host-finalize stages, run on `make all` which we use
> > frequently during development.
> >
> > The per-package-rsync is slow because it launches a new rsync for each
> > source tree, and each rsync must rescan the destination directory and
> > potentially overwrite files multiple times. So instead we manually walk
> > the source trees to find only the files that should be written to the
> > destination, then feed that to a single instance of rsync.
>
> Sorry, I haven't looked into the script in details, but why can't we
> just do something like:
>
> rsync -a \
> --hard-links \
> $(if $(filter hardlink,$(4)), \
> --link-dest=$(PER_PACKAGE_DIR)/$(pkg)/$(2)/, \
> $(if $(filter copy,$(4)), \
> $(empty), \
> $(error per-package-rsync can only "copy" or "hardlink", not "$(4)") \
> ) \
> ) \
> $(patsubst %, $(PER_PACKAGE_DIR)/%/$(2)/, $(1)) \
> $(3)
>
> rsync can take multiple sources, and is usually pretty fast, so I would
> very much prefer that we do not invent our own tooling if a single rsync
> can do the job.
>
> Also, the copy situation is now only ever needed when we aggregate the
> final target and host directories, while the hard-linking case is used
> when assembling each per-package; so there is no point in benchmarking
> the copy mode for the per-package preparation, or the hard-linking for
> the final target and host assembling.
>
> Hervé, Thomas, do you remember if we ever addressed using a single rsync
> rather than multiple ones in your previous work on the topic, and if so,
> why we did not use that?
I think we did only multiple rsync calls.
We had in mind the file overwrite detection and so we did the operation
per package keeping the $(foreach pkg,$(1), ...) loop.
And why we did not use that ?
First because I didn't think about it...
and second because we were in the strategy to check overwrites per package.
Best regards,
Hervé
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2023-11-29 8:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-27 22:41 [Buildroot] [PATCH 1/1] ppd-merge: speed up per-package-rsync Brandon Maier via buildroot
2023-11-28 15:49 ` Herve Codina via buildroot
2023-11-28 17:21 ` [Buildroot] [External] " Maier, Brandon L Collins via buildroot
2023-11-28 17:54 ` Herve Codina via buildroot
2023-11-28 18:04 ` Maier, Brandon L Collins via buildroot
2023-11-28 21:07 ` [Buildroot] " Yann E. MORIN
2023-11-29 0:00 ` [Buildroot] [External] " Maier, Brandon L Collins via buildroot
2023-11-29 8:17 ` Herve Codina via buildroot [this message]
2023-12-01 17:05 ` [Buildroot] [PATCH v2 " Brandon Maier via buildroot
2023-12-04 12:46 ` Herve Codina via buildroot
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=20231129091710.61738710@bootlin.com \
--to=buildroot@buildroot.org \
--cc=brandon.maier@collins.com \
--cc=herve.codina@bootlin.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=yann.morin.1998@free.fr \
/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