Open dozylynx opened 7 years ago
Your code is incredibly hard to read, and would make build setups more complicated, less flexible and prone to errors (like if a submodule gets added later, or if the branch you want to build doesn't use the same submodules).
If we really want this (I don't), then git submodules is probably not the right tool for us, and we should replace it entirely.
If your end-goal is to reduce build time, there are many other areas that could be improved. For example, removing the "x11" distro feature on all the images (except UIVM) could shave off dozens of minutes, not seconds!
TL;DR: that's a -1 for me.
Well, I'm saddened to hear that these two commits, each with fewer than twenty lines of commented shell code, with clear variable names, exceed your complexity tolerance threshold for the project build system.
I made these changes by tuning my local build to reduce the time to get bitbake active and submitted the PR since it should be valuable to anyone else using the project's recommended build system.
Though they are challenging to read, regular expressions have been a standard UNIX tool syntax for a long time. Their use for this task, parsing and amending the necessary config file, is reasonable.
"more complicated" : It adds six more git repositories to a git mirror, and less than thirty lines of commented shell code total to the build system.
"less flexible" : I don't believe so. You don't have to put the repositories in your mirror if you don't want to.
"prone to errors" : No, it handles them gracefully. "(like if a submodule gets added later, or if the branch you want to build doesn't use the same submodules)"
Either of those cases work just fine. A comment in the patch:
Detect presence in the mirror with git's ls-remote command
shows where the git mirror copy will be used, only if there is one, otherwise leaving the git submodule configuration unchanged and defaulting to the existing behaviour: clone from upstream.
OpenEmbedded core takes a long time to clone from source, so this speeds up the build. Use copies of upstream layers in the local git mirror, if available. Make them available by default when setting up the git mirror.
Signed-off-by: Christopher Clark christopher.clark6@baesystems.com