-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] No error for conflict extensions in manifest.json. #217
Comments
attach whole manifest.json if needed. |
tman resolves the package candidates based on the semantic version syntax. The {
"type": "extension",
"name": "agora_rtm",
"version": "0.1.2"
} The version Extension {
"type": "system",
"name": "ten_runtime",
"version": "0.3"
} So, after tman install, the following packages will be resolved:
The behavior is as expected. |
However, if we change the extension Then, after tman install, the output will be as follows:
No package is resolved. To be fixed. |
现状目前 tman 中是使用 clingo 来解析依赖树的最佳版本, 会根据每个依赖的 尤其是当前 main.lp 中会约束只能输出一个答案, 如下: % Select only 1 version for the dependency package.
1 { depends_on(PkgType, PkgName, PkgVersion, DepType, DepName, DepVersion) : depends_on_declared(PkgType, PkgName, PkgVersion, DepType, DepName, DepVersion) } 1
:- selected_pkg_version(PkgType, PkgName, PkgVersion),
depends_on_declared(PkgType, PkgName, PkgVersion, DepType, DepName, _). 就导致就算在 main.lp 中增加如下的错误条件时, 在无法匹配到答案时, 也不会输出可选的 model 列表或者错误信息. error(0, "No suitable version found for dependency '{0}::{1}'", PkgName, PkgVersion)
:- not selected_pkg_version(DepType, DepName, DepVersion),
depends_on_declared(PkgType, PkgName, PkgVersion, DepType, DepName, DepVersion). 目标在无法匹配整个依赖树的最佳版本时, 能够给出两棵子树的具体哪个子依赖冲突导致的. 其他包管理工具的实现cargo比如, 在
判断依赖冲突的主要逻辑:
实现不采用与 cargo 相同的方式, 因为目前 clingo 的职责就是解析依赖树的最佳匹配的 candidate, cargo 的实现与clingo的方式有重复的部分.
for i := 2 -> len(direct_deps):
sub_graph = direct_deps[0..i]
generate_input_lp(sub_graph)
sucess := solve(generate_input_lp)
if success:
continue
else:
break 即可确认 direct_deps[i] 与 direct_deps[0..i-1] 子树有冲突. 同时, 可以把 direct_deps[0..i-1] 解析出的结果保存.
整体上, 增加 determine_conflict(), 在原有的 solve_all() 返回为空时调用. |
不需要这么麻烦. 我改了一版纯 answer set programming 的解法, 已经合入 main branch, 你用原本的例子测试看看, 如果可以达成原本想要达成的样子, 可以关掉这笔 issue. Answer Set Programming 本身就可以做到冲突侦测, 追踪依赖关系, 并输出用户易懂的错误讯息. 底下是纯粹修改 ASP program 完后的结果. 先是正常情况下的 terminal 输出. $ tman install
🔍 Resolving packages...
📥 Installing packages...
[00:00:00] [########################################] 3/3 Done
🏆 Install successfully in 0 seconds 底下是错误情况下的 terminal 输出. 可以看到只凭 answer set programming 就可以作到侦测冲突, 侦测冲突的依赖原因, 并最终输出易懂的 terminal output. $ tman install
🔍 Resolving packages...
❌ Error: Select more than 1 version of '[system]ten_runtime': '@0.3.0' introduced by '[app][email protected]', and '@0.4.0' introduced by '[extension][email protected]'
Dependency chain leading to [system][email protected]:
└─ [app][email protected]
└─ [system][email protected]
Dependency chain leading to [system][email protected]:
└─ [app][email protected]
└─ [extension][email protected]
└─ [system][email protected]
❌ Error: Dependency resolution failed. |
验证可以检测冲突:
|
还有错误提示的小问题:
|
|
Description
{
"type": "extension",
"name": "agora_rtc",
"version": "=0.8.0-rc2"
},
{
"type": "extension",
"name": "agora_rtm",
"version": "0.1.2"
}
two extensions require different runtime (0.2 and 0.3)
when run
tman install
ormake build
, no error is displayed and no change on the workspace.tomas@WAGIT03652:~/CodeBase/github/czhen_TEN/agents$ tman install
🔍 Resolving packages...
💡 The following local packages do not appear in the dependency tree:
extension:[email protected]
extension:[email protected]
extension:[email protected]
system:[email protected]
extension:[email protected]
extension:[email protected]
extension:[email protected]
extension:[email protected]
extension:[email protected]
extension:[email protected]
extension:[email protected]
extension:[email protected]
extension:[email protected]
extension_group:[email protected]
extension:[email protected]
extension:[email protected]
system:[email protected]
extension:[email protected]
extension:[email protected]
extension:[email protected]
extension:[email protected]
extension:[email protected]
system:[email protected]
system:[email protected]+build331418
extension:[email protected]
extension:[email protected]
extension:[email protected]
system:[email protected]
extension:[email protected]
extension:[email protected]
extension:[email protected]
extension:[email protected]
system:[email protected]
extension:[email protected]
extension:[email protected]
📦 Installing packages...
[00:00:00] [########################################] 0/0 Done
🏆 Install successfully in 18 seconds
Environment
windows wsl ubuntu 22.04
Steps to reproduce
{
"type": "extension",
"name": "agora_rtc",
"version": "=0.8.0-rc2"
},
{
"type": "extension",
"name": "agora_rtm",
"version": "0.1.2"
}
two extensions require different runtime (0.2 and 0.3)
Expected behavior
report error and fail on the execution
Actual behavior
no error reported
Version
tman 0.3.0
Severity
Major
Additional Information
No response
The text was updated successfully, but these errors were encountered: