Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

extenddb version prints the first build's commit after a rebuild in the same target directory

未关闭 适合新手
#684 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
70/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
build-system

调研方向

从 crates/bin/build.rs 开始,检查它如何发出 Cargo 重新构建指令;了解 git rev-parse --git-dir 如何识别 Git 目录,包括在 worktree 中的情况。提交后在同一目标目录中重新构建,并检查 extenddb version;完成的标准是它报告当前 commit 和构建时间,包括 worktree 的情况。

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

描述

crates/bin/build.rs bakes the commit hash and the build time into the binary, and tells cargo to run it again only when EXTENDDB_GIT_HASH or EXTENDDB_BUILD_TIME changes (cargo:rerun-if-env-changed). A later build in the same target directory recompiles the crates that changed and links a new binary, but does not run the build script again, so extenddb version still prints the commit and time of the first build there.

Seen on 30 October: a release binary rebuilt in the same target directory after three commits printed the commit it was first built at, with the old build time.

Setting EXTENDDB_GIT_HASH for each build works around it. A fix is to also emit cargo:rerun-if-changed for the git HEAD file and the ref it points to, found through git rev-parse --git-dir so that a worktree works too.

主要语言
Rust
星标
517
派生
60
平均合并
4 天 22 小时
30 天内合并 PR
40

环境准备

从这里开始

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

ExtendDB/extenddb 的其他 Issue

查看 ExtendDB/extenddb 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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