cargo builds can corrupt consumer git repos due to env vars
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- git, rust
- 领域
- build-system
调研方向
从 boring-sys/build/main.rs 开始,重点查看两个 git 调用位置以及现有的 git rev-parse --local-env-vars 用法。检查 Cargo 从 hook 或 worktree 运行时,buildscript 如何调用 git。当这些调用不再继承可能影响 consumer repository 的 Git 环境变量时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Problem
The buildscript in boring-sys/build/main.rs calls out to git to set up the BoringSSL sources. When a project using this crate runs cargo from a git hook, git has already set variables like GIT_DIR for the hook. The buildscript here doesn't sanitize those variables, so git init re-initializes the consumer's repo, rather than the BoringSSL repo the buildscript intended.
Normally that's harmless, but when the build is running from a worktree rather than the main checkout, a surprising git interaction causes it to write core.bare = true into the main checkout's config, breaking most git commands in that main checkout until the config is fixed. Unexpected behaviour from git, for sure, but definitely not something we want to trigger from our build.
Proposed fix
Before invoking git in boring-sys/build/main.rs (2 call sites), strip env vars that would alter git's behaviour. git rev-parse --local-env-vars prints a list of those vars; for me, it gives:
GIT_ALTERNATE_OBJECT_DIRECTORIES
GIT_CONFIG
GIT_CONFIG_PARAMETERS
GIT_CONFIG_COUNT
GIT_OBJECT_DIRECTORY
GIT_DIR
GIT_WORK_TREE
GIT_IMPLICIT_WORK_TREE
GIT_GRAFT_FILE
GIT_INDEX_FILE
GIT_NO_REPLACE_OBJECTS
GIT_REPLACE_REF_BASE
GIT_PREFIX
GIT_SHALLOW_FILE
GIT_COMMON_DIR
- 主要语言
- Rust
- 星标
- 526
- 派生
- 178
- 平均合并
- 15 小时 34 分钟
- 30 天内合并 PR
- 9
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cloudflare/boring 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
cloudflare/boring#526 ·
维护者通常 1 天内回复
-
5.3.0 regression: SSL_set_cert_cb(..., NULL, ...) stores a null function pointer instead of clearing, crashing the next handshake可能已有人在做 @dorianverlaine 今天认领。 未关闭
难度 3/5 半天 新手友好度 62/100
cloudflare/boring#537 ·
维护者通常 1 天内回复
-
SLH-DSA support可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
cloudflare/boring#522 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
cloudflare/boring#517 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
cloudflare/boring#500 · 2 条评论 ·
维护者通常 1 天内回复
查看 cloudflare/boring 的全部 Issue
相似的 Issue
-
documentation good first issue
难度 2/5 半天 新手友好度 72/100
sujithputta02/Esapay#13 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
tursodatabase/turso#10002 ·
维护者通常 1 天内回复
-
needs triage
难度 2/5 1-3 小时 新手友好度 72/100
topgrade-rs/topgrade#2419 ·
维护者通常 1 天内回复
-
review-bot
难度 2/5 1-3 小时 新手友好度 72/100
midagedev/bloomery#318 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
Chia-Network/clvm_rs#863 ·
维护者通常 1 天内回复