cameron-martin / bazel-lsp

A language server implementation for Bazel
Apache License 2.0
36 stars 1 forks source link

Incorrect version display in the command line output #39

Closed bkhouri closed 3 weeks ago

bkhouri commented 4 weeks ago

running bazel-lsp --version returns version 0.0.0 even though version 0.6.0 was downloaded via GitHub. In addition, running bazel run //:bazel-lsp -c opt -- --version returns the same

❯ BAZEL_LSP_BIN=${HOME}/bin/work/bin/bazel-lsp
❯ BAZEL_LSP_VERSION="0.6.0"
❯  curl "https://github.com/cameron-martin/bazel-lsp/releases/download/v${BAZEL_LSP_VERSION}/bazel-lsp-${BAZEL_LSP_VERSION}-osx-arm64" --location --output "${BAZEL_LSP_BIN}"
❯ bazel run //:bazel-lsp -c opt -- --version
INFO: Analyzed target //:bazel-lsp (356 packages loaded, 17541 targets configured).
INFO: Found 1 target...
Target //:bazel-lsp up-to-date:
  bazel-bin/bazel-lsp
INFO: Elapsed time: 8.018s, Critical Path: 0.10s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/bazel-lsp --version
bazel-lsp 0.0.0

This behaviour was observed on v0.6.0 and master branch at commit ID 92644f21aca7cfbba332c67ac1aa9cf43765e021

❯ git rev-parse master
92644f21aca7cfbba332c67ac1aa9cf43765e021
cameron-martin commented 3 weeks ago

According to the clap docs it should automatically get this from the Cargo.toml, but I guess that isn't working properly, maybe because we're using Bazel rather than cargo. Will investigate further when I'm at my PC.