[Bug]: cargo metadata compatibility warning repeated in every CI metadata validation step
- Ngôn ngữ chính
- Rust
- Star
- 2.3k
- Fork
- 231
- Merge trung bình
- 2 giờ 49 phút
- Pull request đã merge (30 ngày)
- 589
Mô tả
## 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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Mở .github/workflows/ci.yml và kiểm tra ba lần gọi cargo metadata --locked --no-deps trong các bước xác thực metadata. Thêm tùy chọn format-version tường minh được mô tả trong issue, sau đó chạy workflow CI liên quan hoặc các lệnh xác thực metadata. Hoàn tất khi cả ba kiểm tra vẫn đều đạt và cảnh báo tương thích không còn xuất hiện trong log.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- github-actions, rust
- Lĩnh vực
- ci-cd
- Loại issue
- Lỗi
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 92/100