|
After investigating, calc_release_version.py computes a version 0.0.0 because of how homebrew clones the repo when building. This is not an issue for installing the latest release through homebrew, as that fetches our released source which contains a VERSION_CURRENT file.
Homebrew by default does a shallow clone of depth 1 of the latest commit. This can be turned off by passing :shallow => false, but this does not resolve the issue. Even if doing a deep clone, homebrew only copies the git refs heads/master and origin/master (see here) instead of the git clone default heads/* and origin/*.
I submitted a PR to specify the development version using -DBUILD_VERSION if installing from --HEAD. An alternative solution, though more complicated, may be to create a custom download strategy to clone the git history and refs. It's also worth noting, that since homebrew caches the cloned source, the computed VERSION_CURRENT seems to persist in the cache (for me, that directory is /Users/kevinalbertson/Library/Caches/Homebrew/mongo-c-driver--git). So if we were to apply this alternative fix, we'd need to keep in mind that users who may have already attempted installing could still get 0.0.0 from the cached VERSION_CURRENT file unless they first clear the cache.
|