Skip to content

Commit 071e4a4

Browse files
authored
chore: add back support for generating signable binaries (#339)
Use `boxednode` to create binaries that are compiled in a way that should enable us to sign them. `pkg` is retained as a helper for local development, since it requires no native compilation. For CI, we add a Dockerfile to create the various Linux packages. Fixes MONGOSH-226
1 parent 7c712d1 commit 071e4a4

20 files changed

+312
-1016
lines changed

.evergreen.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,20 @@ variables:
1717
source .evergreen/.setup_env
1818
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
1919
export EVERGREEN_EXPANSIONS_PATH="$(pwd)/../tmp/expansions.yaml"
20-
npm run evergreen-release package
20+
if [ `uname` == Linux ]; then
21+
mkdir -p tmp
22+
cp "$(pwd)/../tmp/expansions.yaml" tmp/expansions.yaml
23+
(cd scripts/docker && docker build -t ubuntu16.04-build -f ubuntu16.04-build.Dockerfile .)
24+
echo Starting Docker container build
25+
docker run -e PUPPETEER_SKIP_CHROMIUM_DOWNLOAD \
26+
-e EVERGREEN_EXPANSIONS_PATH=/tmp/build/tmp/expansions.yaml \
27+
-e NODE_JS_VERSION \
28+
-e BUILD_VARIANT \
29+
--rm -v $PWD:/tmp/build --network host ubuntu16.04-build \
30+
-c 'cd /tmp/build && npm run evergreen-release package'
31+
else
32+
npm run evergreen-release package
33+
fi
2134
RELEASE_MONGOSH
2235
2336
if [ `uname` == Darwin ]; then
@@ -273,8 +286,8 @@ buildvariants:
273286
- name: test
274287
- name: release_linux
275288
- name: rhel
276-
display_name: "RHEL 8.0"
277-
run_on: rhel80-large
289+
display_name: "RHEL 8.0 (in Ubuntu docker)"
290+
run_on: ubuntu1804-test
278291
tasks:
279292
- name: check
280293
- name: release_rhel
@@ -286,8 +299,8 @@ buildvariants:
286299
- name: test_ps
287300
- name: release_win_ps
288301
- name: debian
289-
display_name: "Debian 10"
290-
run_on: debian10-large
302+
display_name: "Debian 10 (in Ubuntu docker)"
303+
run_on: ubuntu1804-test
291304
tasks:
292305
- name: check
293306
- name: release_debian

.evergreen/.install_node

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export NODE_JS_VERSION='12.4.0'
1+
export NODE_JS_VERSION='12.18.4'
22

33
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
44
export NVM_DIR="$HOME/.nvm"

.evergreen/InstallNode.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$version = "12.4.0"
1+
$version = "12.18.4"
22
$url = "https://nodejs.org/download/release/v$version/node-v$version-win-x64.zip"
33
$filename = "node.zip"
44
$node_zip = "$PSScriptRoot\$filename"

.evergreen/SetupEnv.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
$version = "12.4.0"
1+
$version = "12.18.4"
22
$Env:PATH = "$PSScriptRoot\node-v$version-win-x64;C:\Program Files\Git\mingw32\libexec\git-core;$Env:PATH"
3+
$Env:NODE_JS_VERSION = "$version"
34

45
echo "Using node version:"
56
node --version

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Compile just the CLI:
161161
npm run compile-ts
162162
```
163163

164-
Compile the standalone executable:
164+
Compile the standalone executable (this may take some time):
165165

166166
```shell
167167
npm run compile-exec
@@ -170,7 +170,7 @@ npm run compile-exec
170170
Compile a specific package, e.g. the `.deb` for Debian:
171171

172172
```shell
173-
npm run release -- --dry --build-variant=Debian
173+
npm run evergreen-release package -- --dry --build-variant=Debian
174174
```
175175

176176
## Contributing

config/build.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ module.exports = {
6767
isCi: process.env.IS_CI === 'true',
6868
isPatch: process.env.IS_PATCH === 'true',
6969
platform: os.platform(),
70+
execNodeVersion: process.env.NODE_JS_VERSION || `^${process.version.slice(1)}`,
7071
buildVariant: process.env.BUILD_VARIANT,
7172
repo: {
7273
owner: 'mongodb-js',

0 commit comments

Comments
 (0)