Don't use cross-compilation environment for Python requirements install

We should eventually just get rid of the "pip install" invocation in the
Makefile altogether and replace it with good documentation for manual
environment setup. Bot for the moment we have it and so we should make
it work even in the case where it needs to compile code. This should fix
the CI problems on macOS and Ubuntu 19.10.

I was torn between fixing it this way and removing the "export"s from
the Makefile altogether, replacing them with explicit variable passing
to submakes. But I figure that it's probably correct to have $CC and
friends automatically set to the cross compiler since the entire purpose
of these Makefiles is to build code for the BL602. If we ever delegate
some functionality to a shell script, it'll be nice to just have $CC
automagically set. So I've kept the exports and fixed it this way
instead.
This commit is contained in:
Thomas Hebb 2021-01-01 22:42:31 -08:00
parent 5405725866
commit 709a9f9329

View File

@ -183,11 +183,16 @@ export COMPONENT_INCLUDES
include $(BL60X_SDK_PATH)/make_scripts_riscv/common.mk
include $(BL60X_SDK_PATH)/make_scripts_riscv/toolchain.mk
# In this recipe, "pip install" may need to build native code, so make sure it
# doesn't use the cross-compilation environment. The specific list of variables
# unset is taken from the intersection of what we export and what Python's
# distutils uses (see CPython's Lib/distutils/sysconfig.py).
all:
ifeq ("$(OS)","Windows_NT")
else
ifeq ("$(CONFIG_CHIP_NAME)", "BL602")
@cd $(BL60X_SDK_PATH)/image_conf && python3 -m pip install -r requirements.txt && python3 flash_build.py $(PROJECT_NAME) $(CONFIG_CHIP_NAME)
@env -u CC -u CXX -u AR -u CFLAGS -u CPPFLAGS python3 -m pip install -r $(BL60X_SDK_PATH)/image_conf/requirements.txt
@cd $(BL60X_SDK_PATH)/image_conf && python3 flash_build.py $(PROJECT_NAME) $(CONFIG_CHIP_NAME)
endif
endif
@echo "Building Finish. To flash build output."