0.4.1 —— 模板生成的工程在干净机器上跑不起来 - #2
Merged
Merged
Conversation
用发布出去的 0.4.0 走完整条 `mcpp new --template openarch` 路径,发现:生成的工程
三个目标**都构建得出**,而 `mcpp run` 在 riscv64 与 aarch64 上都是
error: no runner is configured for 'riscv64-none-elf'
⚠️ **成因是「声明」不等于「安装」。** 清单里的 `[xlings] deps` 命名了两个模拟器包,
它让 `build.mcpp` 能问「那个包落在哪」——它本身不是安装触发器。干净的 registry 上
`xpkg_dir` 返回空,构建程序静默地不配置 runner,而 mcpp 给出的建议是「写一个 runner
键」——这句话一般情况下对,在这里不对:这个工程有 runner,只是条件性的。
普通裸机工程遇不到这件事:板级包把模拟器写在索引描述符的平台 `deps` 里,而**那些
是随包安装的**。这个工程没有板级包 —— 没有哪块板子同时服务三个指令集,而那正是它
存在的理由。
⚠️ **而构建程序无法警告。** 我先写了一条 `std::cerr` 提示,实测后删掉:mcpp 用
`capture_exec` 抓取构建程序,**只在非零退出时**打印抓到的东西 —— 于是那条提示在最
需要它的那些构建上一个字都不打印。留着比不留更糟,因为它看起来像个修复。让构建失败
也不对:`mcpp build` 不需要模拟器。所以由 README 承担,并在 build.mcpp 里记下为什么
必须由它承担。
⚠️ **两处是我自己的疏漏:**
1. 0.4.0 的模板断言停在 `mcpp build`,于是一个「三台机器都编得出、一台都跑不了」的
工程通过了它。现在断言 `mcpp run` 并 grep `switch ok`。
2. 那一步原本放在 `host-encoders` 作业里,而那个作业**不装模拟器** —— 也就是说它
物理上只可能断言 build。移到 `gate` 作业的 riscv64 行,那里有模拟器。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
用发布出去的 0.4.0 走完整条
mcpp new --template openarch,发现生成的工程三个目标都构建得出、而mcpp run在两台有模拟器的机器上都失败。[xlings] deps让build.mcpp能问「那个包落在哪」,它本身不是安装触发器。干净 registry 上xpkg_dir返回空 → 不配置 runner → mcpp 建议「写一个 runner 键」,而这个工程有 runner,只是条件性的。std::cerr提示,实测后删掉:mcpp 只在构建程序非零退出时打印抓到的输出 —— 那条提示在最需要它的构建上一个字都不打。留着比不留更糟。改由 README 承担。build;而且那一步放在不装模拟器的作业里,物理上只可能断言 build。现在断言mcpp run并 grepswitch ok,且移到有模拟器的gate作业。