Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect version display in the command line output #39

Closed
bkhouri opened this issue Jun 21, 2024 · 1 comment · Fixed by #40
Closed

Incorrect version display in the command line output #39

bkhouri opened this issue Jun 21, 2024 · 1 comment · Fixed by #40

Comments

@bkhouri
Copy link

bkhouri commented Jun 21, 2024

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
Copy link
Owner

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.

cameron-martin added a commit that referenced this issue Jun 24, 2024
This uses a genrule to read the Cargo.toml and set `CARGO_PKG_VERSION`. This is picked up by clap to set the version when asked via `--version`.

Fixes #39
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 a pull request may close this issue.

2 participants