From 42421825884b5aaa52fbe1331b23bacaaaf347ee Mon Sep 17 00:00:00 2001 From: Jim Paris Date: Sat, 5 Jul 2014 15:08:54 -0400 Subject: [PATCH 1/3] Clean up script commands in .travis.yml. Besides general whitespace and quoting cleanup, commands that test variables were changed from: [ $B = a ] && command || true to if [ $B = a ] ; then command ; fi This form correctly returns the exit code of "command". --- .travis.yml | 76 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index edd360a42..c939aafda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,41 +2,65 @@ notifications: email: false language: c #NOTE: this will set CC=gcc which might cause trouble before_script: - - "sudo apt-get -qq update" - ## Install these mainline toolchains for all build types - - "sudo apt-get -qq install lib32z1 || true" - - "curl -s \ - http://adamdunkels.github.io/contiki-fork/mspgcc-4.7.0-compiled.tar.bz2 \ - | tar xjf - -C /tmp/ && sudo cp -f -r /tmp/msp430/* /usr/local/ && rm -rf /tmp/msp430 && msp430-gcc --version || true" - - "sudo apt-get -qq install gcc-avr avr-libc || true" - - "sudo apt-get -qq install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 || true" + - sudo apt-get -qq update + + ## Install msp430 toolchain + - sudo apt-get -qq install lib32z1 + - curl -s + http://adamdunkels.github.io/contiki-fork/mspgcc-4.7.0-compiled.tar.bz2 + | tar xjf - -C /tmp/ && + sudo cp -f -r /tmp/msp430/* /usr/local/ && + rm -rf /tmp/msp430 && + msp430-gcc --version + + ## Install avr toolchain + - sudo apt-get -qq install gcc-avr avr-libc + + ## Install 32-bit compatibility libraries + - sudo apt-get -qq install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 + libstdc++5:i386 libstdc++6:i386 ## Install toolchain for mc1233x, cc2538 and mbxxx in care-free way - - "[ ${BUILD_ARCH:-0} = arm ] && curl -s \ - https://raw.githubusercontent.com/wiki/malvira/libmc1322x/files/arm-2008q3-66-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 \ - | tar xjf - -C /tmp/ && sudo cp -f -r /tmp/arm-2008q3/* /usr/ && rm -rf /tmp/arm-2008q3 && arm-none-eabi-gcc --version || true" + - if [ ${BUILD_ARCH:-0} = arm ] ; then + curl -s + https://raw.githubusercontent.com/wiki/malvira/libmc1322x/files/arm-2008q3-66-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 + | tar xjf - -C /tmp/ && + sudo cp -f -r /tmp/arm-2008q3/* /usr/ && + rm -rf /tmp/arm-2008q3 && + arm-none-eabi-gcc --version ; + fi - ## Install RL78 GCC chain (following the instructions in platform/eval-adf7xxxmb4z/README.md) - - "sudo apt-get install libncurses5:i386 zlib1g:i386 || true" - - "wget http://adamdunkels.github.io/contiki-fork/gnurl78-v13.02-elf_1-2_i386.deb && sudo dpkg -i gnurl78*.deb || true" + ## Install RL78 GCC toolchain + - sudo apt-get install libncurses5:i386 zlib1g:i386 + - wget http://adamdunkels.github.io/contiki-fork/gnurl78-v13.02-elf_1-2_i386.deb && + sudo dpkg -i gnurl78*.deb ## Install SDCC from a purpose-built bundle - - "[ ${BUILD_ARCH:-0} = 8051 ] && curl -s \ - https://raw.githubusercontent.com/wiki/g-oikonomou/contiki-sensinode/files/sdcc.tar.gz \ - | tar xzf - -C /tmp/ && sudo cp -f -r /tmp/sdcc/* /usr/local/ && rm -rf /tmp/sdcc && sdcc --version || true" - - "[ ${BUILD_ARCH:-0} = 8051 ] && sudo apt-get -qq install srecord || true" + - if [ ${BUILD_ARCH:-0} = 8051 ] ; then + curl -s + https://raw.githubusercontent.com/wiki/g-oikonomou/contiki-sensinode/files/sdcc.tar.gz + | tar xzf - -C /tmp/ && + sudo cp -f -r /tmp/sdcc/* /usr/local/ && + rm -rf /tmp/sdcc && + sdcc --version && + sudo apt-get -qq install srecord ; + fi ## Clone and build cc65 when testing 6502 ports - - "[ ${BUILD_ARCH:-0} = 6502 ] && git clone \ - https://github.com/cc65/cc65 /tmp/cc65 && \ - make -C /tmp/cc65 bin apple2enh atarixl c64 c128 && sudo make -C /tmp/cc65 avail && \ - export CC65_HOME=/tmp/cc65/ && cc65 --version || true" + - if [ ${BUILD_ARCH:-0} = 6502 ] ; then + git clone https://github.com/cc65/cc65 /tmp/cc65 && + make -C /tmp/cc65 bin apple2enh atarixl c64 c128 && + sudo make -C /tmp/cc65 avail && + export CC65_HOME=/tmp/cc65/ && + cc65 --version ; + fi ## Compile cooja.jar only when it's going to be needed - - "[ ${BUILD_CATEGORY:-sim} = sim ] && java -version && ant -q -f tools/cooja/build.xml jar && sudo java -Xshare:dump -version || true" - - ## IMPORTANT: The commands here have to end with `|| true`, - ## because it would make the test fail if BUILD_TYPE test fails + - if [ ${BUILD_CATEGORY:-sim} = sim ] ; then + java -version && + ant -q -f tools/cooja/build.xml jar && + sudo java -Xshare:dump -version ; + fi script: ## regression-tests/Makefile handles most of generic logic From 6d7464a42271123b70b688e53035c5056b9f6e20 Mon Sep 17 00:00:00 2001 From: Jim Paris Date: Sat, 5 Jul 2014 15:18:00 -0400 Subject: [PATCH 2/3] Add retries to commands that download from external servers. This helps reduce the chance of a build failure due to transient download error. This also switches to consistent use of wget throughout, which reports download errors more cleanly in the travis build logs. --- .travis.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index c939aafda..c11cea9fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,16 +2,16 @@ notifications: email: false language: c #NOTE: this will set CC=gcc which might cause trouble before_script: + - WGET="travis_retry wget --continue --tries=20 --waitretry=10 --retry-connrefused --no-dns-cache --timeout 300" - sudo apt-get -qq update ## Install msp430 toolchain - sudo apt-get -qq install lib32z1 - - curl -s - http://adamdunkels.github.io/contiki-fork/mspgcc-4.7.0-compiled.tar.bz2 - | tar xjf - -C /tmp/ && - sudo cp -f -r /tmp/msp430/* /usr/local/ && - rm -rf /tmp/msp430 && - msp430-gcc --version + - $WGET http://adamdunkels.github.io/contiki-fork/mspgcc-4.7.0-compiled.tar.bz2 && + tar xjf mspgcc*.tar.bz2 -C /tmp/ && + sudo cp -f -r /tmp/msp430/* /usr/local/ && + rm -rf /tmp/msp430 mspgcc*.tar.bz2 && + msp430-gcc --version ## Install avr toolchain - sudo apt-get -qq install gcc-avr avr-libc @@ -22,26 +22,24 @@ before_script: ## Install toolchain for mc1233x, cc2538 and mbxxx in care-free way - if [ ${BUILD_ARCH:-0} = arm ] ; then - curl -s - https://raw.githubusercontent.com/wiki/malvira/libmc1322x/files/arm-2008q3-66-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 - | tar xjf - -C /tmp/ && + $WGET https://raw.githubusercontent.com/wiki/malvira/libmc1322x/files/arm-2008q3-66-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 && + tar xjf arm-2008q3*.tar.bz2 -C /tmp/ && sudo cp -f -r /tmp/arm-2008q3/* /usr/ && - rm -rf /tmp/arm-2008q3 && + rm -rf /tmp/arm-2008q3 arm-2008q3*.tar.bz2 && arm-none-eabi-gcc --version ; fi ## Install RL78 GCC toolchain - sudo apt-get install libncurses5:i386 zlib1g:i386 - - wget http://adamdunkels.github.io/contiki-fork/gnurl78-v13.02-elf_1-2_i386.deb && - sudo dpkg -i gnurl78*.deb + - $WGET http://adamdunkels.github.io/contiki-fork/gnurl78-v13.02-elf_1-2_i386.deb && + sudo dpkg -i gnurl78*.deb ## Install SDCC from a purpose-built bundle - if [ ${BUILD_ARCH:-0} = 8051 ] ; then - curl -s - https://raw.githubusercontent.com/wiki/g-oikonomou/contiki-sensinode/files/sdcc.tar.gz - | tar xzf - -C /tmp/ && + $WGET https://raw.githubusercontent.com/wiki/g-oikonomou/contiki-sensinode/files/sdcc.tar.gz && + tar xzf sdcc.tar.gz -C /tmp/ && sudo cp -f -r /tmp/sdcc/* /usr/local/ && - rm -rf /tmp/sdcc && + rm -rf /tmp/sdcc sdcc.tar.gz && sdcc --version && sudo apt-get -qq install srecord ; fi From b5f37e856cd2523a342f17fa2b9873b1f7f62e2e Mon Sep 17 00:00:00 2001 From: Jim Paris Date: Sat, 5 Jul 2014 21:40:01 -0400 Subject: [PATCH 3/3] Rename travis "arm" BUILD_ARCH to "arm-apcs". These platforms are built with an old ARM compiler that supports the deprecated APCS standard. --- .travis.yml | 6 +++--- .../Makefile | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename regression-tests/{15-compile-arm-ports => 15-compile-arm-apcs-ports}/Makefile (100%) diff --git a/.travis.yml b/.travis.yml index c11cea9fb..f50de9382 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,8 @@ before_script: - sudo apt-get -qq install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 - ## Install toolchain for mc1233x, cc2538 and mbxxx in care-free way - - if [ ${BUILD_ARCH:-0} = arm ] ; then + ## Install old APCS ARM toolchain for mc1233x, cc2538 and mbxxx + - if [ ${BUILD_ARCH:-0} = arm-apcs ] ; then $WGET https://raw.githubusercontent.com/wiki/malvira/libmc1322x/files/arm-2008q3-66-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 && tar xjf arm-2008q3*.tar.bz2 -C /tmp/ && sudo cp -f -r /tmp/arm-2008q3/* /usr/ && @@ -93,6 +93,6 @@ env: # - BUILD_TYPE='ipv4' - BUILD_TYPE='ipv6-apps' - BUILD_TYPE='compile-8051-ports' BUILD_CATEGORY='compile' BUILD_ARCH='8051' - - BUILD_TYPE='compile-arm-ports' BUILD_CATEGORY='compile' BUILD_ARCH='arm' + - BUILD_TYPE='compile-arm-apcs-ports' BUILD_CATEGORY='compile' BUILD_ARCH='arm-apcs' - BUILD_TYPE='compile-6502-ports' BUILD_CATEGORY='compile' BUILD_ARCH='6502' - BUILD_TYPE='slip-radio' MAKE_TARGETS='cooja' diff --git a/regression-tests/15-compile-arm-ports/Makefile b/regression-tests/15-compile-arm-apcs-ports/Makefile similarity index 100% rename from regression-tests/15-compile-arm-ports/Makefile rename to regression-tests/15-compile-arm-apcs-ports/Makefile