From 02cd7a65f48466d73ea2ead486a55dfc9109149e Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 14 Jan 2026 00:52:59 +0800 Subject: improve to lock packages --- xmake/modules/private/action/require/impl/lock_packages.lua | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/xmake/modules/private/action/require/impl/lock_packages.lua b/xmake/modules/private/action/require/impl/lock_packages.lua index fe5642f6f..61cc19a85 100644 --- a/xmake/modules/private/action/require/impl/lock_packages.lua +++ b/xmake/modules/private/action/require/impl/lock_packages.lua @@ -39,15 +39,10 @@ function _lock_package(instance) result.branch = instance:branch() result.tag = instance:tag() if repo then - local lastcommit - local manifest = instance:manifest_load() - if manifest and manifest.repo then - lastcommit = manifest.repo.commit - end - if not lastcommit then - lastcommit = repo:commit() - end - result.repo = {url = repo:url(), commit = lastcommit, branch = repo:branch()} + -- Even when locking pre-compiled packages, + -- we always use the repo and commit info in the current repository (instead of precompiled-artifacts manifest) + -- to ensure that the repo information remains stable when reverting to source code installation. + result.repo = {url = repo:url(), commit = repo:commit(), branch = repo:branch()} end return result end -- cgit v1.3.1