Skip to content

Add crate version and commit hash to ldk-server#229

Open
benthecarman wants to merge 2 commits into
lightningdevkit:mainfrom
benthecarman:commit-hash
Open

Add crate version and commit hash to ldk-server#229
benthecarman wants to merge 2 commits into
lightningdevkit:mainfrom
benthecarman:commit-hash

Conversation

@benthecarman
Copy link
Copy Markdown
Collaborator

We will now log the version number and commit hash when starting up. Also will give the full commit hash when doing ldk-server --version to better help debugging things.

Also does the same to the cli

We will now log the version number and commit hash when starting up.
Also will give the full commit hash when doing ldk-server --version to
better help debugging things.
@benthecarman benthecarman requested a review from tankyleo June 8, 2026 02:13
@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented Jun 8, 2026

👋 Thanks for assigning @tankyleo as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

Comment thread ldk-server/src/main.rs
let (shutdown_tx, shutdown_rx) = tokio::sync::watch::channel(false);

info!("Starting up...");
info!("Starting ldk-server version {FULL_VERSION}");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also do this when we rotate the logs ?

Comment thread ldk-server/build.rs

fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-env-changed=GIT_HASH");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make sure to update GIT_HASH if HEAD changes after the first from-clean build. Here it seems HEAD could change, and we'd ship a binary with a wrong rev ?

Or perhaps cargo install always re-runs build.rs so we might be good here.

Copy link
Copy Markdown
Contributor

@tankyleo tankyleo Jun 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also trying to understand how this triggers. After build.rs sets GIT_HASH, what other thing could cause GIT_HASH to change, and trigger build.rs again ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants