Skip to content

Commit ff083f9

Browse files
committed
fix package cachedir
1 parent 7cf2ec4 commit ff083f9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

xmake/core/package/package.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,18 @@ function _instance:cachedir()
749749
if not cachedir then
750750
cachedir = self:get("cachedir")
751751
if not cachedir then
752-
local name = self:name():lower():gsub("::", "_")
752+
-- we need to use displayname (with package id) to avoid
753+
-- multiple processes accessing it at the same time.
754+
--
755+
-- @see https://github.com/libbpf/libbpf-bootstrap/pull/259#issuecomment-1994914188
756+
--
757+
-- e.g.
758+
--
759+
-- lock elfutils#1 /home/runner/.xmake/cache/packages/2403/e/elfutils/0.189
760+
-- lock elfutils /home/runner/.xmake/cache/packages/2403/e/elfutils/0.189
761+
-- package(elfutils) is being accessed by other processes, please wait!
762+
--
763+
local name = self:displayname():lower():gsub("::", "_"):gsub("#", "_")
753764
local version_str = self:version_str()
754765
if self:is_thirdparty() then
755766
-- strip `>= <=`

0 commit comments

Comments
 (0)