xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
9.87k stars 776 forks source link

xmake q 失败;而 xmake q -v 成功 #5233

Closed sunhs closed 3 months ago

sunhs commented 3 months ago

Xmake 版本

v2.9.2+HEAD.6b6557c

操作系统版本和架构

ubuntu 16.04, amd64

描述问题

rm -rf ~/.xmake/cache ~/.xmake/packages/*; xmake c -a
xmake q
# 失败
rm -rf ~/.xmake/cache ~/.xmake/packages/*; xmake c -a
xmake f
# 成功
rm -rf ~/.xmake/cache ~/.xmake/packages/*; xmake c -a
xmake q -v
# 成功
rm -rf ~/.xmake/cache ~/.xmake/packages/*; xmake c -a
xmake q -f
# 成功

期待的结果

安装成功

工程配置

-- xmake.lua
add_requires("pulsar")

附加信息和错误日志

由于用了 -v 就成功,甚至加了 -D 也成功,所以这个日志是单纯 xmake q 的。从这来看,像是任务并发调度的问题。

log.txt

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: xmake q fails; while xmake q -v succeeds

Xmake version

v2.9.2+HEAD.6b6557c

Operating system version and architecture

ubuntu 16.04, amd64

Describe the problem

rm -rf ~/.xmake/cache ~/.xmake/packages/*; xmake c -a
xmakeq
# fail
rm -rf ~/.xmake/cache ~/.xmake/packages/*; xmake c -a
xmake f
# success
rm -rf ~/.xmake/cache ~/.xmake/packages/*; xmake c -a
xmakeq-v
# success
rm -rf ~/.xmake/cache ~/.xmake/packages/*; xmake c -a
xmake q -f
# success

Expected results

Successful installation

Project configuration

--xmake.lua
add_requires("pulsar")

Additional information and error logs

Since it succeeds with -v and even with -D, this log is simply xmake q. From this point of view, it seems like a problem of concurrent task scheduling.

log.txt

waruqi commented 3 months ago

xmake q/xmake require 其实算是内部用的 action 了,一般不建议用户直接用的,它是基于已有的 config cache 的, 首先要有一次 xmake config。。所以想要安装包,要么直接走 xmake f -c 触发,或者干脆用 xrepo install 内部封装了 xmake f + xmake q,要么直接走 xmake 编译+安装

单纯走 xmake q 不会自动去执行 config ,只会加载已缓存的 config ,但是又被你 clean -a 给清了,当然有问题了。。

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically.


xmake q/xmake require is actually an internal action and is generally not recommended for users to use directly. . If you want to install the package, you can either directly run xmake f -c to trigger

Or go directly to xmake to compile + install

Simply running xmake q will not automatically execute config, but will only load the cached config. However, if it is cleared by you using clean -a, of course there is a problem. .