[CDRIVER-3458] cmake should check for VERSION_CURRENT file after attempting to compute version Created: 08/Dec/19  Updated: 10/Feb/23

Status: Backlog
Project: C Driver
Component/s: Build
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: release-improvements
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-3410 Fix homebrew formula for --HEAD Closed
Epic Link: CDRIVER-4577

 Description   

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).


Generated at Wed Feb 07 21:18:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.