summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/private/action/require/impl/lock_packages.lua13
1 files 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