[MONGOCRYPT-183] Multiple different builds of libmongocrypt claim to be the same version Created: 25/Sep/19  Updated: 28/Oct/23  Resolved: 23/Oct/19

Status: Closed
Project: Libmongocrypt
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Shane Harvey Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: fle-ga
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

mongocrypt_version() returns a version like "1.0.0-beta4". This version is updated when a new release is tagged (like in https://github.com/mongodb/libmongocrypt/commit/91413d5c41c75201caa88a58744c240b21cd90a7).

The problem here is that all the commits/builds in between two releases all share the same version number so there is no way to distinguish a user with the actual "1.0.0-beta4" build and one that's a few commits ahead.

For reference the mongodb binaries avoid this problem by including the git SHA in the version as well as the number of commits ahead of the previous tag:

$ mongodb-macos-x86_64-4.1.10-298-ga406d41/bin/mongo --version
MongoDB shell version v4.1.10-298-ga406d41
git version: a406d4152133336a2966ebae0612adc58244e7fd
...



 Comments   
Comment by Githook User [ 23/Oct/19 ]

Author:

{'name': 'Roberto C. Sánchez', 'username': 'rcsanchez97', 'email': 'roberto@connexer.com'}

Message: MONGOCRYPT-183 fix RPM package build to accommodate new git sha in version
Branch: master
https://github.com/mongodb/libmongocrypt/commit/ebb1e32c3d22613dcb356b61b1f027d718bcee81

Comment by Kevin Albertson [ 23/Oct/19 ]

Non-tagged commits will report versions like

1.0.0-beta5+20191023git2fbf632135

And tagged commits will just report the tag.

Comment by Githook User [ 23/Oct/19 ]

Author:

{'username': 'kevinAlbs', 'email': 'kevin.albertson@mongodb.com', 'name': 'Kevin Albertson'}

Message: MONGOCRYPT-183 conform to semver
Branch: master
https://github.com/mongodb/libmongocrypt/commit/7a01c1f53c1eac28bfb7024213d27efd5e662e18

Comment by Githook User [ 23/Oct/19 ]

Author:

{'name': 'Kevin Albertson', 'username': 'kevinAlbs', 'email': 'kevin.albertson@mongodb.com'}

Message: MONGOCRYPT-183 append git sha to reported version
Branch: master
https://github.com/mongodb/libmongocrypt/commit/2fbf632135e04167f5b68b11cf1ce2b7948648e3

Comment by Jeffrey Yemin [ 07/Oct/19 ]

See if we can find similar functionality in the C driver and copy it to libmongocrypt

Comment by Shane Harvey [ 27/Sep/19 ]

PyMongo does not use the mongocrypt_version() function but the pymongocrypt binding does expose it. The exact version will be useful to know for bug reports and our readme says:

The exact version of libbmongocrypt used by PyMongoCrypt:
 
$ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"

Comment by Kevin Albertson [ 27/Sep/19 ]

Is pymongo relying on the mongocrypt_version() function? E.g. logging it?

Generated at Thu Feb 08 09:08:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.