General testing strategy of crates in CI
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
调研方向
Start by reviewing the workspace Cargo.lock, Cargo.toml dependency patches, and existing CI jobs for stable, MSRV, and minimal-versions testing. The issue proposes three dependency resolution scenarios but leaves key choices unresolved, including lockfile policy and how to handle patches. A concrete outcome would be an agreed testing strategy and CI changes covering the chosen scenarios.
由索引模型根据 Issue 内容生成。
描述
Most of our repositories contain multiple crates which are part of the same workspace. We also have a number of inter-repository dependencies (e.g. digest depends on crypto-common). In such cases instead of using path while specifying dependency in the crate's Cargo.toml we use dependency patching (e.g. see here).
Currently we commit workspace's Cargo.lock and update it periodically using Dependabot. It allows us to isolate CI failures caused by upstream dependencies. It also reduces CI times a bit since we don't need to generate lock files from scratch. We use the same Cargo.lock for both MSRV and stable tests. MSRV tests use versions manually provided in the CI config.
Additionally, we have minimal-versions jobs which test crates separately from the repository workspace using unstable -Z minimal-versions option. Unfortunately, testing it outside of workspace means that dependency patching defined on the workspace level does not works and we have to manually disable such jobs while patching is present.
In the new releases we plan to rely on the MSRV-aware resolver meaning that we can update MSRV in patch releases, which can lead to mixed-MSRV workspaces. Considering how the MSRV-aware resolver works by default (it selects dependency versions compatible with the declared MSRV), it may be problematic.
Imagine a repo with crates A and B with MSRV equal to 1.85, now in a new version of A we want to use dependency C with MSRV 1.90. We bump MSRV of crate A accordingly, but now we have a problem: the resolver is unable to generate Cargo.lock compatible with MSRV of crate B.
Going forward, I think we should test at least 3 scenarios for all crates:
- Stable toolchain with latest semver-compatible dependencies (i.e. generated with
cargo update --ignore-rust-version) - MSRV toolchain acquired from the
rust-versionfield with latest MSRV-compatible dependencies - Nightly toolchain with minimal semver-compatible version (i.e. generated with
-Z minimal-versions)
This list would require the following changes:
- If we want to continue committing Cargo.lock we should add
.cargo/config.tomlto every repository withincompatible-rust-versions = "allow"to satisfy 1. - To satisfy 2 we would need to add extraction of the
rust-versionvalue (see this URLO thread) and to exclude the crate from the repo workspace.
Unresolved questions:
- Should we continue to commit Cargo.lock? I don't remember many cases of upstream dependencies breaking CI, so it may not be important. We could replace it with a cron job which would test freshest upstream dependencies periodically.
- Should we test on Nightly and/or Beta with latest semver-compatible dependencies?
- Should we use MSRV toolchain to run tests
minimal-versionsjobs (i.e. use Nightly to generate lock file and switch to MSRV toolchain forcargo test)? - How to deal with
patchissues in 2 and 3?
- 主要语言
- 没有语言数据
- 星标
- 13
- 派生
- 4
- 平均合并
- 41 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
RustCrypto/meta 的其他 Issue
-
难度 5/5 一周以上 新手友好度 25/100
RustCrypto/meta#38 · 5 条评论 ·
-
Proof system未关闭
难度 5/5 一周以上 新手友好度 20/100
RustCrypto/meta#37 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
RustCrypto/meta#36 · 8 条评论 ·
-
难度 4/5 3-5 天 新手友好度 32/100
RustCrypto/meta#34 · 8 条评论 ·
-
Replace `subtle` with `ctutils`?可能重新可做 @newpavlov 于 323 天前认领,目前没有进行中的 PR。 未关闭
RustCrypto/meta#29 · 1 条评论 · 已指派 1 人 ·
相似的 Issue
-
Release: a tag the manifests do not match fails `check`, and every build job still runs to the end未关闭CI/CD enhancement need-triage
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
backend bug frontend
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
NVIDIA/numba-cuda-mlir#467 · 1 条评论 ·
维护者通常 3 天内回复