<?xml version="1.0" encoding="UTF-8"?><matrix-project>
  <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
    <runSequentially>false</runSequentially>
  </executionStrategy>
  <combinationFilter>ZEPHYR_TOOLCHAIN_VARIANT=="zephyr" || (ZEPHYR_TOOLCHAIN_VARIANT=="gnuarmemb" &amp;&amp; !(PLATFORM=="arduino_101" || PLATFORM=="qemu_x86"))</combinationFilter>
  <axes>
    <hudson.matrix.LabelAxis>
      <name>label</name>
      <values>
        <string>docker-xenial-amd64-13</string>
      </values>
    </hudson.matrix.LabelAxis>
    <hudson.matrix.TextAxis>
      <name>ZEPHYR_TOOLCHAIN_VARIANT</name>
      <values>
        <string>gnuarmemb</string>
        <string>zephyr</string>
      </values>
    </hudson.matrix.TextAxis>
    <hudson.matrix.TextAxis>
      <name>PLATFORM</name>
      <values>
        <string>cc3220sf_launchxl</string>
        <string>disco_l475_iot1</string>
        <string>frdm_k64f</string>
        <string>frdm_kw41z</string>
        <string>nucleo_f103rb</string>
        <string>nucleo_f401re</string>
        <string>qemu_cortex_m3</string>
      </values>
    </hudson.matrix.TextAxis>
  </axes>
  <actions/>
  <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
  <keepDependencies>false</keepDependencies>
  <disabled>false</disabled>
  <displayName>Zephyr project (arm)</displayName>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <concurrentBuild>false</concurrentBuild>
  <childCustomWorkspace>.</childCustomWorkspace>
  <assignedNode>master</assignedNode>
  <canRoam>false</canRoam>
  <properties>
    <hudson.security.AuthorizationMatrixProperty>
      <permission>hudson.model.Item.Read:anonymous</permission>
      <permission>hudson.model.Item.ExtendedRead:anonymous</permission>
      <permission>hudson.model.Item.Workspace:anonymous</permission>
      <permission>hudson.model.Item.Read:linaro</permission>
      <permission>hudson.model.Item.ExtendedRead:linaro</permission>
      <permission>hudson.model.Item.Build:linaro</permission>
      <permission>hudson.model.Item.Cancel:linaro</permission>
    </hudson.security.AuthorizationMatrixProperty>
    <jenkins.model.BuildDiscarderProperty>
      <strategy class="hudson.tasks.LogRotator">
        <daysToKeep>30</daysToKeep>
        <numToKeep>30</numToKeep>
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>30</artifactNumToKeep>
      </strategy>
    </jenkins.model.BuildDiscarderProperty>
    <hudson.plugins.throttleconcurrents.ThrottleJobProperty>
      <maxConcurrentPerNode>0</maxConcurrentPerNode>
      <maxConcurrentTotal>0</maxConcurrentTotal>
      <throttleEnabled>true</throttleEnabled>
      <categories>
        <string>lite-zephyr</string>
      </categories>
      <throttleOption>category</throttleOption>
      <configVersion>1</configVersion>
      <limitOneJobWithMatchingParams>false</limitOneJobWithMatchingParams>
      <matrixOptions>
        <throttleMatrixBuilds>false</throttleMatrixBuilds>
        <throttleMatrixConfigurations>true</throttleMatrixConfigurations>
      </matrixOptions>
      <paramsToUseForLimit/>
    </hudson.plugins.throttleconcurrents.ThrottleJobProperty>
    <hudson.model.ParametersDefinitionProperty>
      <parameterDefinitions>
        <hudson.model.StringParameterDefinition>
          <name>BRANCH</name>
          <description/>
          <defaultValue>arm</defaultValue>
        </hudson.model.StringParameterDefinition>
        <hudson.model.StringParameterDefinition>
          <name>LAVA_SERVER</name>
          <description/>
          <defaultValue>lite.validation.linaro.org/RPC2/</defaultValue>
        </hudson.model.StringParameterDefinition>
        <hudson.model.StringParameterDefinition>
          <name>QA_SERVER</name>
          <description/>
          <defaultValue>https://qa-reports.linaro.org</defaultValue>
        </hudson.model.StringParameterDefinition>
        <hudson.model.StringParameterDefinition>
          <name>GIT_COMMIT</name>
          <description/>
          <defaultValue>master</defaultValue>
        </hudson.model.StringParameterDefinition>
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
  </properties>
  <scm class="hudson.scm.NullSCM"/>
  <builders>
    <hudson.tasks.Shell>
      <command>#!/bin/bash

# Zephyr 2.2+ requires Python3.6. As it's not available in official distro
# packages for Ubuntu Xenial (16.04) which we use, install it from PPA.
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get -q=2 update
sudo apt-get install -y python3.6
sudo ln -sf python3.6 /usr/bin/python3

sudo apt-get -q=2 -y install git ninja-build g++ g++-multilib gperf python3-ply \
    python3-yaml gcc-arm-none-eabi python-requests rsync device-tree-compiler \
    python3-pip python3-serial python3-setuptools python3-wheel \
    python3-requests

set -ex

# pip as shipped by distro may be not up to date enough to support some
# quirky PyPI packages, specifically cmake was caught like that.
sudo pip3 install --upgrade pip

# Distro package is too old for Zephyr
sudo pip3 install pyelftools pykwalify
# Pre-installed CMake is too old for the latest Zephyr
# Recent recommendation to users is to install it via PyPI, let'd do the same
sudo pip3 install cmake
#cmake_version=3.9.5
#wget -q https://cmake.org/files/v3.9/cmake-${cmake_version}-Linux-x86_64.tar.gz
#tar xf cmake-${cmake_version}-Linux-x86_64.tar.gz
#cp -a cmake-${cmake_version}-Linux-x86_64/bin/* /usr/local/bin/
#cp -a cmake-${cmake_version}-Linux-x86_64/share/* /usr/local/share/
#rm -rf cmake-${cmake_version}-Linux-x86_64
#cmake -version

sudo pip3 install west
west --version

git clone -b ${BRANCH} https://github.com/zephyrproject-rtos/zephyr.git
west init -l zephyr/
west update

cd zephyr
git clean -fdx
if [ -n "${GIT_COMMIT}" ]; then
  git checkout ${GIT_COMMIT}
fi
echo "GIT_COMMIT_ID=$(git rev-parse --short=8 HEAD)" &gt; ${WORKSPACE}/env_var_parameters

head -5 Makefile

# Note that Zephyr SDK is needed even when building with the gnuarmemb
# toolchain, ZEPHYR_SDK_INSTALL_DIR is needed to find things like conf
ZEPHYR_SDK_URL="https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.11.1/zephyr-sdk-0.11.1-setup.run"
export ZEPHYR_SDK_INSTALL_DIR="${HOME}/srv/toolchain/zephyr-sdk-0.11.1"

# GNU ARM Embedded is downloaded once (per release) and cached in a persistent
# docker volume under ${HOME}/srv/toolchain/.
GNUARMEMB_TOOLCHAIN_URL="https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2"
export GNUARMEMB_TOOLCHAIN_PATH="${HOME}/srv/toolchain/gcc-arm-none-eabi-8-2019-q3-update"

install_zephyr_sdk()
{
    test -d ${ZEPHYR_SDK_INSTALL_DIR} &amp;&amp; return 0
    (
        flock -n 9 || echo "Toolchain upgrade in progress - transient failure"; exit 1
        wget -q "${ZEPHYR_SDK_URL}"
        chmod +x $(basename ${ZEPHYR_SDK_URL})
        ./$(basename ${ZEPHYR_SDK_URL}) --quiet --nox11 -- &lt;&lt;&lt; ${ZEPHYR_SDK_INSTALL_DIR}
    ) 9&gt;/var/lock/zsdk.lock
}

install_arm_toolchain()
{
    test -d ${GNUARMEMB_TOOLCHAIN_PATH} &amp;&amp; return 0
    wget -q "${GNUARMEMB_TOOLCHAIN_URL}"
    top=$(dirname ${GNUARMEMB_TOOLCHAIN_PATH})
    rm -rf ${top}/_tmp.$$
    mkdir -p ${top}/_tmp.$$
    tar -C ${top}/_tmp.$$ -xaf $(basename ${GNUARMEMB_TOOLCHAIN_URL})
    mv ${top}/_tmp.$$/$(basename ${GNUARMEMB_TOOLCHAIN_PATH}) ${top}
}

ls -l ${HOME}/srv/toolchain/
install_zephyr_sdk
install_arm_toolchain
find ${ZEPHYR_SDK_INSTALL_DIR}
${ZEPHYR_SDK_INSTALL_DIR}/sysroots/x86_64-pokysdk-linux/usr/bin/dtc --version

# Set build environment variables
export LANG=C.UTF-8
ZEPHYR_BASE=${WORKSPACE}/zephyr
PATH=${ZEPHYR_BASE}/scripts:${PATH}
OUTDIR=${HOME}/srv/zephyr/${BRANCH}/${ZEPHYR_TOOLCHAIN_VARIANT}/${PLATFORM}
export LANG ZEPHYR_BASE PATH
CCACHE_DIR="${HOME}/srv/ccache-zephyr/${BRANCH}"
CCACHE_UNIFY=1
CCACHE_SLOPPINESS=file_macro,include_file_mtime,time_macros
USE_CCACHE=1
export CCACHE_DIR CCACHE_UNIFY CCACHE_SLOPPINESS USE_CCACHE
env |grep '^ZEPHYR'
mkdir -p "${CCACHE_DIR}"
rm -rf ${OUTDIR}

echo ""
echo "########################################################################"
echo "    sanitycheck"
echo "########################################################################"

time ${ZEPHYR_BASE}/scripts/sanitycheck \
  --platform ${PLATFORM} \
  --inline-logs \
  --build-only \
  --outdir ${OUTDIR} \
  --enable-slow \
  -x=USE_CCACHE=${USE_CCACHE}

# Put sanitycheck report where rsync below will pick it up.
cp ${OUTDIR}/sanitycheck.csv ${OUTDIR}/${PLATFORM}/

cd ${ZEPHYR_BASE}
# OUTDIR is already per-platform, but it may get contaminated with unrelated
# builds e.g. due to bugs in sanitycheck script. It however stores builds in
# per-platform named subdirs under its --outdir (${OUTDIR} in our case), so
# we use ${OUTDIR}/${PLATFORM} paths below.
find ${OUTDIR}/${PLATFORM} -type f -name '.config' -exec rename 's/.config/zephyr.config/' {} +
rsync -avm \
  --include=zephyr.bin \
  --include=zephyr.config \
  --include=zephyr.elf \
  --include=sanitycheck.csv \
  --include='*/' \
  --exclude='*' \
  ${OUTDIR}/${PLATFORM} ${WORKSPACE}/out/
find ${OUTDIR}/${PLATFORM} -type f -name 'zephyr.config' -delete
# If there are support files, ship them.
BOARD_CONFIG=$(find "${ZEPHYR_BASE}/boards/" -type f -name "${PLATFORM}_defconfig")
BOARD_DIR=$(dirname ${BOARD_CONFIG})
test -d "${BOARD_DIR}/support" &amp;&amp; rsync -avm "${BOARD_DIR}/support" "${WORKSPACE}/out/${PLATFORM}"

cd ${WORKSPACE}/
echo "=== contents of ${WORKSPACE}/out/ ==="
find out
echo "=== end of contents of ${WORKSPACE}/out/ ==="

CCACHE_DIR=${CCACHE_DIR} ccache -M 30G
CCACHE_DIR=${CCACHE_DIR} ccache -s
</command>
    </hudson.tasks.Shell>
    <EnvInjectBuilder>
      <info>
        <propertiesFilePath>env_var_parameters</propertiesFilePath>
      </info>
    </EnvInjectBuilder>
    <org.jenkinsci.plugins.buildnameupdater.BuildNameUpdater>
      <buildName>version.txt</buildName>
      <macroTemplate>#${BUILD_NUMBER}-${GIT_COMMIT}</macroTemplate>
      <fromFile>false</fromFile>
      <fromMacro>true</fromMacro>
      <macroFirst>false</macroFirst>
    </org.jenkinsci.plugins.buildnameupdater.BuildNameUpdater>
    <linaro.pubapi.LinaroPubAPIKey>
      <credentialsId>snapshots.linaro.org</credentialsId>
    </linaro.pubapi.LinaroPubAPIKey>
    <hudson.tasks.Shell>
      <command>#!/bin/bash

# Publish
test -d ${HOME}/bin || mkdir ${HOME}/bin
wget -q https://git.linaro.org/ci/publishing-api.git/blob_plain/HEAD:/linaro-cp.py -O ${HOME}/bin/linaro-cp.py
time python3 ${HOME}/bin/linaro-cp.py \
  --api_version 3 \
  --link-latest \
  out/${PLATFORM} components/kernel/zephyr/${BRANCH}/${ZEPHYR_TOOLCHAIN_VARIANT}/${PLATFORM}/${BUILD_NUMBER}
</command>
    </hudson.tasks.Shell>
    <hudson.tasks.Shell>
      <command>#!/bin/bash -ex

case "${PLATFORM}" in
  frdm_k64f)
    export DEVICE_TYPE=frdm-k64f
    ;;
  frdm_kw41z)
    export DEVICE_TYPE=frdm-kw41z
    ;;
  disco_l475_iot1)
    export DEVICE_TYPE=disco-l475-iot1
    ;;
  qemu_cortex_m3)
    export DEVICE_TYPE=qemu
    ;;
  *)
    echo "Skip DEVICE_TYPE for ${PLATFORM}"
    ;;
esac

rm -rf configs
git clone --depth 1 http://git.linaro.org/ci/job/configs.git

[ "${GIT_COMMIT}" = "master" ] &amp;&amp; unset DEVICE_TYPE
[ -z "${DEVICE_TYPE}" ] || \
python configs/zephyr-upstream/submit_for_testing.py \
    --board-name ${PLATFORM} \
    --device-type ${DEVICE_TYPE} \
    --build-number ${BUILD_NUMBER} \
    --build-url ${BUILD_URL} \
    --branch-name ${BRANCH} \
    --lava-server ${LAVA_SERVER} \
    --qa-server ${QA_SERVER} \
    --qa-server-team lite \
    --qa-server-project zephyr-upstream-arm \
    --gcc-variant ${ZEPHYR_TOOLCHAIN_VARIANT} \
    --git-commit ${GIT_COMMIT}
</command>
    </hudson.tasks.Shell>
  </builders>
  <publishers>
    <hudson.tasks.ArtifactArchiver>
      <artifacts>scripts/sanity_chk/last_sanity.csv</artifacts>
      <allowEmptyArchive>false</allowEmptyArchive>
      <onlyIfSuccessful>false</onlyIfSuccessful>
      <fingerprint>false</fingerprint>
      <defaultExcludes>true</defaultExcludes>
      <caseSensitive>true</caseSensitive>
      <latestOnly>false</latestOnly>
    </hudson.tasks.ArtifactArchiver>
    <hudson.tasks.Mailer plugin="mailer">
      <recipients>fathi.boudra@linaro.org kumar.gala@linaro.org gpitney@ti.com vincent.wan@linaro.org</recipients>
      <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
      <sendToIndividuals>false</sendToIndividuals>
    </hudson.tasks.Mailer>
  </publishers>
  <buildWrappers>
    <hudson.plugins.timestamper.TimestamperBuildWrapper/>
    <org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper>
      <bindings>
        <org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
          <variable>LAVA_USER</variable>
          <credentialsId>LAVA_USER</credentialsId>
        </org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
        <org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
          <variable>LAVA_TOKEN</variable>
          <credentialsId>LAVA_TOKEN</credentialsId>
        </org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
        <org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
          <variable>QA_REPORTS_TOKEN</variable>
          <credentialsId>QA_REPORTS_TOKEN</credentialsId>
        </org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
      </bindings>
    </org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper>
  </buildWrappers>
</matrix-project>