Edit lib/libmongocrypt_helper/version.rb and:
- Update the
LIBMONGOCRYPT_VERSIONconstant to the version oflibmongocryptthat you want to package. - Update the
VERSIONconstant to the version of the helper, which is derived fromlibmongocryptversion as described below. - Run
./build-so.sh. This will fetch the tarball forlibmongocryptof the version specified in the first step, build thelibmongocrypt.soshared library using Docker and place the shared library under thesosubdirectory. - Commit the changes including the new shared library.
- Run
./release.shto create a gem and push it to RubyGems.
Ruby gems have a relatively primitive versioning system where any non-numeric
version component causes the version to be interpreted as a pre-release.
For example, a scheme like 1.0p1 where "p1" stands for the first package
of the 1.0 version of some library doesn't work.
To work around this, libmongocrypt helper is versioned as X.0.Y where
X is the version of libmongocrypt that is being packaged and Y is
the package version plus 1000. Thus, the first package for libmongocrypt
1.5.2 would have the helper version of 1.5.2.0.1001, and if that version
of libmongocrypt needs to be repackaged for any reason, the next helper
version would be 1.5.2.0.1002, and so on.
Starting package versions from 1001 makes it easy to identify the package
revision vs the libmongocrypt version.
libmongocrypt can be built while linking to the operating system's
crypto libraries (i.e. OpenSSL) or not. If libmongocrypt is not linked
to the operating system's crypto libraries, a crypto implementation must be
provided at runtime, which the Ruby MongoDB driver does.
The advantage of not linking against the operating system's crypto libraries
is that the libmongocrypt.so binary becomes portable across the various
Linux distributions for example. The only requirement of libmongocrypt.so
as packaged with libmongocrypt helper is the GLibC version that the system
provides has to be at least the version that the shared library was built
against. For this reason, the shared library is built in Docker using
Debian 9.