Skip to content

Commit 4b6036a

Browse files
committedAug 25, 2020
build,deps: add gen-openssl target
This adds a new make target to generate platform dependent files for openssl on non-linux machines. The scripts we currently have in place require linux. This adds a Dockerfile that installs the necessary dependencies to be able to generate these files. Previously, it was necessary to run `make -C deps/openssl/config` on a linux machine. Now, as long as docker is installed and in your `PATH`, it is possible to run `make gen-openssl`. PR-URL: nodejs#34642 Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent ad2c22d commit 4b6036a

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
 

‎Makefile

+16
Original file line numberDiff line numberDiff line change
@@ -1406,3 +1406,19 @@ endif
14061406
lint-clean:
14071407
$(RM) tools/.*lintstamp
14081408
$(RM) .eslintcache
1409+
1410+
HAS_DOCKER ?= $(shell which docker > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
1411+
1412+
ifeq ($(HAS_DOCKER), 1)
1413+
DOCKER_COMMAND ?= docker run -it -v $(PWD):/node
1414+
IS_IN_WORKTREE = $(shell grep '^gitdir: ' $(PWD)/.git 2>/dev/null)
1415+
GIT_WORKTREE_COMMON = $(shell git rev-parse --git-common-dir)
1416+
DOCKER_COMMAND += $(if $(IS_IN_WORKTREE), -v $(GIT_WORKTREE_COMMON):$(GIT_WORKTREE_COMMON))
1417+
gen-openssl: ## Generate platform dependent openssl files (requires docker)
1418+
docker build -t node-openssl-builder deps/openssl/config/
1419+
$(DOCKER_COMMAND) node-openssl-builder make -C deps/openssl/config
1420+
else
1421+
gen-openssl:
1422+
@echo "No docker command, cannot continue"
1423+
@exit 1
1424+
endif

‎deps/openssl/config/Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM ubuntu:20.04
2+
3+
VOLUME /node
4+
5+
RUN buildDeps='binutils build-essential vim nasm git' \
6+
&& apt-get update \
7+
&& apt-get install -y --no-install-recommends --force-yes $buildDeps \
8+
&& apt-get clean \
9+
&& apt-get autoremove -y \
10+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
11+
12+
WORKDIR /node

‎doc/guides/maintaining-openssl.md

+4
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ The patch is currently supported only for openssl-1.1.1e.
8080
Use `make` to regenerate all platform dependent files in
8181
`deps/openssl/config/archs/`:
8282
```console
83+
# On non-linux machines
84+
% make gen-openssl
85+
86+
# On Linux machine
8387
% make -C deps/openssl/config
8488
```
8589

0 commit comments

Comments
 (0)
Please sign in to comment.