[CDRIVER-2473] Port bson-stdint.h build logic from Autotools to CMake Created: 26/Jan/18  Updated: 28/Oct/23  Resolved: 15/Apr/18

Status: Closed
Project: C Driver
Component/s: Build, libbson
Affects Version/s: None
Fix Version/s: 1.10.0

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Roberto Sanchez
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Remove Autotools

 Description   

libbson has Autotools logic for generating a platform-specific version of stdint.h, called bson-stdint.h. On CMake we just always use a handwritten bson-stdint.h which just includes stdint.h. Determine whether there are platforms we care about which don't have stdint.h and if so, port the Autotools logic to CMake.

Step One: determine if we need to do anything in particular here.



 Comments   
Comment by Githook User [ 25/May/18 ]

Author:

{'username': 'jmikola', 'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com'}

Message: PHPC-1174: Remove traces of bson-stdint.h

The output path for this file was left incorrect in the previous PR for PHPC-1174, but the file isn't actually even used anymore per mongodb/mongo-c-driver@abc882dec9eb5c67fc6e344440ee81e9d33d3459 (CDRIVER-2473).
Branch: master
https://github.com/mongodb/mongo-php-driver/commit/73489c5463ade8ccf4d9cbf4c360218836eb46df

Comment by A. Jesse Jiryu Davis [ 15/Apr/18 ]

Acknowledged, thanks for the thorough info.

Comment by Githook User [ 15/Apr/18 ]

Author:

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

Message: CDRIVER-2473 use stdint.h instead of bson-stdint

{,-win32}

.h

This change applies to non-MSVC compilers/platforms (for bson-stdint.h)
and also to MSVC (for bson-stdint-win32.h). This change only affects
building with CMake.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/abc882dec9eb5c67fc6e344440ee81e9d33d3459

Comment by Roberto Sanchez [ 15/Apr/18 ]

jesse, I just finished publishing my code review and I see that you preemptively LGTM-ed it

I did want to add one more note here for the sake of completeness.

I explored whether it was possible to ditch the section of the file under the comment MSVC++ does not include ssize_t, just size_t.. However, from what I was able to determine at least VS 2010 does not provide ssize_t, so that section appears to still be necessary for now.

Comment by A. Jesse Jiryu Davis [ 15/Apr/18 ]

Terrific, make it so!

Comment by Roberto Sanchez [ 15/Apr/18 ]

jesse, I have done some research into this and my conclusion is that we most likely do not need bson-stdint.h, so it would not make sense to put effort into porting the related Autotools logic to CMake.

Basically, gcc (starting with version 4.5) and Visual Studio (starting with version 2010) ship stdint.h. I was not able to find definitive information regarding clang, but version 3.4 (the earliest listed in installing.rst) was released after gcc 4.5. Of the platforms/compilers listed in installing.rst, Visual Studio 2010 is the oldest. Of note, RHEL releases prior to 7 have older pre-4.5 gcc releases, though I am not certain if they have stdint.h or not.

I would say that if the Evergreen matrix is considered comprehensive and the lack of a generated bson-stdint.h (the hand written bson-stdint.h that just includes stdint.h functions the same as if it were not present), then it would be a reasonable conclusion that we can do without the fancy bson-stdind.h generation logic. I recommend eliminating the file and its references from the CMake part of the build system to see what happens with the build matrix. I suspect that unless there are some very old odd platforms there, we should not see any failures attributable to this.

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