kcl-lang / lib

KCL Multiple Language Bindings including Rust, Go, Python, Java, Kotlin, .NET, Swift, Lua, Node.js, Zig, C, C++, WASM, etc.
https://www.kcl-lang.io/docs/reference/xlang-api/overview
Apache License 2.0
8 stars 10 forks source link

[BUG] Lost KCL `GitCommit` for Go bundled binaries #128

Closed bozaro closed 2 months ago

bozaro commented 2 months ago

Bug Report

There are no GitCommit for Go bundled binaries. Interestingly, when building KCL locally GitCommit contains commit hash.

1. Minimal reproduce step (Required)

go install kcl-lang.io/cli/cmd/kcl@latest && kcl version && ~/go/bin/kclvm_cli version               

2. What did you expect to see? (Required)

Some commit hash for GitCommit field.

3. What did you see instead (Required)

I see VERGEN_IDEMPOTENT_OUTPUT instead of git commit hash.

➜ go install kcl-lang.io/cli/cmd/kcl@latest
➜ kcl version                              
0.9.4-linux-amd64
➜ ~/go/bin/kclvm_cli version               
Version: 0.9.2-c020ab3eb4b9179219d6837a57f5d323
Platform: x86_64-unknown-linux-gnu
GitCommit: VERGEN_IDEMPOTENT_OUTPUT
bozaro commented 2 months ago

Same issue for kcl-language-server:

[15:19:54] ➜  ~ wget -q https://kcl-lang.io/script/install-kcl-lsp.sh -O - | /bin/bash && /usr/local/bin/kcl-language-server version
Getting the latest KCL language server ...
Your system is linux_amd64 
Find the latest KCL language server version v0.10.0-alpha.1 
Downloading https://github.com/kcl-lang/kcl/releases/download/v0.10.0-alpha.1/kclvm-v0.10.0-alpha.1-linux-amd64.tar.gz ... 
Scucessful to download https://github.com/kcl-lang/kcl/releases/download/v0.10.0-alpha.1/kclvm-v0.10.0-alpha.1-linux-amd64.tar.gz 
Copy the kcl language server binary /tmp/kcl-install-EOnWHk/kclvm/bin/kcl-language-server into the target installation directory /usr/local 
Editing user profile (/home/bozaro/.zshrc) with the profile install dir /usr/local 
The KCL PATH string is 
      export PATH="/usr/local/bin:$PATH"
    Finished kcl-language-server installed into /usr/local/bin successfully.
chmod: изменение прав доступа для '/usr/local/bin/kcl-language-server': Операция не позволена
Version: 0.10.0-alpha.1-c020ab3eb4b9179219d6837a57f5d323
Platform: x86_64-unknown-linux-gnu
GitCommit: VERGEN_IDEMPOTENT_OUTPUT

Please add /usr/local/bin into your PATH
Remeber run the command source ~/.bash_profile or source ~/.bashrc to ensure your PATH is effective
Reopen a terminal and execute 'kcl-language-server version' to ensure successful installation

To get started with KCL language server, please visit https://kcl-lang.io/docs/user_docs/getting-started/kcl-quick-start
Version: 0.10.0-alpha.1-c020ab3eb4b9179219d6837a57f5d323
Platform: x86_64-unknown-linux-gnu
GitCommit: VERGEN_IDEMPOTENT_OUTPUT
Peefy commented 2 months ago

https://github.com/kcl-lang/kcl/pull/1528

This seems to be due to the fact that the vergen library in Rust only supports the use of Git2 version. I have updated it and can now see GitCommit information output in the CI.