Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Install libmongocrypt as system library
  • Loading branch information
alcaeus committed May 26, 2025
commit 7d9140e155bbb921829dd46b426c325f0f42e19e
3 changes: 2 additions & 1 deletion .github/actions/linux/build-libmongoc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ runs:
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D BUILD_VERSION="${LIBMONGOC_VERSION}" \
-D ENABLE_MONGOC=ON \
-D ENABLE_TRACING=ON
-D ENABLE_TRACING=ON \
-D ENABLE_CLIENT_SIDE_ENCRYPTION=ON
env:
LIBMONGOC_VERSION: ${{ inputs.version }}

Expand Down
29 changes: 29 additions & 0 deletions .github/actions/linux/build-libmongocrypt/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Build libmongocrypt"
description: "Installs libmongocrypt"
inputs:
version:
description: "Libmongocrypt version to install (major.minor)"
required: true
runs:
using: composite

steps:
- name: Add repository key
shell: bash
run: sudo sh -c 'curl -s --location https://pgp.mongodb.com/libmongocrypt.asc | gpg --dearmor >/etc/apt/trusted.gpg.d/libmongocrypt.gpg'

- name: Add repository
shell: bash
working-directory: /tmp
# Note: no packages for Ubuntu 24.04 noble exist, so we use those for 22.04
Copy link
Member

Choose a reason for hiding this comment

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

Are there any plans to have one later? If not, it will get complicated when the upgrade to Ubuntu 24.04 is enforced by GitHub.

Copy link
Member Author

Choose a reason for hiding this comment

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

I created MONGOCRYPT-813 for this. Note that I'm already using 24.04 and the PPA works for the time being. Once the ticket is resolved, I'd update this accordingly.

run: echo "deb https://libmongocrypt.s3.amazonaws.com/apt/ubuntu jammy/libmongocrypt/${LIBMONGOCRYPT_VERSION} universe" | sudo tee /etc/apt/sources.list.d/libmongocrypt.list
env:
LIBMONGOCRYPT_VERSION: ${{ inputs.version }}

- name: Update apt sources
shell: bash
run: sudo apt-get update

- name: Install libmongocrypt
shell: bash
run: sudo apt-get install -y libmongocrypt-dev
Copy link
Member

Choose a reason for hiding this comment

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

It might be possible to cache the apt dependency: https://github.com/marketplace/actions/cache-apt-packages

Copy link
Member Author

Choose a reason for hiding this comment

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

Noted for a separate PR.

7 changes: 5 additions & 2 deletions .github/workflows/system-libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ jobs:
with:
submodules: true

- name: "Install libmongocrypt"
uses: ./.github/actions/linux/build-libmongocrypt
with:
version: 1.14

- name: "Build libmongoc"
id: build-libmongoc
uses: ./.github/actions/linux/build-libmongoc
with:
version: 2.0.1

- name: "Build Driver"
id: build-driver
uses: ./.github/actions/linux/build
with:
version: "8.4"
Expand Down