summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-01-02 00:40:43 +0800
committerruki <[email protected]>2021-01-02 00:40:43 +0800
commit0e0450e7ac3d726f0728c698d2beb9d6b02c0a70 (patch)
treead87dbde028a4102c1d3f33e136b0c8e24a1cacf
parent23cf7e2df45344351c7dd30dad8742282fb74363 (diff)
fix package cache conflicts
-rw-r--r--xmake/actions/require/impl/actions/install.lua4
-rw-r--r--xmake/actions/require/impl/package.lua7
-rw-r--r--xmake/core/package/package.lua4
3 files changed, 11 insertions, 4 deletions
diff --git a/xmake/actions/require/impl/actions/install.lua b/xmake/actions/require/impl/actions/install.lua
index 2410e8edb..c6623f36b 100644
--- a/xmake/actions/require/impl/actions/install.lua
+++ b/xmake/actions/require/impl/actions/install.lua
@@ -211,7 +211,7 @@ function main(package)
-- trace
tty.erase_line_to_start().cr()
- cprint("${yellow} => ${clear}install %s %s .. ${color.success}${text.success}", package:name(), package:version_str() or "")
+ cprint("${yellow} => ${clear}install %s %s .. ${color.success}${text.success}", package:displayname(), package:version_str() or "")
end,
catch
@@ -230,7 +230,7 @@ function main(package)
-- trace
tty.erase_line_to_start().cr()
- cprint("${yellow} => ${clear}install %s %s .. ${color.failure}${text.failure}", package:name(), package:version_str() or "")
+ cprint("${yellow} => ${clear}install %s %s .. ${color.failure}${text.failure}", package:displayname(), package:version_str() or "")
-- leave the package environments
package:envs_leave()
diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua
index 0f1f78277..78e34863d 100644
--- a/xmake/actions/require/impl/package.lua
+++ b/xmake/actions/require/impl/package.lua
@@ -468,6 +468,13 @@ function _load_package(packagename, requireinfo, opt)
_memcache():set2("packageids", packagename, (packageid or 0) + 1)
package:displayname_set(displayname)
+ -- disable parallelize if the package cache directory conflicts
+ local cachedirs = _memcache():get2("cachedirs", package:cachedir())
+ if cachedirs then
+ package:set("parallelize", false)
+ end
+ _memcache():set2("cachedirs", package:cachedir(), true)
+
-- add some builtin configurations to package
_add_package_configurations(package)
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index d1ee4e683..c128b8a0e 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -296,8 +296,8 @@ end
function _instance:lock(opt)
if self:filelock():trylock(opt) then
return true
- elseif option.get("diagnosis") then
- utils.warning("the current package is being accessed by other processes, please waiting!")
+ else
+ utils.cprint("${color.warning}package(%s) is being accessed by other processes, please waiting!", self:name())
end
local ok, errors = self:filelock():lock(opt)
if not ok then