From ffe3fa3c640b213f6a6fe267fedeb4340f7d5530 Mon Sep 17 00:00:00 2001 From: Josh Klar Date: Sat, 20 Jul 2019 15:29:56 -0700 Subject: [PATCH] Get MPY cross compiler into the Docker image --- .circleci/config.yml | 5 +++-- Dockerfile_base | 21 +++++++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a84d61b..5a53c34 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,3 +1,4 @@ +--- version: 2 jobs: test: @@ -5,8 +6,8 @@ jobs: - image: 'kmkfw/base' environment: - KMK_TEST: 1 - PIPENV_VENV_IN_PROJECT: 1 + KMK_TEST: 1 + PIPENV_VENV_IN_PROJECT: 1 steps: - checkout diff --git a/Dockerfile_base b/Dockerfile_base index f2de7e6..01d5900 100644 --- a/Dockerfile_base +++ b/Dockerfile_base @@ -1,9 +1,22 @@ # vim: ft=dockerfile -# Not using python:3.7 here because team-gcc-arm-embedded/ppa does not support -# Ubuntu Cosmic or Debian Stretch, and Alpine, bizarrely, does not seem to -# package GCC cross compilers FROM python:3.7-alpine -RUN apk update && apk add alpine-sdk curl wget openssh rsync git git-lfs +RUN mkdir -p /app +WORKDIR /app + +RUN apk update && apk add alpine-sdk curl gettext git git-lfs openssh rsync wget + RUN pip install pipenv + +### Get a local copy of CircuitPython and its dependencies +# Our absolute baseline is 4.0.0, which (as of writing) shares MPY compat +# with all future versions. Our baseline will need to update as MPY compat +# changes +RUN git clone --branch 4.0.0 --depth 1 https://github.com/adafruit/CircuitPython /opt/circuitpython +RUN git -C /opt/circuitpython submodule update --init + +### Build the MPY compiler +RUN make -C /opt/circuitpython/mpy-cross + +ENV PATH=/opt/circuitpython/mpy-cross:${PATH}