[CDRIVER-3022] mongo-c-driver-1.14.0: wrong version in pkg-config files Created: 18/Mar/19 Updated: 27/Oct/23 Resolved: 20/May/19 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libbson |
| Affects Version/s: | 1.14.0 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | hydrapolic | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux Gentoo |
||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
PHP's pecl-mongodb fails to build with libbson 1.14.0:
It's because the pkg-config files of libbson report version 0.0.0 being installed.
— mongo-c-driver-1.13.1/src/libbson/libbson-1.0-config.cmake 2019-03-18 08:13:11.245695549 +0100
Also tried the master branch, same version 0.0.0. |
| Comments |
| Comment by Kevin Albertson [ 20/May/19 ] |
|
roberto.sanchez I'm closing this ticket and will make a new one for the TODO item mentioned in your last comment. |
| Comment by Roberto Sanchez [ 21/Mar/19 ] |
|
The issue identified here is that even if the build version is not specified in one of the three available ways (from the VERSION_CURRENT file, as is shipped with a release tarball, from the GIt history, as is done when building from a fresh clone of the repository, or by setting the BUILD_VERSION variable on the CMake command line), the build sets the version to 0.0.0 and continues. This is sometimes OK (like when developing on the C driver itself without any intent of using the build output for anything), but causes problems. The solution is to abort the build if the version is not set by one of the three available mechanisms. However, before that change can made |
| Comment by hydrapolic [ 21/Mar/19 ] |
|
Ok, that works. Thanks, will adjust the link. |
| Comment by Kevin Albertson [ 19/Mar/19 ] |
|
hydrapolic Use the tarball attached to the GitHub release (instead of the one GitHub produces): The tarball that GitHub produces does not contain the version information needed to build the repository. That should produce the correct version in the pkg-config file. |
| Comment by hydrapolic [ 19/Mar/19 ] |
|
Seems like the 1.13.1 tarball contains VERSION_CURRENT and VERSION_RELEASED - both statically contain the string 1.13.1. Version 1.14.0 does not contain those files and the python script build/calc_release_version.py fails to run.
mongo-c-driver-1.13.1 $ cmake . mongo-c-driver-1.14.0 $ cmake . storing BUILD_VERSION 0.0.0 in file VERSION_CURRENT for later use |
| Comment by hydrapolic [ 19/Mar/19 ] |
|
It was all compiled from source by using Gentoo ebuilds. The diff posted above can be obtained by: wget https://github.com/mongodb/mongo-c-driver/archive/1.13.1.tar.gz wget https://github.com/mongodb/mongo-c-driver/archive/1.14.0.tar.gz diff -u mongo-c-driver-1.13.1/src/libbson/libbson-1.0-config.cmake mongo-c-driver-1.14.0/src/libbson/libbson-1.0-config.cmake We try to unbundle dependencies and we compile pecl-mongodb from source using system libraries. That's when it tries Libbson and mongo-c-driver are kept as shared libraries in the system and other consumers like pecl-mongodb use them when |
| Comment by Jeremy Mikola [ 18/Mar/19 ] |
|
hydrapolic: Can you clarify how you're installing both the PHP driver and libmongoc/libbson libraries? You refer to the PECL package, but the the PECL install process for the driver uses bundled versions of libmongoc/libbson. Do I assume correctly that you're downloading the PECL package simply as a means of obtaining the driver's source? I also want to confirm where you're getting the sources for libmongoc and libbson. The bundled versions included in the PECL package are merely git submodules. Your issue refers to "mongo-c-driver-1.13.1" and "mongo-c-driver-1.14.0" directories, which don't exist in the PECL package, so I assume you've downloaded those separately. Note that libmongoc/libbson have separate installation processes for installing from a release tarball or building from git. The release tarballs should already have their version files in order, so I believe you may have manually compiled libmongoc from a git checkout without running the calc_release_version.py script to generate VERSION_CURRENT. If you're using the PHP driver and do not need libmongoc/libbson system libraries installed for other applications, I think your best option is to install the PHP driver through pecl install mongodb and use the bundled verisons of libbmongoc/libbson. Otherwise, if you're set on compiling the PHP driver manually and using libmongoc/libbson system libraries, please double check that you're following one of the documented install procedures for those libraries to ensure that the version information is properly generated. |