cargo: Generate a Cargo.lock if one wasn't found

未关闭
#44 20 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
python, rust
领域
build-system

调研方向

先阅读现有的 cargo 插件以及 issue 42 的链接规范。跟踪 track、fetch 和 stage 流程,然后验证此处描述的 generate_lock 模式、默认行为和错误情况;当 Cargo.lock 的生成和依赖重建遵循所述规则时,即表示完成。

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

描述

Spec from https://gitlab.com/BuildStream/bst-plugins-experimental/-/issues/42

Will behave like this:

  • track: Cargo.lock will be generated by the host's cargo IF (generate_lock is true) OR (generate_lock is 'if-missing' and Cargo.lock doesn't exist). If generate_lock is false and Cargo.lock doesn't exist, raise an error. Then the existing logic for tracking cargo sources will happen. The ref will now encode everything necessary to reconstruct the vendored libraries, so the generated Cargo.lock is discarded
  • fetch: The sources are fetched according to the ref, as they are now
  • stage: The sources are staged according to the ref, as they are now
  • Buildstream will default to generate_lock: false, and projects can (if they wish) globally override that default to generate_lock: if-missing to make the cargo plugin work in all scenarios. Then generate_lock: true can be used if Cargo.lock needs to be overwritten/ignored for whatever reason (i.e. a hypothetical repo that hasn't been updated in a while and Cargo.lock specifies dependencies w/ known security issues, so you want to force it to use newer libraries)
  • If a project doesn't want to grow a dependency on cargo from the host to track, it can keep generate_lock: false as the default, and then maintain its own Cargo.lock files & stage them before the cargo source:
sources:
- kind: git_tag
  url: whatever:foobar.git
- kind: local
  path: files/cargo/foobar/Cargo.lock
- kind: cargo
  generate_lock: false # <-- from project defaults
主要语言
Python
星标
8
派生
16
平均合并
36 分钟
30 天内合并 PR
2

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/buildstream-plugins 的其他 Issue

查看 apache/buildstream-plugins 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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