From b4417cff35e88a936bd309ebb2102bd8037131a5 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 29 Jul 2025 13:35:03 +0200 Subject: [PATCH] Build: Change make update to always do git lfs pull Some users still have issues getting LFS files downloaded properly, though the exact cause is unclear. Normally with a properly installed git lfs, git pull should already take care of it. When for whatever reason that is not the case and files have not been fetched yet, now do lfs pull which is the same as lfs fetch + lfs checkout. Even when git pull can not run. Ref #143461 Pull Request: https://projects.blender.org/blender/blender/pulls/143478 --- build_files/utils/make_update.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py index 94d8a740d9c..fd93c5e64df 100755 --- a/build_files/utils/make_update.py +++ b/build_files/utils/make_update.py @@ -320,13 +320,8 @@ def work_tree_update(args: argparse.Namespace, use_fetch: bool = True) -> str: # update the branch from the fork. update_command = [args.git_command, "pull", "--rebase"] - # This seems to be required some times, e.g. on initial checkout from third party, non-lfs repository - # (like the github one). The fallback repository set by `lfs_fallback_setup` is fetched, but running the - # `update_command` above does not seem to do the actual checkout for these LFS-managed files. - update_lfs_command = [args.git_command, "lfs", "checkout"] call(update_command) - call(update_lfs_command) return "" @@ -338,6 +333,17 @@ def blender_update(args: argparse.Namespace) -> str: return work_tree_update(args) +# Extra LFS update for blender repository +def blender_lfs_update(args: argparse.Namespace) -> None: + print_stage("Updating Blender Git LFS") + + # This seems to be required some times, e.g. on initial checkout from third party, non-lfs repository + # (like the github one). The fallback repository set by `lfs_fallback_setup` is fetched, but running the + # `update_command` above does not seem to do the actual checkout for these LFS-managed files. + update_lfs_command = [args.git_command, "lfs", "pull"] + call(update_lfs_command) + + def resolve_external_url(blender_url: str, repo_name: str) -> str: return urljoin(blender_url + "/", "../" + repo_name) @@ -689,6 +695,7 @@ def main() -> int: blender_skip_msg = blender_update(args) if blender_skip_msg: blender_skip_msg = "Blender repository skipped: " + blender_skip_msg + "\n" + blender_lfs_update(args) if not args.no_libraries: libraries_skip_msg += initialize_precompiled_libraries(args)