知识卡片

普通读书笔记卡 · 6075.c.1.i · 生成模型:未记录

发布工件按版本固定

理解等级:中级

cargo publish 上传固定版本供下游引用。注册表保留原工件,使依赖该版本的构建可复现。需要修复或扩展时,根据语义化版本递增 Cargo.toml 中的版本后再发布,不在原版本上替换代码。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 深入 Cargo 与 Crates.io Setting Up a Crates.io Account · 查看原书依据

      Be careful, because a publish is permanent. The version can never be overwritten, and the code cannot be deleted. One major goal of Crates.io is to act as a permanent archive of code so that builds of all projects that depend on crates from https://crates.io will continue to work. Allowing version deletions would make fulfilling that goal impossible.

    参考来源

    - 位置:《The Rust Programming Language(第2版)》第14章 深入 Cargo 与 Crates.io(来源项目 a19c7933-4eda-4176-aebd-30fe7e1ad292,`extracted/The Rust Programming Language(第2版)/_epub-src/c14.xhtml`,块 0111) - 结论依据:原文将发布版本不可被覆盖与下游重复构建联系起来。 - 原始内容:Be careful, because a publish is permanent. The version can never be overwritten, and the code cannot be deleted. One major goal of Crates.io is to act as a permanent archive of code so that builds of all projects that depend on crates from https://crates.io will continue to work. Allowing version deletions would make fulfilling that goal impossible.