mirror of
git://f0xx.org/ac/ac-scripts
synced 2026-08-09 20:59:09 +03:00
Fix isolated builder: standalone mobile clone for Docker git checkout.
Submodule gitfile paths break when only ac-mobile-android is mounted as /workspace; clone the mobile repo directly instead of submodule init. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -179,14 +179,31 @@ stage_ci_scripts() {
|
||||
done
|
||||
}
|
||||
|
||||
init_mobile_submodule_only() {
|
||||
init_mobile_standalone() {
|
||||
local base="$1"
|
||||
local ref="${GIT_REF:-next}"
|
||||
if [[ ! -d "${base}/.git" ]]; then
|
||||
return 0
|
||||
fi
|
||||
if git -C "$base" config -f .gitmodules --get "submodule.${MOBILE_SUBDIR}.path" >/dev/null 2>&1; then
|
||||
log "[runner] isolate: init workspace submodule ${MOBILE_SUBDIR} (no third-party recurse)"
|
||||
run_step git-submodule-mobile git -c safe.directory="${base}" -C "${base}" submodule update --init "${MOBILE_SUBDIR}"
|
||||
local url path
|
||||
url="$(git -C "$base" config -f .gitmodules --get "submodule.${MOBILE_SUBDIR}.url" 2>/dev/null || true)"
|
||||
path="$(git -C "$base" config -f .gitmodules --get "submodule.${MOBILE_SUBDIR}.path" 2>/dev/null || true)"
|
||||
if [[ -z "$url" || -z "$path" ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
log "[runner] isolate: standalone clone ${path} for docker mount (avoid gitfile ../.git/modules)"
|
||||
rm -rf "${base}/${path}"
|
||||
if [[ -n "${GIT_SHA:-}" ]]; then
|
||||
run_step git-clone-mobile git clone --depth "${CLONE_DEPTH}" "$url" "${base}/${path}"
|
||||
run_step git-fetch-mobile git -c safe.directory="${base}/${path}" -C "${base}/${path}" fetch --depth "${CLONE_DEPTH}" origin "${GIT_SHA}"
|
||||
run_step git-checkout-mobile git -c safe.directory="${base}/${path}" -C "${base}/${path}" checkout "${GIT_SHA}"
|
||||
elif git clone --depth "${CLONE_DEPTH}" --single-branch --branch "${ref}" "$url" "${base}/${path}" 2>/dev/null; then
|
||||
:
|
||||
else
|
||||
run_step git-clone-mobile git clone --depth "${CLONE_DEPTH}" "$url" "${base}/${path}"
|
||||
run_step git-fetch-mobile git -c safe.directory="${base}/${path}" -C "${base}/${path}" fetch --depth "${CLONE_DEPTH}" origin "${ref}"
|
||||
run_step git-checkout-mobile git -c safe.directory="${base}/${path}" -C "${base}/${path}" checkout "${ref}"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -218,7 +235,7 @@ prepare_isolated_source() {
|
||||
run_step git-pin git -c safe.directory="${SOURCE_DIR}" -C "${SOURCE_DIR}" checkout "${GIT_SHA}"
|
||||
fi
|
||||
|
||||
init_mobile_submodule_only "${SOURCE_DIR}"
|
||||
init_mobile_standalone "${SOURCE_DIR}"
|
||||
|
||||
local host_tree iso_tree
|
||||
host_tree="$(host_mobile_tree)"
|
||||
|
||||
Reference in New Issue
Block a user