-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-2584: Run driver test with system libraries #1831
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
Merged
alcaeus
merged 5 commits into
mongodb:feature/phpc-2435-libmongoc-2
from
alcaeus:build-system-libs
May 26, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
45dc641
Add build action to build libmongoc system libraries
alcaeus 4cf84bd
Build driver with system libs
alcaeus 7d9140e
Install libmongocrypt as system library
alcaeus e026311
Run tests with system libs
alcaeus 9949485
Move system library tests to tests workflow
alcaeus 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
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: "Build libmongoc" | ||
description: "Builds and install libmongoc" | ||
inputs: | ||
prefix: | ||
description: "Prefix to install libmongoc to" | ||
default: "/usr/local" | ||
version: | ||
description: "Libmongoc version to build" | ||
required: true | ||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Download libmongoc | ||
shell: bash | ||
working-directory: /tmp | ||
run: wget "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/${LIBMONGOC_VERSION}.tar.gz" --output-document="mongo-c-driver.tar.gz" | ||
env: | ||
LIBMONGOC_VERSION: ${{ inputs.version }} | ||
|
||
- name: Extract libmongoc | ||
shell: bash | ||
working-directory: /tmp | ||
run: tar xf "mongo-c-driver.tar.gz" | ||
|
||
- name: Configure cmake | ||
shell: bash | ||
working-directory: /tmp | ||
run: | | ||
cmake \ | ||
-S "mongo-c-driver-${LIBMONGOC_VERSION}" \ | ||
-B _build \ | ||
-D CMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
-D BUILD_VERSION="${LIBMONGOC_VERSION}" \ | ||
-D ENABLE_MONGOC=ON \ | ||
-D ENABLE_TRACING=ON \ | ||
-D ENABLE_CLIENT_SIDE_ENCRYPTION=ON | ||
env: | ||
LIBMONGOC_VERSION: ${{ inputs.version }} | ||
|
||
- name: Build libmongoc | ||
shell: bash | ||
working-directory: /tmp | ||
run: cmake --build _build --config RelWithDebInfo --parallel | ||
|
||
- name: Install libmongoc | ||
shell: bash | ||
working-directory: /tmp | ||
run: sudo cmake --install _build --prefix "${PREFIX}" --config RelWithDebInfo | ||
env: | ||
PREFIX: ${{ inputs.prefix }} | ||
|
||
- name: Check pkg-config availability | ||
shell: bash | ||
run: pkg-config --modversion mongoc2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noted for a separate PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.