utils/docker-run: Bind mount .git/objects if needed
PATCH 1/1 utils/docker-run: Bind mount .git/objects if needed
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 <[email protected]>
--- utils/docker-run | 6 ++++++ 1 file changed, 6 insertions(+)
utils/docker-run +6 -0
@@ -32,6 +32,12 @@ if [ "${GIT_DIR}" ]; then # path already (in a wordir), then that's a noop. GIT_DIR="$(cd "${MAIN_DIR}"; readlink -e "${GIT_DIR}")" docker_opts+=( --mount "type=bind,src=${GIT_DIR},dst=${GIT_DIR}" ) + + # 'repo' stores .git/objects separately. + if [ -L "${GIT_DIR}/objects" ]; then + OBJECTS_DIR="$(readlink -e "${GIT_DIR}/objects")" + docker_opts+=( --mount "type=bind,src=${OBJECTS_DIR},dst=${OBJECTS_DIR}" ) + fi fi if tty -s; then
Signature · 6 lines
2.41.0.640.ga95def55d0-goog _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Nicolas, All,
On 2023-08-08 04:40 +0000, Nicolas Boichat via buildroot spake thusly:
Quoted 5 lines
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-packageto fail.Signed-off-by Nicolas Boichat <[email protected]>
Thanks, I've included this in my respin, after adapting to some rework of mine:
https://patchwork.ozlabs.org/project/buildroot/list/?series=368134
So I've marked this patch as superseded (the new one stil has you as author!).
Thanks!
Regards,
Yann E. MORIN.
Quoted 28 lines
--- utils/docker-run | 6 ++++++ 1 file changed, 6 insertions(+)utils/docker-run +6
-0@@ -32,6 +32,12 @@ if [ "${GIT_DIR}" ]; then # path already (in a wordir), then that's a noop. GIT_DIR="$(cd "${MAIN_DIR}"; readlink -e "${GIT_DIR}")" docker_opts+=( --mount "type=bind,src=${GIT_DIR},dst=${GIT_DIR}" ) + + # 'repo' stores .git/objects separately. + if [ -L "${GIT_DIR}/objects" ]; then + OBJECTS_DIR="$(readlink -e "${GIT_DIR}/objects")" + docker_opts+=( --mount "type=bind,src=${OBJECTS_DIR},dst=${OBJECTS_DIR}" ) + fi fi if tty -s; thenSignature · 6 lines
2.41.0.640.ga95def55d0-goog _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot