Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Commit

Permalink
Travis and DTLS build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
darconeous committed Apr 4, 2017
1 parent cb0f86c commit ec4fc21
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 22 deletions.
22 changes: 17 additions & 5 deletions .travis.yml
@@ -1,5 +1,17 @@
language: c

addons:
apt:
packages:
- git
- bsdtar
- libtool
- automake
- autoconf
- autoconf-archive
- libreadline-dev
- libssl-dev

os:
- linux
- osx
Expand All @@ -23,21 +35,21 @@ after_success:
env:
- BUILD_MAKEARGS='distcheck' BUILD_PLATFORM='unix' BUILD_MAKEPATH='build'
- BUILD_MAKEARGS='check' BUILD_CONFIGFLAGS='--enable-embedded NYOCI_CONF_TRANS_ENABLE_BLOCK2=1 NYOCI_CONF_TRANS_ENABLE_OBSERVING=1' BUILD_PLATFORM='unix' BUILD_MAKEPATH='build'
- BUILD_MAKEARGS='check' BUILD_CONFIGFLAGS='--enable-dtls' BUILD_PLATFORM='unix' BUILD_MAKEPATH='build'
- BUILD_MAKEARGS='check' BUILD_CONFIGFLAGS='--enable-tls' BUILD_PLATFORM='unix' BUILD_MAKEPATH='build'

matrix:
exclude:
- os: osx
compiler: gcc
- os: osx
env: BUILD_MAKEARGS='check' BUILD_CONFIGFLAGS='--enable-dtls' BUILD_PLATFORM='unix' BUILD_MAKEPATH='build'
env: BUILD_MAKEARGS='check' BUILD_CONFIGFLAGS='--enable-tls' BUILD_PLATFORM='unix' BUILD_MAKEPATH='build'
include:
- os: linux
compiler: gcc
env: BUILD_PLATFORM='contiki' BUILD_MAKEPATH='contiki-src/examples/nyoci-plugtest' BUILD_MAKEARGS='TARGET=minimal-net CONTIKI=../../../contiki'
env: BUILD_PLATFORM='contiki' BUILD_MAKEPATH='contiki-src/examples/nyoci-plugtest' BUILD_MAKEARGS='TARGET=minimal-net CONTIKI=../../../contiki' SUPPORTED_CONTIKI_REF='1d69099'
- os: linux
compiler: gcc
env: BUILD_PLATFORM='contiki' BUILD_MAKEPATH='contiki-src/examples/nyoci-complex' BUILD_MAKEARGS='TARGET=native CONTIKI=../../../contiki'
env: BUILD_PLATFORM='contiki' BUILD_MAKEPATH='contiki-src/examples/nyoci-complex' BUILD_MAKEARGS='TARGET=native CONTIKI=../../../contiki' SUPPORTED_CONTIKI_REF='1d69099'
- os: linux
compiler: gcc
env: BUILD_PLATFORM='contiki' BUILD_MAKEPATH='contiki-src/examples/nyoci-simple' BUILD_MAKEARGS='TARGET=minimal-net CONTIKI=../../../contiki'
env: BUILD_PLATFORM='contiki' BUILD_MAKEPATH='contiki-src/examples/nyoci-simple' BUILD_MAKEARGS='TARGET=minimal-net CONTIKI=../../../contiki' SUPPORTED_CONTIKI_REF='1d69099'
20 changes: 12 additions & 8 deletions .travis/after_success.sh
Expand Up @@ -12,9 +12,7 @@ set -x
prep_ssh_key() {
openssl aes-256-cbc -K "${encrypted_0f1462f1026b_key}" -iv "${encrypted_0f1462f1026b_iv}" -in .travis/deploy.prv.enc -out .travis/deploy.prv -d &&
chmod 600 .travis/deploy.prv &&
ssh-add .travis/deploy.prv &&
git config --global user.name "Travis CI" &&
git config --global user.email "noreply@travis-ci.com"
ssh-add .travis/deploy.prv
}

AUTOCONF_BRANCH="autoconf/$TRAVIS_BRANCH"
Expand All @@ -25,9 +23,13 @@ if [ $TRAVIS_REPO_SLUG = "darconeous/libnyoci" ] \
&& [ $TRAVIS_PULL_REQUEST = "false" ] \
&& [ $BUILD_MAKEPATH = "build" ] \
&& [ $BUILD_MAKEARGS = "distcheck" ] \
&& prep_ssh_key #
&& true
then
git fetch --unshallow origin || die
git config --global user.name "Travis CI" || die
git config --global user.email "noreply@travis-ci.com" || die

# This will fail if this isn't a shallow checkout, so we ignore the return value.
git fetch --unshallow origin

git fetch origin scripts:scripts ${AUTOCONF_BRANCH}:${AUTOCONF_BRANCH} ${TRAVIS_BRANCH}:${TRAVIS_BRANCH} || die

Expand All @@ -37,17 +39,19 @@ then

git checkout scripts || die

NO_PUSH=1 ./update-autoconf-master ${TRAVIS_BRANCH} || die
./git-update-bootstrap-tags --no-push --no-pull --no-make-branches ${TRAVIS_BRANCH} || die

CHANGED_LINES=`git diff "${PREVREV}".."${AUTOCONF_BRANCH}" | grep '^[-+]' | grep -v '^[-+]SOURCE_VERSION=' | wc -l`
CHANGED_LINES=`git diff "${PREVREV}".."__AUTOCONF_HEAD" | grep '^[-+]' | grep -v '^[-+]SOURCE_VERSION=' | wc -l || echo 3`

if [ "$CHANGED_LINES" -gt "2" ]
then
echo "Branch '${AUTOCONF_BRANCH}' is OUT OF DATE."

git checkout "${TRAVIS_BRANCH}" || die

git push git@github.com:${TRAVIS_REPO_SLUG}.git ${AUTOCONF_BRANCH}:${AUTOCONF_BRANCH} || die
prep_ssh_key || die "prep_ssh_key failed"

git push "git@github.com:${TRAVIS_REPO_SLUG}.git" "__AUTOCONF_HEAD:${AUTOCONF_BRANCH}" || die "Unable to push"
else
echo "Branch '${AUTOCONF_BRANCH}' is still up-to-date."
fi
Expand Down
9 changes: 5 additions & 4 deletions .travis/before_install.sh
Expand Up @@ -6,10 +6,11 @@ die() {

set -x

[ $TRAVIS_OS_NAME != linux ] || {
sudo apt-get -y update || die
sudo apt-get -y install bsdtar autoconf-archive automake autoconf || die
}
# This should already be handled by the .travis.yml file.
#[ $TRAVIS_OS_NAME != linux ] || {
# sudo apt-get -y update || die
# sudo apt-get -y install bsdtar autoconf-archive automake autoconf || die
#}

[ $TRAVIS_OS_NAME != osx ] || {
brew install autoconf-archive || die
Expand Down
4 changes: 3 additions & 1 deletion .travis/before_script.sh
Expand Up @@ -7,11 +7,13 @@ die() {

set -x

SUPPORTED_CONTIKI_REF=${SUPPORTED_CONTIKI_REF-1d69099}

if [ $BUILD_PLATFORM = contiki ]
then
git clone git://github.com/contiki-os/contiki.git || die
cd contiki || die
git checkout 1d69099 || die
git checkout ${SUPPORTED_CONTIKI_REF} || die
cd .. || die
fi

Expand Down
2 changes: 1 addition & 1 deletion etc/build-in-docker.sh
Expand Up @@ -21,7 +21,7 @@ DIR="`dirname $0`"

"${DIR}"/run-in-docker.sh -i 'DIR="`pwd`" &&
mkdir -p /build &&
cd /build && "${DIR}"/configure --enable-dtls &&
cd /build && "${DIR}"/configure --enable-tls &&
make -j `nproc` check AM_DEFAULT_VERBOSITY=1
' || exit 1

Expand Down
1 change: 1 addition & 0 deletions src/libnyoci/libnyoci.h
Expand Up @@ -531,6 +531,7 @@ NYOCI_END_C_DECLS
#include "nyoci-plat-tls.h"
#endif

#include "nyoci-timer.h"
#include "nyoci-async.h"
#include "nyoci-transaction.h"
#include "nyoci-observable.h"
Expand Down
4 changes: 2 additions & 2 deletions src/libnyoci/nyoci-plat-tls-func.h
Expand Up @@ -26,8 +26,8 @@
** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef NYOCI_nyoci_plat_tls_h
#define NYOCI_nyoci_plat_tls_h
#ifndef NYOCI_nyoci_plat_tls_func_h
#define NYOCI_nyoci_plat_tls_func_h

#if !defined(NYOCI_INCLUDED_FROM_LIBNYOCI_H) && !defined(BUILDING_LIBNYOCI)
#error "Do not include this header directly, include <libnyoci/libnyoci.h> instead"
Expand Down
6 changes: 5 additions & 1 deletion src/plat-tls/openssl/nyoci-plat-tls.h
Expand Up @@ -29,8 +29,12 @@
#ifndef NYOCI_nyoci_plat_openssl_h
#define NYOCI_nyoci_plat_openssl_h

#include "libnyoci.h"
#if !defined(NYOCI_INCLUDED_FROM_LIBNYOCI_H) && !defined(BUILDING_LIBNYOCI)
#error "Do not include this header directly, include <libnyoci/libnyoci.h> instead"
#endif

#include "nyoci-plat-tls-func.h"
#include "nyoci-timer.h"
#include "btree.h"

#include <sys/types.h>
Expand Down

0 comments on commit ec4fc21

Please sign in to comment.