diff --git a/configure.ac b/configure.ac index d7d513fcb403..dcec0f67d049 100644 --- a/configure.ac +++ b/configure.ac @@ -36,6 +36,27 @@ AC_SUBST([AX_MAJOR_VERSION]) AC_SUBST([AX_MINOR_VERSION]) AC_SUBST([AX_POINT_VERSION]) +AC_MSG_CHECKING([whether version number is sane]) +AS_IF([printf "%d.%d.%d" ${AX_MAJOR_VERSION} ${AX_MINOR_VERSION} ${AX_POINT_VERSION} >/dev/null 2>&1], [ + AC_MSG_RESULT([yes]) +],[ + AC_MSG_RESULT([no]) + version_err_msg=" + VERSION ${VERSION} is invalid. + Try the following to remedy this: + + 1. Set the variable manually, with FLUX_VERSION= + in your environment. + 2. If you are running in a CI environment, run \`git fetch tags\` + before building. Versions in flux-core are derived from + \`git describe\` which uses the most recent tag. + 3. If you are running CI in a fork of the main repository, try + \`git push --tags\` to make sure tags are synchronized in + your fork. + " + AC_MSG_ERROR(["${version_err_msg}"]) +]) + ## # Initialize pkg-config for PKG_CHECK_MODULES to avoid conditional issues ##