知识卡片
依赖成本也包括构建时执行
新增依赖同时带来传递依赖、构建成本和后续维护责任;build.rs与过程宏还可能在构建时执行代码。因此风险不限于产品运行时,CI环境也在边界内。复用通常值得,但应按功能收益、来源与维护成本选择,不能因一行配置简单就视为零成本。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 4. Dependencies What to Depend On · 查看原书依据
build.rs scripts or procedural macros (Item 28). That means that a compromised dependency could end up running a cryptocurrency miner as part of your CI system! So for dependencies that are more “cosmetic,” it’s sometimes worth considering whether adding the dependency is worth the cost. The answer is usually “yes,” though; in the end, the amount of time spe
参考来源
- 位置:《Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)》第4章《What to Depend On》(spine8;extracted/Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)/_epub-src/OEBPS/ch04.html;u127-ch04-020)。
- 结论依据:原文在“build.rs scripts or procedural macros”附近的定义、例子或代码支撑本卡核心说明:新增依赖同时带来传递依赖、构建成本和后续维护责任;build.rs与过程宏还可能在构建时执行代码。边界按已读前提解释;示例未执行。
- 原始内容:build.rs scripts or procedural macros (Item 28). That means that a compromised dependency could end up running a cryptocurrency miner as part of your CI system! So for dependencies that are more “cosmetic,” it’s sometimes worth considering whether adding the dependency is worth the cost. The answer is usually “yes,” though; in the end, the amount of time spe