[Buildroot] [PATCH 3/5] utils/docker-run: bind mount .git/objects if needed
Yann E. MORIN
yann.morin.1998 at free.fr
Thu Aug 10 19:13:10 UTC 2023
Nicolas, All,
On 2023-08-10 08:23 +0800, Nicolas Boichat via buildroot spake thusly:
> On Thu, Aug 10, 2023 at 5:24 AM Yann E. MORIN < [1]yann.morin.1998 at free.fr> wrote:
> From: Nicolas Boichat < [2]drinkcat at google.com>
>
> If buildroot is checked out as part of a 'repo' manifest, docker-run
> doesn't fully bind mount the .git directory, leading to commands such
> as `utils/docker-run make check-package` to fail.
>
> Signed-off-by: Nicolas Boichat < [3]drinkcat at google.com>
> [ [4]yann.morin.1998 at free.fr: use newly introduced mountpoints list]
> Signed-off-by: Yann E. MORIN < [5]yann.morin.1998 at free.fr>
> ---
> utils/docker-run | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/utils/docker-run b/utils/docker-run
> index 7b27a9b05c..ff903b96e9 100755
> --- a/utils/docker-run
> +++ b/utils/docker-run
> @@ -33,6 +33,12 @@ if [ "${GIT_DIR}" ]; then
> # path already (in a wordir), then that's a noop.
> GIT_DIR="$(cd "${MAIN_DIR}"; readlink -e "${GIT_DIR}")"
> mountpoints+=( "${GIT_DIR}" )
> +
> + # 'repo' stores .git/objects separately.
> + if [ -L "${GIT_DIR}/objects" ]; then
> + OBJECTS_DIR="$(cd "${MAIN_DIR}"; readlink -e "${GIT_DIR}/objects")"
>
> I intentionally removed `cd "${MAIN_DIR}"` in my patch, as ${GIT_DIR}
> has already been made an absolute path, just above, so the cd
> operation is unnecessary.
That's right. But for symetry, I preferred to use the same construct.
True, that's superfluous, but at least we don;t have to think too hard
about it when we look at the code.
Thanks for the feedback; I should probably have mentioned that in the
commit log.
Regards,
Yann E. MORIN.
> + mountpoints+=( "${OBJECTS_DIR}" )
>
> Otherwise, that's a nice cleanup ,-)
> Thanks!
>
>
> + fi
> fi
>
> if [ "${BR2_DL_DIR}" ]; then
> --
> 2.25.1
>
> Links:
> 1. mailto:yann.morin.1998 at free.fr
> 2. mailto:drinkcat at google.com
> 3. mailto:drinkcat at google.com
> 4. mailto:yann.morin.1998 at free.fr
> 5. mailto:yann.morin.1998 at free.fr
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
More information about the buildroot
mailing list