From 6b5aa9ee14f80bde5a0c775700dd4717348a15cb Mon Sep 17 00:00:00 2001 From: Devan Lai Date: Tue, 27 Feb 2018 20:42:00 -0800 Subject: [PATCH 1/5] Migrate from CircleCI 1.0 to 2.0 --- .circleci/config.yml | 25 +++++++++++++++++++++++++ circle.yml | 12 ------------ 2 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..60d4d89 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,25 @@ +version: 2 +jobs: + build: + machine: true + steps: + - checkout + - run: + name: Checkout submodules + command: git submodule sync && git submodule update --init + - restore_cache: + key: v1-toolchain-checksum-{{ checksum "util/install-toolchain.sh" }} + - run: + name: Install toolchain + command: ./util/install-toolchain.sh + - save_cache: + key: v1-toolchain-checksum-{{ checksum "util/install-toolchain.sh" }} + paths: + - "~/toolchains/" + - run: + name: Compile firmware + command: make -k all + environment: + PREFIX: "~/toolchains/gcc-arm-embedded/bin/arm-none-eabi" + - store_artifacts: + path: build/ diff --git a/circle.yml b/circle.yml deleted file mode 100644 index b5dab6c..0000000 --- a/circle.yml +++ /dev/null @@ -1,12 +0,0 @@ -dependencies: - override: - - ./util/install-toolchain.sh - cache_directories: - - "~/toolchains/" -test: - override: - - PREFIX="~/toolchains/gcc-arm-embedded/bin/arm-none-eabi" make -k all - -general: - artifacts: - - build/ \ No newline at end of file From 226df12b0ddf9aeaa6121fd7ef3e2c0a1519e57e Mon Sep 17 00:00:00 2001 From: Devan Lai Date: Tue, 27 Feb 2018 21:25:34 -0800 Subject: [PATCH 2/5] Update toolchain install script Output the toolchain source and current version --- util/install-toolchain.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/util/install-toolchain.sh b/util/install-toolchain.sh index 14b95e1..bdf7310 100755 --- a/util/install-toolchain.sh +++ b/util/install-toolchain.sh @@ -1,8 +1,17 @@ #!/bin/bash +set -eo pipefail URL=https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2 TOOLCHAIN=gcc-arm-none-eabi-5_2-2015q4 -if [[ ! -d "$HOME/toolchains/gcc-arm-embedded" ]]; then - mkdir -p ~/toolchains - wget -qO- $URL | tar xj -C ~/toolchains/ - ln -s $TOOLCHAIN ~/toolchains/gcc-arm-embedded +TOOLCHAINS=$HOME/toolchains +if [[ ! -d "${TOOLCHAINS}/gcc-arm-embedded" ]]; then + echo "Installing $TOOLCHAIN from $URL to ${TOOLCHAINS}" + mkdir -p ${TOOLCHAINS} + wget -qO- $URL | tar xj -C ${TOOLCHAINS} + ln -s $TOOLCHAIN ${TOOLCHAINS}/gcc-arm-embedded fi; + +EXISTING_TOOLCHAIN=`readlink -f "${TOOLCHAINS}/gcc-arm-embedded"` +echo "Current toolchain is $EXISTING_TOOLCHAIN" + +TOOLCHAIN_VER=`${TOOLCHAINS}/gcc-arm-embedded/bin/arm-none-eabi-gcc --version | head -n 1` +echo "Installed toolchain version is $TOOLCHAIN_VER" From af617c296d15f1be36b30dcaecef624734c0ca08 Mon Sep 17 00:00:00 2001 From: Devan Lai Date: Tue, 27 Feb 2018 21:36:47 -0800 Subject: [PATCH 3/5] Improve toolchain install script Cleanup broken toolchain directories --- util/install-toolchain.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/util/install-toolchain.sh b/util/install-toolchain.sh index bdf7310..ce8ee38 100755 --- a/util/install-toolchain.sh +++ b/util/install-toolchain.sh @@ -3,10 +3,20 @@ set -eo pipefail URL=https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2 TOOLCHAIN=gcc-arm-none-eabi-5_2-2015q4 TOOLCHAINS=$HOME/toolchains +TOOLCHAIN_MISSING=0 + if [[ ! -d "${TOOLCHAINS}/gcc-arm-embedded" ]]; then + TOOLCHAIN_MISSING=1 +fi; +if [[ ! -f "${TOOLCHAINS}/gcc-arm-embedded/bin/arm-none-eabi-gcc" ]]; then + TOOLCHAIN_MISSING=1 +fi; + +if [ $TOOLCHAIN_MISSING -eq 1 ]; then echo "Installing $TOOLCHAIN from $URL to ${TOOLCHAINS}" mkdir -p ${TOOLCHAINS} wget -qO- $URL | tar xj -C ${TOOLCHAINS} + rm -rf ${TOOLCHAINS}/gcc-arm-embedded ln -s $TOOLCHAIN ${TOOLCHAINS}/gcc-arm-embedded fi; From 0004da2ab91160229dddf03d8a3986700e98d28b Mon Sep 17 00:00:00 2001 From: Devan Lai Date: Tue, 27 Feb 2018 22:16:13 -0800 Subject: [PATCH 4/5] Test if the installed toolchain is executable --- util/install-toolchain.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/util/install-toolchain.sh b/util/install-toolchain.sh index ce8ee38..c1e8e45 100755 --- a/util/install-toolchain.sh +++ b/util/install-toolchain.sh @@ -4,11 +4,11 @@ URL=https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-arm TOOLCHAIN=gcc-arm-none-eabi-5_2-2015q4 TOOLCHAINS=$HOME/toolchains TOOLCHAIN_MISSING=0 - +GCC=${TOOLCHAINS}/gcc-arm-embedded/bin/arm-none-eabi-gcc if [[ ! -d "${TOOLCHAINS}/gcc-arm-embedded" ]]; then TOOLCHAIN_MISSING=1 fi; -if [[ ! -f "${TOOLCHAINS}/gcc-arm-embedded/bin/arm-none-eabi-gcc" ]]; then +if [[ ! -f ${GCC} ]]; then TOOLCHAIN_MISSING=1 fi; @@ -23,5 +23,10 @@ fi; EXISTING_TOOLCHAIN=`readlink -f "${TOOLCHAINS}/gcc-arm-embedded"` echo "Current toolchain is $EXISTING_TOOLCHAIN" -TOOLCHAIN_VER=`${TOOLCHAINS}/gcc-arm-embedded/bin/arm-none-eabi-gcc --version | head -n 1` +if ! ldd ${GCC} >/dev/null; then + echo "${GCC} does not appear to be executable on this machine" + exit 1 +fi; + +TOOLCHAIN_VER=`${GCC} --version | head -n 1` echo "Installed toolchain version is $TOOLCHAIN_VER" From d5532595d145e831fbd3c7c62c43516afd8821e3 Mon Sep 17 00:00:00 2001 From: Devan Lai Date: Tue, 27 Feb 2018 22:21:17 -0800 Subject: [PATCH 5/5] Bump CI toolchain version to gcc-arm-embedded 6.2 for prebuilt 64-bit support --- util/install-toolchain.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/install-toolchain.sh b/util/install-toolchain.sh index c1e8e45..95a6754 100755 --- a/util/install-toolchain.sh +++ b/util/install-toolchain.sh @@ -1,7 +1,7 @@ #!/bin/bash set -eo pipefail -URL=https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2 -TOOLCHAIN=gcc-arm-none-eabi-5_2-2015q4 +URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2016q4/gcc-arm-none-eabi-6_2-2016q4-20161216-linux.tar.bz2 +TOOLCHAIN=gcc-arm-none-eabi-6_2-2016q4 TOOLCHAINS=$HOME/toolchains TOOLCHAIN_MISSING=0 GCC=${TOOLCHAINS}/gcc-arm-embedded/bin/arm-none-eabi-gcc