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

Open Beginner friendly
#684 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 4 days

@LeeroyHannigan is already working on this.

Since Nov 2, 2026.

  • #768 by @LeeroyHannigan — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
build-system

Research direction

Start with crates/bin/build.rs and inspect how it emits Cargo rebuild directives; read how git rev-parse --git-dir identifies the Git directory, including in a worktree. Rebuild in the same target directory after a commit and check extenddb version; done means it reports the current commit and build time, including for a worktree.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Rust
Stars
517
Forks
60
Avg merge
4d 19h
Merged PRs (30d)
50

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ExtendDB/extenddb

All issues in ExtendDB/extenddb

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.