Skip to content
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

build,deps: add gen-openssl target #34642

Closed
wants to merge 1 commit into from
Closed
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
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`.
  • Loading branch information
evanlucas committed Aug 25, 2020
commit bf1d92f1c85a9621614403ccc43a634d77a7529b
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1406,3 +1406,19 @@ endif
lint-clean:
$(RM) tools/.*lintstamp
$(RM) .eslintcache

HAS_DOCKER ?= $(shell which docker > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)

ifeq ($(HAS_DOCKER), 1)
DOCKER_COMMAND ?= docker run -it -v $(PWD):/node
IS_IN_WORKTREE = $(shell grep '^gitdir: ' $(PWD)/.git 2>/dev/null)
GIT_WORKTREE_COMMON = $(shell git rev-parse --git-common-dir)
DOCKER_COMMAND += $(if $(IS_IN_WORKTREE), -v $(GIT_WORKTREE_COMMON):$(GIT_WORKTREE_COMMON))
gen-openssl: ## Generate platform dependent openssl files (requires docker)
docker build -t node-openssl-builder deps/openssl/config/
$(DOCKER_COMMAND) node-openssl-builder make -C deps/openssl/config
else
gen-openssl:
@echo "No docker command, cannot continue"
@exit 1
endif
12 changes: 12 additions & 0 deletions deps/openssl/config/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu:20.04

VOLUME /node

RUN buildDeps='binutils build-essential vim nasm git' \
&& apt-get update \
&& apt-get install -y --no-install-recommends --force-yes $buildDeps \
&& apt-get clean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR /node
4 changes: 4 additions & 0 deletions doc/guides/maintaining-openssl.md
Original file line number Diff line number Diff line change
@@ -80,6 +80,10 @@ The patch is currently supported only for openssl-1.1.1e.
Use `make` to regenerate all platform dependent files in
`deps/openssl/config/archs/`:
```console
# On non-linux machines
% make gen-openssl

# On Linux machine
% make -C deps/openssl/config
```