fix(riscv-virt-rt): 把目标 C 库的安装期依赖边加回 deps - #233
Merged
Conversation
0.3.0(#220)从三个平台块里删掉了 `xim:picolibc-riscv@1.8.12`,理由写在 当时的注释里:目标的 C 库「不是这个包的,mcpp 会像解析编译器那样从目标行 解析它」。那句话把两件事折成了一件,而只有第一件是对的: * **构建期** —— 板子不该点名 picolibc:不写 include 路径、不写库名、 不带自己的链接脚本,全部由 mcpp 从目标行推导。0.3.0 在这一点上是对的, 保持不变。 * **安装期** —— 总得有什么让那份载荷**存在**。mcpp 解析编译器走的是会 安装的那条调用;目标 C 库它只在磁盘上**查找**,不在场就静默地不加任何 路径。没有任何代码会去装它。 编译器那个类比正是让这次删除看起来安全的原因。事后在冷 runner 上实测: 整份 CI 日志里 `picolibc` 一次都没出现——glibc 和 llvm 都下载了,它没有 ——随后每次构建都死在指向本包内部的 `'stdio.h' file not found`。重建也没 用,因为第二遍查的还是同一个空位置。 安装期依赖边正是 `xpm.<平台>.deps` 的用途,所以它应该在那里。⚠️ 判据是「拿走再装回来」,而且**两个一起拿走**:先只把 qemu 藏起来, 构建报 `Cached riscv-virt-rt`、什么都没装——这条边只在**包自己被安装**时 触发。把包和 qemu 一起藏起来再构建,日志里 `Downloading mcpplibs.riscv-virt-rt` 之后紧跟 `Downloading xim:qemu-riscv@9.2.4-1`,两者都装了回来。机制成立。⚠️ 没有给 std-freestanding 加同样的边,而它的描述符注释解释了原因:那个包 服务任意 freestanding 目标,声明一个 RISC-V 专属的 C 库会把它钉死在一个 架构上。这条边属于板级包——它本来就是 RISC-V 加 picolibc。
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.3.0(#220)把
xim:picolibc-riscv@1.8.12从三个平台块的deps里删掉了,理由是「mcpp 会像解析编译器那样从目标行解析它」。那句话把构建期和安装期折成了一件事,而只有构建期成立。 mcpp 解析编译器走的是会安装的调用;目标 C 库它只在磁盘上查找,不在场就静默不加路径——没有任何代码去装它。
冷 runner 实测:整份 CI 日志里
picolibc一次都没出现,而 glibc 与 llvm 都下载了;随后每次构建都死在指向包内部的'stdio.h' file not found。这就是mcpplibs/riscv-virt-rt的 CI 从 0.3.0 起一直红的原因。判据
「拿走再装回来」,而且两个一起拿走——只藏 qemu 时构建报
Cached riscv-virt-rt,什么都没装,因为这条边只在包自己被安装时触发。把包和 qemu 一起藏起来:两者都装了回来,机制成立。
未改的地方
std-freestanding没有加同样的边:它服务任意 freestanding 目标,声明一个 RISC-V 专属的 C 库会把它钉死在一个架构上——它自己的描述符注释就是这么写的。这条边属于板级包。只改元数据,载荷 sha256 不变;新增一条安装边只会多装一个包,不会让任何已有工程失效。