Skip to content

Commit 9738fcd

Browse files
authored
Bundle libmongocrypt 1.18.0 + Update libmongocrypt URLs for 1.18.0+ (#1157)
* Bundle libmongocrypt 1.18.0 * Update release script * -LO * Output filenames * Fix verify * No explicit decrypto path * Update README * Fix README wording * Bump to 1.18.1 * Disable keyboxd on windows
1 parent 0f7fa40 commit 9738fcd

4 files changed

Lines changed: 44 additions & 40 deletions

File tree

bindings/python/README.rst

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -108,60 +108,51 @@ Installing libmongocrypt
108108
^^^^^^^^^^^^^^^^^^^^^^^^
109109

110110
libmongocrypt is continuously built and published on evergreen.
111-
The latest tarball containing libmongocrypt built on all supported variants is
112-
`published here <https://s3.amazonaws.com/mciuploads/libmongocrypt/all/master/latest/libmongocrypt-all.tar.gz>`_.
113-
Download and extract ``libmongocrypt-all.tar.gz`` and set
114-
``PYMONGOCRYPT_LIB`` to the path to your operating system's libmongocrypt.so file.
115-
For example::
116111

117-
$ curl -O https://s3.amazonaws.com/mciuploads/libmongocrypt/all/master/latest/libmongocrypt-all.tar.gz
118-
$ mkdir libmongocrypt-all && tar xzf libmongocrypt-all.tar.gz -C libmongocrypt-all
119-
$ ls libmongocrypt-all
120-
amazon2 debian92 rhel-80-64-bit rhel72-zseries-test ubuntu1804-arm64
121-
amazon2-arm64 linux-64-amazon-ami rhel-81-ppc64el suse12-64 ubuntu2004-64
122-
amazon2023 macos rhel-82-arm64 suse15-64 ubuntu2004-arm64
123-
amazon2023-arm64 rhel-62-64-bit rhel-83-zseries ubuntu1604 ubuntu2204-64
124-
debian10 rhel-70-64-bit rhel-91-64-bit ubuntu1604-arm64 ubuntu2204-arm64
125-
debian11 rhel-71-ppc64el rhel-91-arm64 ubuntu1804-64 windows-test
112+
Follow the instructions `here <https://www.mongodb.com/docs/manual/core/csfle/reference/libmongocrypt/>`_ to install the correct libmongocrypt build for your operating system.
113+
114+
Alternatively, the latest tarballs containing libmongocrypt binaries are
115+
`published here <https://github.com/mongodb/libmongocrypt/releases/latest>`_.
116+
Download and extract the correct ``libmongocrypt.tar.gz`` for your operating system and set
117+
``PYMONGOCRYPT_LIB`` to the path to your operating system's ``libmongocrypt.so`` file.
126118

119+
For example::
127120
macOS::
128121

129122
$ # Set PYMONGOCRYPT_LIB for macOS:
130-
$ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt-all/macos/lib/libmongocrypt.dylib
123+
$ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt/lib/libmongocrypt.dylib
131124
$ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"
132-
1.9.0
125+
1.18.0
133126

134127
Windows::
135128

136129
$ # Set PYMONGOCRYPT_LIB for Windows:
137130
$ chmod +x $(pwd)/libmongocrypt-all/windows-test/bin/mongocrypt.dll
138-
$ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt-all/windows-test/bin/mongocrypt.dll
131+
$ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt/bin/mongocrypt.dll
139132
$ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"
140-
1.9.0
133+
1.18.0
141134

142135
Linux: set the libmongocrypt build for your platform, for example for Ubuntu 22.04 x86_64::
143136

144137
$ # Set PYMONGOCRYPT_LIB for Ubuntu 22.04 x86_64:
145-
$ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt-all/ubuntu2204-64/lib/libmongocrypt.so
138+
$ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt/lib64/libmongocrypt.so
146139
$ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"
147-
1.9.0
140+
1.18.0
148141
$ # Check that native crypto is enabled for better performance:
149142
$ python -c 'from pymongocrypt.binding import lib;print(lib.mongocrypt_is_crypto_available())'
150143
True
151144

152-
Note if your Linux platform is not available, the generic RHEL 6.2 x86_64 "nocrypto" build
145+
Note if your Linux platform is not available, the generic ``linux-x86_64-glibc_2_7-nocrypto`` build
153146
should still be compatible however the "nocrypto" build will result in lower performance
154147
for encryption and decryption::
155148

156-
$ # Set PYMONGOCRYPT_LIB for RHEL 6.2 x86_64:
157-
$ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt-all/rhel-62-64-bit/nocrypto/lib64/libmongocrypt.so
149+
$ # Set PYMONGOCRYPT_LIB for linux-x86_64-glibc_2_7-nocrypto:
150+
$ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt/lib64/libmongocrypt.so
158151
$ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"
159-
1.9.0
152+
1.18.0
160153
$ python -c 'from pymongocrypt.binding import lib;print(lib.mongocrypt_is_crypto_available())'
161154
False
162155

163-
Other methods of installation (brew, rpm, yum, apt-get, deb, etc...) are documented here:
164-
https://www.mongodb.com/docs/manual/core/csfle/reference/libmongocrypt/#linux-installation
165156

166157
Dependencies
167158
============

bindings/python/sbom.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
{
22
"components": [
33
{
4-
"bom-ref": "pkg:github/mongodb/libmongocrypt@1.17.1",
4+
"bom-ref": "pkg:github/mongodb/libmongocrypt@1.18.1",
55
"externalReferences": [
66
{
77
"type": "distribution",
8-
"url": "https://github.com/mongodb/libmongocrypt/archive/1.17.1.tar.gz"
8+
"url": "https://github.com/mongodb/libmongocrypt/archive/1.18.1.tar.gz"
99
},
1010
{
1111
"type": "website",
12-
"url": "https://github.com/mongodb/libmongocrypt/tree/1.17.1"
12+
"url": "https://github.com/mongodb/libmongocrypt/tree/1.18.1"
1313
}
1414
],
1515
"group": "mongodb",
1616
"name": "libmongocrypt",
17-
"purl": "pkg:github/mongodb/libmongocrypt@1.17.1",
17+
"purl": "pkg:github/mongodb/libmongocrypt@1.18.1",
1818
"type": "library",
19-
"version": "1.17.1"
19+
"version": "1.18.1"
2020
}
2121
],
2222
"dependencies": [
2323
{
24-
"ref": "pkg:github/mongodb/libmongocrypt@1.17.1"
24+
"ref": "pkg:github/mongodb/libmongocrypt@1.18.1"
2525
}
2626
],
2727
"metadata": {
28-
"timestamp": "2026-01-22T15:24:18.934982+00:00",
28+
"timestamp": "2026-05-08T13:02:11.869716+00:00",
2929
"tools": [
3030
{
3131
"externalReferences": [
@@ -68,7 +68,7 @@
6868
}
6969
]
7070
},
71-
"serialNumber": "urn:uuid:3b5244f2-230a-4567-9938-e90a4d04c1e7",
71+
"serialNumber": "urn:uuid:d525e7f1-99ec-4504-862d-920e2f577c3b",
7272
"version": 1,
7373
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
7474
"bomFormat": "CycloneDX",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.17.1
1+
1.18.1

bindings/python/scripts/release.sh

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,20 @@ function get_libmongocrypt() {
3535
TARGET=$1
3636
MONGOCRYPT_SO=$2
3737
rm -rf build libmongocrypt pymongocrypt/*.so pymongocrypt/*.dll pymongocrypt/*.dylib
38-
curl -O https://s3.amazonaws.com/mciuploads/libmongocrypt-release/$TARGET/${BRANCH}/${REVISION}/libmongocrypt.tar.gz
38+
curl -Lo libmongocrypt.tar.gz https://github.com/mongodb/libmongocrypt/releases/download/${LIBMONGOCRYPT_VERSION}/libmongocrypt-${TARGET}-${LIBMONGOCRYPT_VERSION}.tar.gz
39+
curl -Lo libmongocrypt.asc https://github.com/mongodb/libmongocrypt/releases/download/${LIBMONGOCRYPT_VERSION}/libmongocrypt-${TARGET}-${LIBMONGOCRYPT_VERSION}.asc
40+
41+
# Download the public key, import it, and verify the signature.
42+
# Pre-create ~/.gnupg so GnuPG >= 2.4.1 does not auto-enable keyboxd on
43+
# fresh install, as keyboxd is broken on Windows.
44+
mkdir -p ~/.gnupg
45+
chmod 700 ~/.gnupg
46+
touch ~/.gnupg/common.conf
47+
gpg --version
48+
curl -LO https://pgp.mongodb.com/libmongocrypt.pub
49+
gpg --batch --no-tty --import libmongocrypt.pub
50+
gpg --batch --no-tty --verify libmongocrypt.asc libmongocrypt.tar.gz
51+
3952
mkdir libmongocrypt
4053
tar xzf libmongocrypt.tar.gz -C ./libmongocrypt
4154
chmod +x ${MONGOCRYPT_SO}
@@ -75,7 +88,7 @@ if [ "Windows_NT" = "$OS" ]; then # Magic variable in cygwin
7588
. ./.venv/Scripts/activate
7689

7790
# Use crypto-enabled libmongocrypt.
78-
get_libmongocrypt windows-test libmongocrypt/bin/mongocrypt.dll
91+
get_libmongocrypt windows-x86_64 libmongocrypt/bin/mongocrypt.dll
7992
build_wheel
8093
test_dist dist/*.whl
8194
fi
@@ -86,7 +99,7 @@ if [ "Darwin" = "$(uname -s)" ]; then
8699
. .venv/bin/activate
87100

88101
# Build universal2 wheel.
89-
get_libmongocrypt macos libmongocrypt/lib/libmongocrypt.dylib
102+
get_libmongocrypt macos-universal libmongocrypt/lib/libmongocrypt.dylib
90103
export MACOSX_DEPLOYMENT_TARGET=11.0
91104
export _PYTHON_HOST_PLATFORM=macosx-11.0-universal2
92105
build_wheel
@@ -117,7 +130,7 @@ if [ $(command -v docker) ]; then
117130
# Supports CentOS 7 rh-python38, CentOS 8 python38, Fedora 32+, Ubuntu 20.04+.
118131
# When the rhel7 images go EOL we'll have to switch to the manylinux_x_y variants
119132
# and use rhel8.
120-
get_libmongocrypt rhel-70-64-bit libmongocrypt/nocrypto/lib64/libmongocrypt.so
133+
get_libmongocrypt linux-x86_64-glibc_2_7-nocrypto libmongocrypt/lib64/libmongocrypt.so
121134
build_manylinux_wheel quay.io/pypa/manylinux2014_x86_64:2023-12-05-e9f0345
122135
if [ "Linux" = "$(uname -s)" ]; then
123136
$PYTHON -m venv .venv
@@ -126,7 +139,7 @@ if [ $(command -v docker) ]; then
126139
fi
127140

128141
# Build the manylinux_2_28 aarch64 wheel.
129-
get_libmongocrypt rhel-82-arm64 libmongocrypt/nocrypto/lib64/libmongocrypt.so
142+
get_libmongocrypt linux-arm64-glibc_2_17-nocrypto libmongocrypt/lib64/libmongocrypt.so
130143
build_manylinux_wheel quay.io/pypa/manylinux_2_28_aarch64:2024-01-01-0e91b08
131144
fi
132145

0 commit comments

Comments
 (0)