Skip to content

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

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented May 23, 2025

PHPC-2584

This PR adds tests with system libraries to ensure that the driver can function when built not with the bundled versions of libmongoc and libmongocrypt, but instead is able to locate and build with system libraries. I'm using GitHub Actions for this build as it's easier to isolate this build from others on this platform. The process is relatively simple:

  • Install libmongocrypt
  • Build an install libmongoc/libbson
  • Run a driver build with the --with-mongodb-system-libs=yes configure option
  • Make sure the driver builds correctly (hence the make show-config output so this can be verified)
  • Run tests against a standalone 8.0 server (no need to test multiple topologies or server versions)

Once we merge the feature branch to v2.x, I would also mark this particular build as required so any breakage when building with system libs prevents a merge.

@alcaeus alcaeus requested a review from GromNaN May 23, 2025 07:20
@alcaeus alcaeus requested a review from a team as a code owner May 23, 2025 07:20
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

SGTM, with 2 questions.

- 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.


- 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.

@alcaeus alcaeus force-pushed the feature/phpc-2435-libmongoc-2 branch from 9ef16ef to b5f3c8e Compare May 26, 2025 07:17
@alcaeus alcaeus force-pushed the build-system-libs branch from 15db850 to 9949485 Compare May 26, 2025 07:18
@alcaeus alcaeus merged commit 71510e2 into mongodb:feature/phpc-2435-libmongoc-2 May 26, 2025
61 checks passed
@alcaeus alcaeus deleted the build-system-libs branch May 26, 2025 07:43
alcaeus added a commit that referenced this pull request Jun 3, 2025
* Bump libmongoc to 2.0.1 and libmongocrypt to 1.14.0

This fixes the following issues:
* PHPC-2581: Bump to libmongoc 2.0.1
* PHPC-2578: Bump to libmongocrypt 1.14.0
* PHPC-2548: Remove MONGOC_WRITE_CONCERN_W_ERRORS_IGNORED
* PHPC-2540: Use const for mongoc_host_list_t
* PHPC-2547: Remove MONGOC_NO_AUTOMATIC_GLOBALS
* PHPC-2549: Remove BSON_EXTRA_ALIGN
* PHPC-1548: Add tests for empty authSource URI option
* PHPC-2542: Add test coverage for auth mechanism errors

* PHPC-2584: Run driver test with system libraries (#1831)

* Add build action to build libmongoc system libraries

* Build driver with system libs

* Install libmongocrypt as system library

* Run tests with system libs

* Move system library tests to tests workflow

* PHPC-2545: Drop support for compiling with LibreSSL (#1836)

* PHPC-2545: Drop support for compiling with LibreSSL

* Warn when explicitly building with libressl

* Fix usage of wrong version variable

* PHPC-2367: Add SSPI SASL, drop Cyrus on Windows (#1837)

* Support building with SSPI support under Windows

* Remove support for building with Cyrus SASL on Windows

* Apply feedback from Copilot

* Apply code review feedback

* Fix handling of missing SASL libs when relying on default value for with-mongodb-sasl

* Apply feedback from code review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants