Skip to content

fix(NODE-6795): support build-from-source installs#127

Open
axelonet wants to merge 1 commit intomongodb-js:mainfrom
axelonet:NODE-6795-build-from-source-libmongocrypt
Open

fix(NODE-6795): support build-from-source installs#127
axelonet wants to merge 1 commit intomongodb-js:mainfrom
axelonet:NODE-6795-build-from-source-libmongocrypt

Conversation

@axelonet
Copy link
Copy Markdown

@axelonet axelonet commented Mar 13, 2026

Description

Summary of Changes

Support npm install mongodb-client-encryption --build-from-source by bootstrapping libmongocrypt before node-gyp rebuild

Moved libmongocrypt bootstrap helpers to etc/ and use them consistently in both published installs and repo workflows

Notes for Reviewers
  • reproduced the original failure using:
    • npm install mongodb-client-encryption --build-from-source
  • confirmed the failure was:
    • fatal error: 'mongocrypt/mongocrypt.h' file not found
  • ran npm pack and verified the helper files are included in the tarball
  • installed from the packed tarball with:
    • npm install /mongodb-client-encryption/mongodb-client-encryption-7.0.0.tgz --build-from-source
  • confirmed the install completed successfully

Release Highlight

Double check the following

  • Lint is passing (npm run check:lint)
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

Copy link
Copy Markdown
Collaborator

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

This looks pretty good, I don't think it needs to be a draft?

etc/utils.mjs Outdated
if (ref.includes('.')) {
const [major, minor] = ref.split('.');
const branch = `r${major}.${minor}`;
return `https://mciuploads.s3.amazonaws.com/libmongocrypt-release/${platform}/${branch}/${hash}/libmongocrypt.tar.gz`;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we keep the comments from the original files?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sure thing! Thanks a lot for looking into the Drafts ^_^

I've raised a similar PR to the sister repo here: mongodb-js/zstd#110

Just wanted to make sure if anything pops over there as this is related.

Will move it from Draft now.

@axelonet axelonet force-pushed the NODE-6795-build-from-source-libmongocrypt branch from b33b7a9 to ae8c1ea Compare March 17, 2026 07:41
@axelonet axelonet marked this pull request as ready for review March 17, 2026 07:42
@axelonet axelonet requested a review from a team as a code owner March 17, 2026 07:42
@dariakp dariakp added External Submission PR submitted from outside the team tracked-in-jira labels Mar 17, 2026
@PavelSafronov
Copy link
Copy Markdown

@axelonet , thanks so much for your contribution. The team will triage this PR and https://jira.mongodb.org/browse/NODE-6795 and will get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Submission PR submitted from outside the team tracked-in-jira

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants