Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,688 changes: 1,344 additions & 1,344 deletions .evergreen.yml

Large diffs are not rendered by default.

35 changes: 2 additions & 33 deletions .evergreen/compile-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,9 @@ if uname -a | grep -q 'Linux.*x86_64'; then
export CXX="$PWD/tmp/.sccache/sccache g++"
fi

if uname -p | sed -e 's/s390/matches/' -e 's/ppc/matches/' | grep -q matches; then
# On s390x and PPC machines in evergreen, there is a Python 3.x installation
# in /opt/mongodbtoolchain/v3/bin, but it's broken in the sense that its bz2
# package cannot be loaded, which we need for building Node.js.
# We therefore do some PATH wiggling here to make sure that the python
# executable used by the Node.js configure script is python 2.x.
# This is not a sustainable long-term solution, because Node.js drops Python 2
# support for build scripts with Node.js 15 and above.
# TODO: Open a build ticket about this, referencing patch/output from
# https://spruce.mongodb.com/version/608ad4613e8e8601d5cd3d6f/tasks.
rm -rf tmp/python-container
mkdir -p tmp/python-container
(cd tmp/python-container && ln -s /usr/bin/python python && ln -s python python2.7 && ln -s python python2)
export PATH="$PWD/tmp/python-container:$PATH"
export FORCE_PYTHON2=1

echo "Using python version:"
python --version
fi

if [ "$OS" == "Windows_NT" ]; then
# Windows machines only have Python 3.10 and 2.7, since Python 3.9
# was removed from them. Python 3.10 support may or may not be
# backported to Node.js 14: https://github.com/nodejs/node/pull/40296/
# For now, let's use Python 2.7.
export PATH="/cygdrive/c/Python27/Scripts:/cygdrive/c/Python27:$PATH"
export FORCE_PYTHON2=1

echo "Using python version:"
python --version
fi

export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
npm run evergreen-release compile
mkdir -pv /tmp/m # Node.js compilation can fail on long path prefixes
(env TMP=/tmp/m TMPDIR=/tmp/m npm run evergreen-release compile && rm -rf /tmp/m) || (rm -rf /tmp/m; false)
dist/mongosh --version
dist/mongosh --build-info
dist/mongosh --build-info | grep -q '"distributionKind": "compiled"'
Expand Down
52 changes: 26 additions & 26 deletions .evergreen/evergreen.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<%
const path = require('path');

const NODE_JS_VERSION_14 = '14.19.1';
const NODE_JS_VERSION_12 = '12.22.11';
const NODE_JS_VERSION_14 = '14.19.2';
const NODE_JS_VERSION_16 = '16.15.0';

const MONGODB_VERSIONS = [
{ shortName: '40xc', versionSpec: '4.0.x-community' },
Expand All @@ -17,8 +17,8 @@ const MONGODB_VERSIONS = [
{ shortName: 'latest', versionSpec: 'latest-alpha' }
];
const NODE_VERSIONS = [
{ shortName: '12', versionSpec: NODE_JS_VERSION_12, skipNodeVersionCheck: '1' },
{ shortName: '14', versionSpec: NODE_JS_VERSION_14, skipNodeVersionCheck: '' }
{ shortName: '16', versionSpec: NODE_JS_VERSION_16, skipNodeVersionCheck: '' },
{ shortName: '14', versionSpec: NODE_JS_VERSION_14, skipNodeVersionCheck: '1' }
];

const pathToPackages = path.join(__dirname, '..', 'packages');
Expand Down Expand Up @@ -630,7 +630,7 @@ tasks:
- func: checkout
- func: compile_ts
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"

- name: check
depends_on:
Expand All @@ -640,11 +640,11 @@ tasks:
- func: checkout
- func: install
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
npm_deps_mode: all
- func: check
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"

- name: check_coverage
depends_on:
Expand All @@ -654,11 +654,11 @@ tasks:
- func: checkout
- func: install
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
npm_deps_mode: cli_build
- func: check_coverage
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"

###
# UNIT TESTS
Expand Down Expand Up @@ -697,11 +697,11 @@ tasks:
- func: checkout
- func: install
vars:
node_js_version: "<% out(NODE_JS_VERSION_12) %>"
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
npm_deps_mode: all
- func: test_vscode
vars:
node_js_version: "<% out(NODE_JS_VERSION_12) %>"
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
- name: test_connectivity
tags: ["extra-integration-test"]
depends_on:
Expand All @@ -711,7 +711,7 @@ tasks:
- func: checkout
- func: install
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
npm_deps_mode: all
- func: test_connectivity
- name: test_apistrict
Expand All @@ -723,11 +723,11 @@ tasks:
- func: checkout
- func: install
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
npm_deps_mode: cli_build
- func: test_apistrict
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
mongosh_server_test_version: "latest-alpha"
mongosh_test_force_api_strict: "1"
- name: compile_artifact
Expand All @@ -738,11 +738,11 @@ tasks:
- func: checkout
- func: install
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
npm_deps_mode: cli_build
- func: compile_artifact
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"

###
# E2E TESTS
Expand All @@ -759,14 +759,14 @@ tasks:
- func: checkout
- func: install
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
npm_deps_mode: cli_build
- func: download_compiled_artifact
vars:
executable_os_id: <% out(executableOsId) %>
- func: run_e2e_tests
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
mongosh_server_test_version: "<% out(mVersion) %>"
<% } } %>

Expand All @@ -784,10 +784,10 @@ tasks:
- func: install
vars:
npm_deps_mode: cli_build
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
- func: package_and_upload_artifact
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
distribution_build_variant: <% out(distributionBuildVariant) %>
executable_os_id: <% out(executableOsId) %>
<% } } %>
Expand Down Expand Up @@ -823,11 +823,11 @@ tasks:
case 'docker': { %>
- func: install
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
npm_deps_mode: cli_build
- func: test_artifact_docker
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
dockerfile: <% out(dockerfile) %>
<% }; break;
// We don't have docker for platforms other than x64, so for those we just
Expand Down Expand Up @@ -862,11 +862,11 @@ tasks:
- func: checkout
- func: install
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
npm_deps_mode: all
- func: release_draft
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
- name: release_publish
tags: ["publish"]
git_tag_only: true
Expand All @@ -878,11 +878,11 @@ tasks:
- func: checkout
- func: install
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
npm_deps_mode: all
- func: release_publish
vars:
node_js_version: "<% out(NODE_JS_VERSION_14) %>"
node_js_version: "<% out(NODE_JS_VERSION_16) %>"

# Need to run builds for every possible build variant.
buildvariants:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Please include as much information as possible about your environment.

## Node.js versions

We support Node.js 12.x+ for the individual packages, and Node.js 14.x only for
We support Node.js 14.x+ for the individual packages, and Node.js 16.x only for
the CLI repl specifically. These versions are mentioned:

- In the individual packages’ package.json files
Expand Down
2 changes: 1 addition & 1 deletion packages/arg-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"access": "public"
},
"engines": {
"node": ">=12.4.0"
"node": ">=14.15.1"
},
"mongosh": {
"unitTestsOnly": true
Expand Down
2 changes: 1 addition & 1 deletion packages/async-rewriter2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"access": "public"
},
"engines": {
"node": ">=12.4.0"
"node": ">=14.15.1"
},
"mongosh": {
"unitTestsOnly": true
Expand Down
2 changes: 1 addition & 1 deletion packages/autocomplete/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"url": "https://github.com/mongodb-js/mongosh"
},
"engines": {
"node": ">=12.4.0"
"node": ">=14.15.1"
},
"scripts": {
"test": "mocha -r \"../../scripts/import-expansions.js\" --timeout 60000 -r ts-node/register \"./{src,lib}/**/*.spec.ts\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-repl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0-dev.0",
"description": "Browser presentation component for Mongo Shell",
"engines": {
"node": ">=12.4.0"
"node": ">=14.15.1"
},
"main": "lib/mongosh-browser-repl.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-runtime-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"engines": {
"node": ">=12.4.0"
"node": ">=14.15.1"
},
"config": {
"unsafe-perm": true
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-runtime-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"engines": {
"node": ">=12.4.0"
"node": ">=14.15.1"
},
"config": {
"unsafe-perm": true
Expand Down
2 changes: 1 addition & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"access": "public"
},
"engines": {
"node": ">=12.4.0"
"node": ">=14.15.1"
},
"dependency-check": {
"entries": [
Expand Down
22 changes: 22 additions & 0 deletions packages/build/src/compile/signable-compiler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-nested-ternary */
import os from 'os';
import { promises as fs } from 'fs';
import Module from 'module';
import pkgUp from 'pkg-up';
import path from 'path';
Expand Down Expand Up @@ -27,6 +28,27 @@ async function preCompileHook(nodeSourceTree: string) {
if (code !== 0) {
throw new Error(`pre-compile hook failed with code ${code}`);
}

const patchDirectory = path.resolve(__dirname, '..', '..', '..', '..', 'scripts', 'nodejs-patches');
// Sort all entries in the directory so that they are applied
// in order 001-(...).patch, 002-(...).patch, etc.
const patchFiles = (await fs.readdir(patchDirectory)).sort();
for (const entry of patchFiles) {
const patchFile = path.resolve(patchDirectory, entry);
console.warn(`Applying patch from ${patchFile}...`);
// NB: git apply doesn't need to be run in a git repository in order to work
const proc = childProcess.spawn(
'git', ['apply', patchFile],
{
cwd: nodeSourceTree,
stdio: 'inherit'
}
);
const [ code ] = await once(proc, 'exit');
if (code !== 0) {
throw new Error(`applying patch failed with code ${code}`);
}
}
}

async function findModulePath(lernaPkg: string, mod: string): Promise<string> {
Expand Down
12 changes: 6 additions & 6 deletions packages/build/src/homebrew/generate-formula.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class Mongosh < Formula
sha256 mojave: "9c46c746cf8f65a8418cb39237471cd6338135e398f2ace965a6c580e1165951"
end

depends_on "node@14"
depends_on "node@16"

def install
system "#{Formula["node@14"].bin}/npm", "install", *Language::Node.std_npm_install_args(libexec)
(bin/"mongosh").write_env_script libexec/"bin/mongosh", PATH: "#{Formula["node@14"].opt_bin}:$PATH"
system "#{Formula["node@16"].bin}/npm", "install", *Language::Node.std_npm_install_args(libexec)
(bin/"mongosh").write_env_script libexec/"bin/mongosh", PATH: "#{Formula["node@16"].opt_bin}:$PATH"
end

test do
Expand Down Expand Up @@ -67,11 +67,11 @@ class Mongosh < Formula
sha256 mojave: "9c46c746cf8f65a8418cb39237471cd6338135e398f2ace965a6c580e1165951"
end

depends_on "node@14"
depends_on "node@16"

def install
system "#{Formula["node@14"].bin}/npm", "install", *Language::Node.std_npm_install_args(libexec)
(bin/"mongosh").write_env_script libexec/"bin/mongosh", PATH: "#{Formula["node@14"].opt_bin}:$PATH"
system "#{Formula["node@16"].bin}/npm", "install", *Language::Node.std_npm_install_args(libexec)
(bin/"mongosh").write_env_script libexec/"bin/mongosh", PATH: "#{Formula["node@16"].opt_bin}:$PATH"
end

test do
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-repl/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cli-repl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"access": "public"
},
"engines": {
"node": ">=14.15.0"
"node": ">=16.15.0"
},
"mongosh": {
"ciRequiredOptionalDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/connectivity-tests/test/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cd test-envs

git checkout f029f9e3a9cc006a6aeb60d941b4f8d87ae4bc95

source "$CONNECTIVITY_TEST_SOURCE_DIR/ldap.sh"
source "$CONNECTIVITY_TEST_SOURCE_DIR/localhost.sh"
source "$CONNECTIVITY_TEST_SOURCE_DIR/atlas.sh"
source "$CONNECTIVITY_TEST_SOURCE_DIR/kerberos.sh"
"$CONNECTIVITY_TEST_SOURCE_DIR/ldap.sh"
"$CONNECTIVITY_TEST_SOURCE_DIR/localhost.sh"
"$CONNECTIVITY_TEST_SOURCE_DIR/atlas.sh"
"$CONNECTIVITY_TEST_SOURCE_DIR/kerberos.sh"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Drive-by fix: This seems better, since it isolates the scripts more strongly, and exit 0 inside the script would not exit all the tests at once (previously e.g. the kerberos tests would always be skipped if no atlas credentials were in the environment)

Loading