GCWing / GCWing/OpenBitFun

[Bug]: cargo metadata compatibility warning repeated in every CI metadata validation step

已关闭 适合新手
#2,571 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
2.3k
派生
231
平均合并
2 小时 49 分钟
30 天内合并 PR
589

描述

## Summary

The upstream CI logs for `main` show a cargo toolchain warning repeated in every "Verify ... metadata" step. Evidence from GitHub Actions run [33035362609](https://github.com/GCWing/BitFun/actions/runs/33035362609) (also present in runs 33050974141, 33047041028, and the latest snapshot run 33057289117):

```
warning: please specify `--format-version` flag explicitly to avoid compatibility problems
```

It is emitted by the three `cargo metadata --locked --no-deps` invocations in `.github/workflows/ci.yml` (the "Verify committed Cargo metadata", "Verify committed release metadata", and "Verify projected release metadata" steps). It appears once per runner in the Rust Build Check jobs and again in the frontend job, i.e. it pollutes every CI run of `main`.

## Root Cause Analysis

- Newer cargo releases print this compatibility warning whenever `cargo metadata` is invoked without an explicit `--format-version` flag. The workflow calls omit the flag, so every run produces the warning even though the invocation itself succeeds.
- This is a CI-configuration-layer issue, not a code warning: no source change is involved.

## Proposed Fix

Add `--format-version 1` explicitly to the three `cargo metadata --locked --no-deps` invocations in `.github/workflows/ci.yml`, so:

- the compatibility warning disappears from the CI logs;
- the invocation pins its machine-readable output contract explicitly, protecting against future cargo default changes.

No workflow semantics change: the same metadata is validated with the same lockfile, just with the format version made explicit.

贡献指南

打开贡献指南

调研方向

打开 .github/workflows/ci.yml,检查元数据验证步骤中的三次 cargo metadata --locked --no-deps 调用。添加 issue 中描述的显式 format-version 选项,然后运行相关的 CI 工作流或元数据验证命令。当三个检查仍然全部通过,并且兼容性警告不再出现在日志中时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
github-actions, rust
领域
ci-cd
Issue 类型
缺陷
难度
1/5
预计耗时
1 小时以内
活跃度
活跃
描述清晰度
描述清楚
新手友好度
92/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。