Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYTHON-3356 Build pymongocrypt wheels in CI #418

Merged
merged 132 commits into from
Aug 25, 2022

Conversation

blink1073
Copy link
Member

No description provided.

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.

It looks like the macos framework pythons are broken:

 [2022/07/28 21:39:09.138] running build_ext
 [2022/07/28 21:39:09.138] Running test with python: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3
 [2022/07/28 21:39:09.138] + rm -rf .venv
 [2022/07/28 21:39:09.138] + for PYTHON_BINARY in '"${PYTHONS[@]}"'
 [2022/07/28 21:39:09.138] + echo 'Running test with python: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3'
 [2022/07/28 21:39:09.138] + /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -c 'import sys; print(sys.version)'
 [2022/07/28 21:39:09.289] 3.8.10 (v3.8.10:3d8993a744, May  3 2021, 09:09:08)
 [2022/07/28 21:39:09.289] [Clang 12.0.5 (clang-1205.0.22.9)]
 [2022/07/28 21:39:09.290] + createvirtualenv /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 .venv
 [2022/07/28 21:39:09.290] + PYTHON=/Library/Frameworks/Python.framework/Versions/3.8/bin/python3
 [2022/07/28 21:39:09.290] + VENVPATH=.venv
 [2022/07/28 21:39:09.290] + /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m virtualenv --version
 [2022/07/28 21:39:09.340] /Library/Frameworks/Python.framework/Versions/3.8/bin/python3: No module named virtualenv
 [2022/07/28 21:39:09.470] + /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m venv -h
 [2022/07/28 21:39:09.470] Traceback (most recent call last):
 [2022/07/28 21:39:09.470]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 64, in <module>
 [2022/07/28 21:39:09.470]     import msvcrt
 [2022/07/28 21:39:09.470] ModuleNotFoundError: No module named 'msvcrt'
 [2022/07/28 21:39:09.470] During handling of the above exception, another exception occurred:
 [2022/07/28 21:39:09.470] Traceback (most recent call last):
 [2022/07/28 21:39:09.470]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 185, in _run_module_as_main
 [2022/07/28 21:39:09.470]     mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
 [2022/07/28 21:39:09.470]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 144, in _get_module_details
 [2022/07/28 21:39:09.470]     return _get_module_details(pkg_main_name, error)
 [2022/07/28 21:39:09.470]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 111, in _get_module_details
 [2022/07/28 21:39:09.470]     __import__(pkg_name)
 [2022/07/28 21:39:09.470]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/venv/__init__.py", line 10, in <module>
 [2022/07/28 21:39:09.470]     import subprocess
 [2022/07/28 21:39:09.470]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 70, in <module>
 [2022/07/28 21:39:09.470]     import select
 [2022/07/28 21:39:09.470] ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/select.cpython-38-darwin.so, 2): Symbol not found: ___darwin_check_fd_set_overflow
 [2022/07/28 21:39:09.470]   Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/select.cpython-38-darwin.so (which was built for Mac OS X 11.0)
 [2022/07/28 21:39:09.470]   Expected in: /usr/lib/libSystem.B.dylib
 [2022/07/28 21:39:09.470]  in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/select.cpython-38-darwin.so
 [2022/07/28 21:39:09.475] + command -v virtualenv
 [2022/07/28 21:39:09.475] ++ command -v virtualenv
 [2022/07/28 21:39:09.475] + VIRTUALENV='/usr/local/bin/virtualenv -p /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 --system-site-packages --never-download'
 [2022/07/28 21:39:09.475] + /usr/local/bin/virtualenv -p /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 --system-site-packages --never-download .venv
 [2022/07/28 21:39:09.966] /usr/local/bin/virtualenv
 [2022/07/28 21:39:09.966] created virtual environment CPython3.8.10.final.0-64 in 358ms
 [2022/07/28 21:39:09.966]   creator CPython3Posix(dest=/data/mci/2a6095fdcfc5eb875c7b80b040ad3c72/libmongocrypt/bindings/python/.venv, clear=False, no_vcs_ignore=False, global=True)
 [2022/07/28 21:39:09.966]   seeder FromAppData(download=False, pip=bundle, wheel=bundle, setuptools=bundle, via=copy, app_data_dir=/Users/mci/Library/Application Support/virtualenv)
 [2022/07/28 21:39:09.966]     added seed packages: pip==22.1.2, setuptools==62.6.0, wheel==0.37.1
 [2022/07/28 21:39:09.966]   activators NushellActivator,PythonActivator,FishActivator,CShellActivator,PowerShellActivator,BashActivator

https://spruce.mongodb.com/task/libmongocrypt_macos_x86_64_test_python_patch_c2712248e9f4909cdad723607ea5291d2eb48b91_62e2ffb5a4cf470f9c7187c7_22_07_28_21_29_26/logs?execution=0

This might explain why the wheels are intel and not x86_64.

@ShaneHarvey
Copy link
Member

ShaneHarvey commented Jul 28, 2022

What if we just produce 2 macos wheels?

  • macosx_11_0_universal2.whl: with Python 3.10 bundling the universal libmongocrypt.
  • macosx_10_14_x86_64.whl: with Python 3.7 bundling the x86-64-only libmongocrypt.

These two should give us the maximum compatibility.

@blink1073
Copy link
Member Author

What if we just produce 2 macos wheels?

Sounds good

@blink1073
Copy link
Member Author

We end up with the following in the uploaded tar ball:

image

@blink1073 blink1073 requested a review from ShaneHarvey August 23, 2022 23:37

- name: "release-python-linux"
tags: ["release_python_tag"]
run_on: ubuntu2004-large
Copy link
Member

Choose a reason for hiding this comment

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

Can we use ubuntu2004-small instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

- func: "build python release"
- func: "test python release"
vars: { PYTHON: python }
- func: "upload python release"
Copy link
Member

Choose a reason for hiding this comment

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

Can you add the sdist to one of these tasks so that the tar.gz release is included too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done


$PYTHON setup.py bdist_wheel
rm -rf build libmongocrypt pymongocrypt/*.so pymongocrypt/*.dll pymongocrypt/*.dylib
sudo rm -rf build libmongocrypt pymongocrypt/*.so pymongocrypt/*.dll pymongocrypt/*.dylib
Copy link
Member

Choose a reason for hiding this comment

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

Is this still a problem now that we're using Evergreen?

@blink1073
Copy link
Member Author

Now includes sdist:

image

@blink1073 blink1073 merged commit e6e9054 into mongodb:master Aug 25, 2022
@blink1073 blink1073 deleted the PYTHON-3356 branch August 25, 2022 02:02
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.

2 participants