[VOL-5358] - build & test repo using new AMI image
makefiles/docker/include.mk
---------------------------
o get-cmd-docker-protoc-sh()
o Initial get-cmd() function required one path -v <mount> or --workdir.
o repo:voltha-protos requires multiple docker mounts so add a second
get-cmd() function that will accept a list of arguments/mounts.
o Makefile can override the definition of PROTOC_SH and GO_SH.
o Purge stray comments copied in as a placeholder from a repo Makefile,
can add these individually as needed.
o [TODO] Consider moving get-cmd() logic into named docker makefiles
if more functions are needed.
makefiles/virtualenv/requirements-txt.mk
----------------------------------------
o This was cute: user .bashrc, env can bleed through affecting python
module config and compiler flag selection.
o When installing packages using requirements.txt, sanitize the shell
to avoid stray interaction with user defined environment.
o In my case compiling would fail while attempting to construct a wheel
for packages being installed.
Signed-off-by: Joey Armstrong <jarmstrong@linuxfoundation.org>
Change-Id: Id1492807a505e54348b95bd553877565b55c57f6
diff --git a/makefiles/docker/include.mk b/makefiles/docker/include.mk
index 1561782..1507901 100644
--- a/makefiles/docker/include.mk
+++ b/makefiles/docker/include.mk
@@ -90,7 +90,27 @@
PROTOC ?= $(call get-cmd-docker-protoc)
# -----------------------------------------------------------------------
-# Usage: PROTOC_SH := $(call get-cmd-docker-protoc-sh)
+# Intent: Construct docker command passing in mounts.
+# To override, declare PROTOC_SH := $(call ) in Makefile
+# -----------------------------------------------------------------------
+# Usage:
+# docker-argv-mounts += -v ${CURDIR}:$(protoc-sh-docker-mount)
+# docker-argv-mounts += --workdir $(protoc-sh-docker-mount)
+# PROTOC_SH := $(call get-cmd-docker-argv-protoc-sh,docker-argv-mounts)
+# -----------------------------------------------------------------------
+get-cmd-docker-argv-protoc-sh =\
+ $(strip \
+ $(foreach argv,$(1),\
+ $(docker-run-is) $(if $(argv),$($(argv))) $(vee-citools)-protoc sh -c \
+ )\
+)
+
+# -----------------------------------------------------------------------
+# Intent: Original get-cmd-docker library function.
+# - conditional mount: use -v or --workdir
+# - See Also: get-cmd-docker-argv-protoc-sh() for generalized mounts
+# -----------------------------------------------------------------------
+# Usage: PROTOC_SH := $(call get-cmd-docker-argv-protoc-sh)
# -----------------------------------------------------------------------
get-cmd-docker-protoc-sh =\
$(strip \
@@ -104,22 +124,6 @@
)
PROTOC_SH ?= $(call get-cmd-docker-protoc-sh)
-# get-docker-protoc-sh = $(strip )
-#PROTOC_SH = $(docker-run-is)
-#ifdef protc-sh-docker-mount
-# PROTOC_SH += -v ${CURDIR}:$(protoc-sh-docker-mount)
-# PROTOC_SH += --workdir=$(protoc-sh-docker-mount)
-#endif # protoc-sh-docker-mount
-#PROTOC_SH += $(vee-citools)-protoc sh -c
-
-# Usage: GO_JUNIT_REPORT := $(call get-docker-go-junit-repo)
-# get-docker-go-junit-repo = $(docker-run-app) $(vee-citools)-go-junit-report go-junit-report
-# GO_JUNIT_REPORT ?= $(call get-docker-go-junit-repo)
-
-# -----------------------------------------------------------------------
-# get-docker-gocover-cobertura = $(docker-run-app)/src/github.com/opencord/voltha-openolt-adapter $(vee-citools)-gocover-cobertura gocover-cobertura
-# GOCOVER_COBERTURA ?= $(call get-docker-gocover-cobertura)
-
## -----------------------------------------------------------------------
## Coverage report: junit
## -----------------------------------------------------------------------
diff --git a/makefiles/virtualenv/requirements-txt.mk b/makefiles/virtualenv/requirements-txt.mk
index 2d615f6..be66ea4 100644
--- a/makefiles/virtualenv/requirements-txt.mk
+++ b/makefiles/virtualenv/requirements-txt.mk
@@ -44,7 +44,7 @@
$(call banner-enter,venv-requirements)
@mkdir -p $(dir $@)
- $(activate) && python -m pip install -r 'requirements.txt'
+ /bin/bash --noprofile --norc -c "$(activate) && python -m pip install -r 'requirements.txt'"
@touch $@
$(call banner-leave,venv-requirements)