Can't compile latest mongo-c-driver-1.25.4, and can't create an issue on it

I have an issue, I’m trying to report the issue here: https://jira.mongodb.org/secure/CreateIssueDetails.jspa but it fails to allow me, saying “that this project is for reporting bugs, improvements and feature requests for the driver. For MongoDB-related support discussion, please post on the MongoDB Community Forums.” I tried different epics, but it tells me I don’t have permissions. So, trying here instead.

mongo-c-driver-1.25.0 introduced an issue which prevents build from source from working, up to and including the latest. mongo-c-driver-1.24.4 works fine. calc_release_version.py is assuming that it’s running in a git repo, which it is not, and bombs out failing to configure for the build.

Hi Mark,

You should be able to log a ticket in the CDRIVER project - https://jira.mongodb.org/browse/CDRIVER

We made a fix recently (CDRIVER-4809 add a `VERSION_CURRENT` file by kevinAlbs · Pull Request #1521 · mongodb/mongo-c-driver · GitHub) with CDRIVER-4809 that sounds similar to the issue you mention.
This fix should be part of upcoming 1.26.0 release (ETA: by end of Feb 2024).

Could you give this a try and see if it fixes your problem? If not, could you share the error that you’re seeing?

I’m trying to report the issue here: https://jira.mongodb.org/secure/CreateIssueDetails.jspa but it fails to allow me

Try changing the Issue Type. I heard another report of an external user unable to create issues of certain Issue Types. I reached out to team members to investigate. Here is a screen capture of filing a “Issue Type=Task” ticket from an external account: https://www.youtube.com/watch?v=BtJQk-ricJs

mongo-c-driver-1.25.0 introduced an issue which prevents build from source from working

In C driver 1.25.1 and higher, if the git history is not available, a version may be specified with the CMake option BUILD_VERSION:

MONGO_C_DRIVER_VERSION=1.25.4
SOURCE=mongo-c-driver-$MONGO_C_DRIVER_VERSION
BUILD="$SOURCE/_build"
PREFIX="$SOURCE/_prefix"

wget "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/$MONGO_C_DRIVER_VERSION.tar.gz" \
  --output-document="$SOURCE.tar.gz"
 
tar xf "${SOURCE}.tar.gz"

cmake -S $SOURCE -B $BUILD \
  -D ENABLE_EXTRA_ALIGNMENT=OFF \
  -D ENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \
  -D CMAKE_BUILD_TYPE=RelWithDebInfo \
  -D BUILD_VERSION="$MONGO_C_DRIVER_VERSION"
cmake --build $BUILD --config RelWithDebInfo --parallel
cmake --install "$BUILD" --prefix "$PREFIX" --config RelWithDebInfo

As Rishabh mentioned, the upcoming C driver 1.26.0 release includes the version in the source. Specifying the version will not be necessary in the 1.26.0 release.

1 Like

Thank you both, the BUILD_VERSION workaround works fine for 1.25.x for me.

1 Like