[Chapel Merge] Don't include sha in version if officialRelease

Branch: refs/heads/main
Revision: 1b3749c
Author: mppf
Link: Unavailable
Log Message:

Merge pull request #20070 from mppf/build-version-sha

Don't include sha in version if officialRelease

Testing:

  • It prints out 1.27.0 pre-release (edda1bb5eb), without other
    changes, regardless of --devel
  • If I disable the BUILD_VERSION_FILE rule in compiler/Makefile and
    set officialRelease = true in compiler/main/version_num.h, and
    then store "1" in compiler/main/BUILD_VERSION; chpl --version
    prints out 1.27.0.1, regardless of --devel or not.
  • If I do the same as the above but store the "0" as the
    BUILD_VERSION then chpl --version prints out 1.27.0, regardless
    of --devel or not.
  • If I let compiler/Makefile update BUILD_VERSION_FILE and have set
    officialRelease = true in compiler/main/version_num.h, it prints
    out 1.27.0 without --devel and 1.27.0.edda1bb5eb with
    --devel.
  • passed full local testing

Future Work:

  • split BUILD_VERSION into two files, e.g. BUILD_VERSION and
    SHA_VERSION; that way BUILD_VERSION can always be set by a person
    but SHA_VERSION can always be computed by the Makefiles.

Reviewed by @ronawho and discussed with @bradcray - thanks!

Modified Files:
M compiler/main/version.cpp

Compare: https://github.com/chapel-lang/chapel/compare/ea0b3bcc5d69...1b3749c8970e