rust-analyzer: Version strings are still wrong

We use git describe to get a version string, but the release is tagged only after uploading the artifacts to GitHub. This means that we make a version string using the previous release name.

One way to fix this would be to force a certain version string in the workflow for non-nightly releases, but it feels a bit hacky.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 25 (25 by maintainers)

Commits related to this issue

Most upvoted comments

🎉 mac works now, thank you. Windows seems to be working too and Linux wasn’t even broken, so closing this.

image

Hm… I think “date”, “commit hash” and “release” channel are just dissimilar bits of meta, and that it might not be best to try to cajole git to give us them all.

How about we do this?

  • use git rev-parse --short HEAD for commit hash (unambiguous)
  • use date --iso for build date (this is mildly confusing due to timezones and nightlyness, but we’d have to live with that. I guess, we can shift releases to be at one rather that at UTC midnight to protect from the clock drift somewhat)
  • use env variable / xtask dist flag to add dev / nightly / `` for various builds

#8666 should fix it

well, at least I got linux right 😄

Thank you for the explanations, now I feel even more flattened 😬

Feels like I was wrong from the start and bring no extra sense with these comments, so clean them if you want to, while I’m trying to adjust to a different workflow.

I do get a date on newest nightly, but still with the stable tag Code_Gpxi2HTMv6

Edit: This is on windows

So, I imagine a string like this will be suitable for the users:

rust-analyzer g75371eb0f 2021-04-12 dev

I am also wondering, should be have rust-analyzer --version --json?

{
  "commit": "g75371eb0f",
  "buildDate": "2021-04-12",
  "channel": "dev",
}

I feel that some folks might be parsing this output, so having a stable breaking JSON version seems good?

EDIT:

a stable breaking JSON version

Clearly, I am one more person in the thread who needs a wake-up pu’er

No worries, it’s Monday. It was good feedback, but I think using the standard git describe output is reasonable since (some) people will recognize it. We should at least add a -nightly suffix, though.