Closed wihobbs closed 2 months ago
It works for me, there are two other options to set it:
-DFLUX_SCHED_VER=<ver>
as a cmake argumentFLUX_SCHED_VERSION=<ver>
as an env varin case you'd like to include those.
Put it at the top, since IMO that's the easiest way to fix it. New message:
(s=125,d=0) corona212 ~/flux-sched (cmake-ver-err)$ FLUX_SCHED_VERSION=junk cmake -B build
-- VER junk
CMake Warning at CMakeLists.txt:21 (message):
CMake may generate an error that says "VERSION "junk" format invalid."
If this happens, try the following:
1. Set the variable manually, with `cmake -DFLUX_SCHED_VER=<version> ...`
or FLUX_SCHED_VERSION=<version> in your environment.
2. If you are running in a CI environment, run `git fetch tags`
before building. Versions in flux-sched are derived from
`git describe` which uses the most recent tag.
3. If you are running in a fork of the main repository, try
`git push --tags` to make sure tags are synchronized in
your fork.
4. If you are running outside of a repo (such as in a buildfarm),
add a file to the source directory called flux-sched.ver and
place a valid version string in that file.
CMake Error at CMakeLists.txt:37 (project):
VERSION "junk" format invalid.
-- Configuring incomplete, errors occurred!
See also "/g/g0/hobbs17/flux-sched/build/CMakeFiles/CMakeOutput.log".
Oh, grr, git fetch tags
needs to be git fetch --tags
Looks good to me! Are you doing a similar one on core?
@trws Sure am, made it easier once I realized the configure.ac
is really just a shell script with a different suffix.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 75.3%. Comparing base (
8d8941d
) to head (1bcb014
). Report is 2 commits behind head on master.
Problem: flux-sched's version comes from
git describe
, which is passed to CMake. CMake validates versions using a regex inCMake/Source/cmProjectCommand.cxx
. When this is an invalid version, flux-sched can't build. This often happens in CI, forks, or stripped-down user environments, and often happens to new contributors.Solution: Validate the version before passing to CMake. If the version is invalid, throw a descriptive warning with some suggestions.
Fixes #1291
This might be a little over-engineered, and suggestions about how to format the message are welcome.