fix(ci): clone submodule content in rattler-build package
Some checks failed
Build and Test / build (pull_request) Has been cancelled

rattler-build's source.path copy does not include submodule contents —
directories like mods/silo/, mods/solver/, mods/gears/, and mods/datums/
end up empty in the work directory, causing cmake --install to fail
when it tries to install files from those paths.

Add a clone_if_empty helper to build.sh that detects empty submodule
directories and shallow-clones them from their remotes before CMake
runs. Add git to build requirements in recipe.yaml.

This fixes the release build (AppImage) failure where cmake --install
failed at the silo addon install step after successfully installing
the silo tree-node icons from src/Mod/Create/resources/.
This commit is contained in:
forbes
2026-03-03 08:28:17 -06:00
parent c60b4dbee1
commit 784d172a61
2 changed files with 19 additions and 0 deletions

View File

@@ -11,6 +11,24 @@ mkdir -p "$CCACHE_DIR"
echo "ccache config: CCACHE_DIR=$CCACHE_DIR CCACHE_BASEDIR=$CCACHE_BASEDIR"
ccache -z || true
# rattler-build's source.path does not copy submodule contents — clone them
# if the directories are missing or empty.
clone_if_empty() {
local dir="$1" url="$2" ref="$3"
local count
count=$(find "${dir}" -mindepth 1 -not -name '.git' 2>/dev/null | head -1 | wc -l)
if [ "$count" -eq 0 ]; then
echo "Submodule ${dir} missing content — cloning from ${url} (${ref})"
rm -rf "${dir}"
git clone --depth 1 --branch "${ref}" --recurse-submodules "${url}" "${dir}"
fi
}
clone_if_empty mods/silo https://git.kindred-systems.com/kindred/silo-mod.git main
clone_if_empty mods/solver https://git.kindred-systems.com/kindred/solver.git main
clone_if_empty mods/gears https://git.kindred-systems.com/kindred/gears.git main
clone_if_empty mods/datums https://git.kindred-systems.com/kindred/datums.git main
if [[ ${HOST} =~ .*linux.* ]]; then
CMAKE_PRESET=conda-linux-release
fi

View File

@@ -16,6 +16,7 @@ requirements:
build:
- ccache
- cmake
- git
- compilers>=1.10,<1.11
- doxygen
- icu>=75,<76