Skip to content

Commit c6ba801

Browse files
authored
Merge branch 'main' into arduino-library-support
2 parents dfe3c83 + 218cc45 commit c6ba801

776 files changed

Lines changed: 60872 additions & 11604 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/docker/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ esac
102102
TORCH_VERSION=$(cat ci_commit_pins/pytorch.txt)
103103
BUILD_DOCS=1
104104

105-
if [[ "${GCC_VERSION:-}" == "11" && -z "${SKIP_PYTORCH:-}" ]]; then
105+
if [[ -n "${GCC_VERSION:-}" && -z "${SKIP_PYTORCH:-}" ]]; then
106106
PYTORCH_BUILD_MAX_JOBS=6
107107
fi
108108

.ci/docker/common/install_zephyr.sh

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#!/bin/bash
32
# Copyright (c) Meta Platforms, Inc. and affiliates.
43
# All rights reserved.
@@ -9,27 +8,27 @@
98

109
set -ex
1110

11+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12+
1213
# shellcheck source=/dev/null
13-
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
14+
source "${SCRIPT_DIR}/utils.sh"
1415

15-
# Double check if the NDK version is set
16+
# Double check if Zephyr setup is enabled.
1617
[ -n "${ZEPHYR_SDK}" ]
1718

18-
install_prerequiresites() {
19+
install_prerequisites() {
1920
rm /var/lib/dpkg/info/libc-bin.*
2021
apt-get clean
2122
apt-get -y update
2223
apt-get install -y libc-bin
2324
apt-get -y update
2425
apt-get clean
25-
apt-get install --no-install-recommends -y dos2unix
2626
apt-get install --no-install-recommends -y ca-certificates
2727
apt-get install -y --reinstall libc-bin
2828
apt-get install --no-install-recommends -y file
2929
apt-get install --no-install-recommends -y locales
3030
apt-get install --no-install-recommends -y git
3131
apt-get install --no-install-recommends -y build-essential
32-
apt-get install --no-install-recommends -y cmake
3332
apt-get install --no-install-recommends -y ninja-build gperf
3433
apt-get install --no-install-recommends -y device-tree-compiler
3534
apt-get install --no-install-recommends -y wget
@@ -49,16 +48,14 @@ install_prerequiresites() {
4948
apt install -y python3.12 python3.12-dev python3.12-venv python3-pip
5049
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
5150

52-
# Upgrade cmake ot 3.24
53-
apt update
54-
apt install cmake
55-
apt install software-properties-common lsb-release
51+
# Upgrade cmake to 3.24 or newer.
52+
apt install -y software-properties-common lsb-release
5653
apt update
5754
test -f /usr/share/doc/kitware-archive-keyring/copyright || \
5855
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
59-
"deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/kitware.list > /dev/null
56+
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/kitware.list > /dev/null
6057
apt update
61-
apt install cmake
58+
apt install -y cmake
6259

6360
# Install additional required software for Zephyr
6461
apt install --no-install-recommends -y ccache \
@@ -77,19 +74,19 @@ install_prerequiresites() {
7774
apt-get clean -y
7875
apt-get autoremove --purge -y
7976
rm -rf /var/lib/apt/lists/*
80-
wget https://apt.kitware.com/kitware-archive.sh && \
81-
chmod +x kitware-archive.sh && \
82-
./kitware-archive.sh && \
83-
rm -f kitware-archive.sh
8477
pip_install --no-cache-dir west
8578
pip_install pyelftools
8679

87-
# Zephyr SDK
88-
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.4/zephyr-sdk-0.17.4_linux-x86_64.tar.xz
89-
tar -xf zephyr-sdk-0.17.4_linux-x86_64.tar.xz
90-
rm -f zephyr-sdk-0.17.4_linux-x86_64.tar.xz*
91-
# Save setup to later and this get symlinked in to another folder in the test in trunk.yml
92-
#./zephyr-sdk-0.17.4/setup.sh -c -t arm-zephyr-eabi
80+
# Cache the Zephyr SDK release assets in the image. CI still runs
81+
# `west sdk install` in its workspace, but the local proxy fallback can serve
82+
# these files without downloading them on every job.
83+
local zephyr_sdk_version
84+
zephyr_sdk_version="$(python3 "${SCRIPT_DIR}/zephyr_sdk_release_proxy.py" --print-version)"
85+
local zephyr_sdk_cache_dir="${ZEPHYR_SDK_RELEASE_PROXY_CACHE_DIR:-/opt/zephyr-sdk-cache/v${zephyr_sdk_version}}"
86+
python3 "${SCRIPT_DIR}/zephyr_sdk_release_proxy.py" \
87+
--version "${zephyr_sdk_version}" \
88+
--cache-dir "${zephyr_sdk_cache_dir}" \
89+
--populate-cache
9390
}
9491

95-
install_prerequiresites
92+
install_prerequisites

0 commit comments

Comments
 (0)