Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 2.28 KB

README.maint.md

File metadata and controls

49 lines (39 loc) · 2.28 KB

libmongocrypt Ruby Helper - Maintainer Guide

Packaging New libmongocrypt Version

Edit lib/libmongocrypt_helper/version.rb and:

  1. Update the LIBMONGOCRYPT_VERSION constant to the version of libmongocrypt that you want to package.
  2. Update the VERSION constant to the version of the helper, which is derived from libmongocrypt version as described below.
  3. Run ./build-so.sh. This will fetch the tarball for libmongocrypt of the version specified in the first step, build the libmongocrypt.so shared library using Docker and place the shared library under the so subdirectory.
  4. Commit the changes including the new shared library.
  5. Run ./release.sh to create a gem and push it to RubyGems.

Helper Version Scheme

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.

Crypto

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.