Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3458

cmake should check for VERSION_CURRENT file after attempting to compute version

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Build

      When computing the build version (i.e. no BUILD_VERSION was specified in cmake command), cmake first checks for a VERSION_CURRENT file, and if one does not exist, then computes the version from git metadata with calc_release_version.py.

      This could be problematic for users building from source. E.g. if they build from source and generate a VERSION_CURRENT file, future builds won't regenerate VERSION_CURRENT.

      Perhaps the logic should be:

      • attempt to compute the version with calc_release_version.py first
        • if it is greater than VERSION_CURRENT, overwrite it
        • if it is equal, do nothing
        • if it is less, return an error
      • if calc_release_version.py fails to run (e.g. python/git are not installed) then fall back to VERSION_CURRENT

      For a real life scenario where this almost happened, homebrew caches the repository files of installed packages. If installing from --HEAD, the VERSION_CURRENT file would be generated on first install, but not regenerated on upgrades. (But currently this is not an issue, because passing BUILD_VERSION was the proposed solution in CDRIVER-3410).

            Assignee:
            Unassigned Unassigned
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: