giuspen / cherrytree

cherrytree
https://www.giuspen.net/cherrytree/
Other
3.29k stars 457 forks source link

Binary shows version 1.0.1 for the version 1.0.4(?) release of multiple linux builds, maybe for other OS too! #2447

Closed rwperrott closed 4 months ago

rwperrott commented 4 months ago

Version, Operative system 1.0.4, Linux Mint 21.3 MATE 64-bit; I've tried Ubuntu ppa deb, AppImage and FlatPak installations.

Describe the bug

  1. The Title bar shows "CherryTree 1.0.1" with file loaded.
  2. Menu: Help -> About -> Version -- shows a dialog with a mismatching 1.0.1 version line.
  3. Menu: Help -> Check Newer Version -- shows a dialog with "A Newer Version is Available! (1.0.4)".

This was confusing and annoying because it caused uncertainty that this really is version 1.0.4, and suggests inadequate pre-release checks.

To Reproduce

  1. Start program, see title bar
  2. click menu: Help -> About -> Version, to see confusing 1.0.1 line.
  3. click menu: Help -> Check Newer Version, to see confusing 1.0.4 message.

Screenshots About-Screenshot Newer-Version-Screenshot

Investigation https://github.com/giuspen/cherrytree/blob/master/src/ct/ct_actions_help.cc

I do find it strange that the filenames have the correct version, but not the binary, because this appears to be extracted from config.h by build.sh, for some packaging targets, e.g.

  PACKAGE_VERSION="$(grep 'PACKAGE_VERSION ' ../config.h | awk -F\" '{print $2}')"

CMakeLists.txt, line 124, calls configure_file() to create config.h from config.h.cmake, with input variables PROJECT_NAME and CT_VERSION, resolving all ${NAME} expressions to literal text.

configure_file(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_SOURCE_DIR}/config.h)

Maybe config.h is stale because configure_file sees that config.h.cmake has not changed there, so config.h must always be deleting and the above line called before every binary build. Alternatively, if separate, the build and packaging environments may be out-of-sync, which may explain the version discrepancies.

giuspen commented 4 months ago

Hi, I suspect you have more than one package type installed... Can you start from uninstalling everything?

rwperrott commented 4 months ago

That did the trick, so closing the issue.