I'm already using `package-get-version` as well, but in case they install from MELPA there's a divergence in the version that I wanted to account for, as MELPA replaces the "real" package version (e.g. 1.2) with a build timestamp. So I end up displaying to the users something like "Version 1.2.0-snapshot (package: 20211219...)" in those cases. Makes it easier for me to debug issues related to snapshot builds. Anyways, thanks a lot for the help!
> [#3113] Hardcode cider-version as a workaround
>
> I can't figure out why the auto-extraction of the version doesn't work.
[...]
> -(defconst cider-version
> - (lm-version (or load-file-name buffer-file-name))
> +(defconst cider-version "1.2.0"
> "The current version of CIDER.")
I suspect the problem may be that `load-file-name` will point at
`cider.elc` where `lm-version` won't find what you need.
You can try and use `package-get-version` (new in Emacs-27) which tries
to get this working.
Stefan