Closed xG0Ian closed 1 week ago
Thank you,
The ckb --version
in the ckb release includes the commit hash, but the ckb-cli does not. I think there might be an issue with the ckb-cli build process, where the git commit hash is not being injected into the ckb-cli binary.
https://github.com/nervosnetwork/ckb/releases/tag/v0.118.0-rc1
Yes, this PR is only for the problem mentioned in those two open issues.
Hello, I'm unsure if there's an issue with the package workflow in ckb-cli, as it doesn't appear to be injecting CKB CLI's Git commit information (https://github.com/nervosnetwork/ckb-cli/blob/develop/.github/workflows/package.yaml).
Need to determine why the CKB CLI (ckb-cli
) does not display its Git commit hash when running the command ckb-cli --version
.
@eval-exec Hi Eval,
Yes, I’m quite sure the issue is that CKB CLI's Git commit information wasn’t injected, which is why it shows ckb-cli xxx ( )
with empty parentheses ( )
.
The change in this PR is to fixing where we don’t have Git commit info by ensuring that do not display ( )
. However, we still need to inject the Git commit hash into ckb-cli. I will open an issue to ckb-cli and fix it if I can.
What problem does this PR solve?
Issue Number: close #4550 nervosnetwork/ckb-cli#609
Problem Summary: When no git information was found, the sub-command --version outputs a pair of empty brackets.
What is changed and how it works?
What's Changed:
String::from_utf8(r.stdout)
will always return a string when stdout is empty. https://github.com/nervosnetwork/ckb/blob/2fb17ab8f4c3a5bd005cbf726e897e3201258bc9/util/build-info/src/lib.rs#L106-L124 https://github.com/nervosnetwork/ckb/blob/2fb17ab8f4c3a5bd005cbf726e897e3201258bc9/util/build-info/src/lib.rs#L129-L141So
extra_parts.is_empty()
is always returnfalse
https://github.com/nervosnetwork/ckb/blob/2fb17ab8f4c3a5bd005cbf726e897e3201258bc9/util/build-info/src/lib.rs#L95unwrap it with default value "", check if they are empty
Related changes
owner/repo
:Check List
Tests
Side effects
Release note