Skip to content

Conversation

bcwarner
Copy link
Contributor

@bcwarner bcwarner commented Jun 9, 2022

Refactored some of the C symbols so that they avoid conflicts as mentioned in PYTHON-2110. The following symbols should be refactored as:

PyInit__cmessage        => pymongo_PyInit__cmessage
buffer_free             => pymongo_buffer_free
buffer_get_buffer       => pymongo_buffer_get_buffer
buffer_get_position     => pymongo_buffer_get_position
buffer_new              => pymongo_buffer_new
buffer_save_space       => pymongo_buffer_save_space
buffer_update_position  => pymongo_buffer_update_position
buffer_write            => pymongo_buffer_write

PyInit__cmessage        => pymongo_PyInit__cmessage
buffer_free             => pymongo_buffer_free
buffer_get_buffer       => pymongo_buffer_get_buffer
buffer_get_position     => pymongo_buffer_get_position
buffer_new              => pymongo_buffer_new
buffer_save_space       => pymongo_buffer_save_space
buffer_update_position  => pymongo_buffer_update_position
buffer_write            => pymongo_buffer_write
check_string            => cbson_check_string
cmp_date                => cbson_cmp_date
convert_type_registry   => cbson_convert_type_registry
copy_TM64_to_tm         => cbson_copy_TM64_to_tm
copy_tm_to_TM64         => cbson_copy_tm_to_TM64
date_in_safe_range      => cbson_date_in_safe_range
fake_localtime_r        => cbson_fake_localtime_r
gmtime64                => cbson_gmtime64
gmtime64_r              => cbson_gmtime64_r
localtime64             => cbson_localtime64 
localtime64_r           => cbson_localtime64_r
mktime64                => cbson_mktime64
timegm64                => cbson_timegm64
timelocal64             => cbson_timelocal64
valid_tm_mon            => cbson_valid_tm_mon
valid_tm_wday           => cbson_valid_tm_wday

@bcwarner bcwarner changed the title PYTHON-2110 PYTHON-2110 Refactored some C to avoid symbol conflicts Jun 9, 2022
Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work so far! Looking at the test failures in Evergreen (our CI system), it appears the PyInit_ functions need to be changed back:

[2022/06/09 20:05:14.193] + /opt/python/3.10/bin/python3 setup.py build_ext -i
[2022/06/09 20:05:14.193] + /opt/python/3.10/bin/python3 -c 'from bson import _cbson; from pymongo import _cmessage'
[2022/06/09 20:05:14.296] Traceback (most recent call last):
[2022/06/09 20:05:14.296]   File "<string>", line 1, in <module>
[2022/06/09 20:05:14.296] ImportError: dynamic module does not define module export function (PyInit__cbson)
[2022/06/09 20:05:14.306] Command failed: shell script encountered problem: exit code 1

https://spruce.mongodb.com/task/mongo_python_driver_tests_python_version_ubuntu18_test_ssl__platform~ubuntu_18.04_auth_ssl~auth_ssl_python_version~3.10_coverage~coverage_test_3.6_standalone_patch_b8653b018d0f16f2f60640a633c832939fffccbe_62a251fe9ccd4e36ab48f80b_22_06_09_20_03_11/logs?execution=0&sortBy=STATUS&sortDir=ASC

@bcwarner bcwarner marked this pull request as ready for review June 13, 2022 17:12
Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@juliusgeo juliusgeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bcwarner bcwarner merged commit be3008a into mongodb:master Jun 13, 2022
juliusgeo pushed a commit to juliusgeo/mongo-python-driver that referenced this pull request Jun 29, 2022
* Refactored to avoid symbol conflicts

* Forgot a replacement

* Found a symbol

* Undid symbol replacement for PyInit__cmessage

* Changed cbson too

Co-authored-by: Ben Warner <ben.warner@mongodb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants