summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2026-01-14 00:52:59 +0800
committerruki <[email protected]>2026-01-14 00:52:59 +0800
commit02cd7a65f48466d73ea2ead486a55dfc9109149e (patch)
tree5383f26b7eccc1f7bb43772491a7ff48d486e38c
parent54da3b896476358af87003a46726ab5d17d57f96 (diff)
improve to lock packages
-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