Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ready for 3.7.1 #281

Merged
merged 14 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,6 @@ jobs:
run: |
cmake -B build -GNinja bridle/doc
ninja -C build build-all
#
# For some unknown reason, the layout of the Sphinx Tabs extension
# in the docset "devicetree" is no longer rendered properly by the
# HTML Builder of Sphinx v6. Only cleaning it up and rebuilding it
# helps so far.
#
ninja -C build devicetree-clean
ninja -C build devicetree-html

- name: Archive documentation
working-directory: workspace/build
Expand Down
25 changes: 15 additions & 10 deletions .github/workflows/qa-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
if: github.repository_owner == 'tiacsys'
runs-on: [self-hosted, ci-32g-x8, linux, x64, container]
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.26.13
image: ghcr.io/zephyrproject-rtos/ci:v0.26.18
options: '--cpus 4 --memory 8g --entrypoint /bin/bash'
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.8
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.9

steps:
- name: Apply container owner mismatch workaround
Expand Down Expand Up @@ -160,10 +160,10 @@ jobs:
if: github.repository_owner == 'tiacsys'
runs-on: [self-hosted, ci-32g-x8, linux, x64, container]
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.26.13
image: ghcr.io/zephyrproject-rtos/ci:v0.26.18
options: '--cpus 4 --memory 8g --entrypoint /bin/bash'
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.8
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.9

steps:
- name: Apply container owner mismatch workaround
Expand Down Expand Up @@ -279,10 +279,10 @@ jobs:
if: github.repository_owner == 'tiacsys'
runs-on: [self-hosted, ci-32g-x8, linux, x64, container]
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.26.13
image: ghcr.io/zephyrproject-rtos/ci:v0.26.18
options: '--cpus 4 --memory 8g --entrypoint /bin/bash'
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.8
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.9

steps:
- name: Apply container owner mismatch workaround
Expand Down Expand Up @@ -418,10 +418,6 @@ jobs:
# seems to be a stable workaround - happened in Oct. 2023.
git config --global --add http.version HTTP/1.1

- name: Update GitHub PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH

# It is important that this is run before any caching tasks as cleanups
# are run in reverse order (and you do not want to cleanup before the
# caching is saved).
Expand All @@ -445,9 +441,18 @@ jobs:
path: workspace/bridle
ref: ${{ github.ref }}

- name: Setup Pyhton 3.10 virtual environment
working-directory: workspace
run: |
python3.10 -m venv --clear --copies .env
source .env/bin/activate
echo "$PATH" > $GITHUB_PATH

- name: Install base dependencies
working-directory: workspace
run: |
which python3 && python3 --version
which pip3 && pip3 --version
pip3 install --upgrade pip
pip3 install --upgrade setuptools
pip3 install --upgrade --requirement bridle/scripts/requirements-base.txt
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_MAJOR = 3
VERSION_MINOR = 7
PATCHLEVEL = 0
PATCHLEVEL = 1
VERSION_TWEAK = 0
EXTRAVERSION =
127 changes: 35 additions & 92 deletions cmake/modules/bridle/toolchain.cmake
Original file line number Diff line number Diff line change
@@ -1,133 +1,76 @@
# Copyright (c) 2022 TiaC Systems
# Copyright (c) 2022-2024 TiaC Systems
# SPDX-License-Identifier: Apache-2.0

# The purpose of this file is to verify that required variables have been
# defined for proper toolchain use.
#
# It also offers the possibility to verify that the selected toolchain
# matches the required version range. Currently, only when using the
# Zephyr SDK the version is verified, but other other version verification
# Zephyr SDK the version is verified, but other version verification
# for other toolchains can be added as needed.
#
# This file can also be executed in script mode so that it can be used in
# other places, such as python scripts.
#
# When invoked as a script with -P:
# cmake [options] -P toolchain.cmake
#
# it takes the following arguments:
# -D FORMAT=json
# Print the output as a json formatted string, useful for Python.
# -D BRIDLE_TOOLCHAIN_ZEPHYR_SDK_VERSION=x.y.z
# Verify given Zephyr SDK version exactly.
# -D BRIDLE_TOOLCHAIN_ZEPHYR_SDK_REQUIRED_VERSION=x.y.z
# Verify given Zephyr SDK version as minimally required.

include_guard(GLOBAL)

include(extensions)

# This is the required Zephyr-SDK version for Bridle.
if((DEFINED BRIDLE_TOOLCHAIN_ZEPHYR_SDK_REQUIRED_VERSION) AND
(DEFINED BRIDLE_TOOLCHAIN_ZEPHYR_SDK_VERSION))
string(JOIN "..." BRIDLE_TOOLCHAIN_ZEPHYR_SDK_CONSIDERED_VERSIONS
"${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_REQUIRED_VERSION}"
"${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_VERSION}")
else()
set(error_msg "The considered Zephyr SDK version can not set.\n")
set(missing_version "Either 'BRIDLE_TOOLCHAIN_ZEPHYR_SDK_REQUIRED_VERSION' "
"or 'BRIDLE_TOOLCHAIN_ZEPHYR_SDK_VERSION' not defined!")
string(APPEND error_msg ${missing_version})
message(FATAL_ERROR "${error_msg}\n")
endif()

# Save default values for later restore.
set(CMAKE_CURRENT_MESSAGE_INDENT ${CMAKE_MESSAGE_INDENT})

# Set internal variables if set in environment.
zephyr_get(ZEPHYR_TOOLCHAIN_VARIANT)

zephyr_get(ZEPHYR_SDK_INSTALL_DIR)

if((NOT "zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) AND
(NOT ${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL NONE) AND
(DEFINED ZEPHYR_TOOLCHAIN_VARIANT))
message(STATUS "Bridle is trying to use Zephyr toolchain variant "
"'${ZEPHYR_TOOLCHAIN_VARIANT}' for compiling.")
return()
endif()

# This is the required Zephyr-SDK version for Bridle.
if(BRIDLE_TOOLCHAIN_ZEPHYR_SDK_VERSION)
if(${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_VERSION} STREQUAL
${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_REQUIRED_VERSION})
set(EXACT "EXACT")
else()
string(JOIN "..." BRIDLE_TOOLCHAIN_ZEPHYR_SDK_REQUIRED_VERSION
"${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_REQUIRED_VERSION}"
"${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_VERSION}")
endif()
endif()

# Verify Zephyr SDK Toolchain.
# There are three places where Zephyr SDK should be looked up:
# 1) Zephyr SDK specified as toolchain by environment == pass through to Zephyr
# 2) Required toolchain specified by file == search for package
# Until we completely deprecate it
if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
(NOT DEFINED ZEPHYR_TOOLCHAIN_VARIANT) OR
(DEFINED ZEPHYR_SDK_INSTALL_DIR) OR
(NOT ${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_REQUIRED_VERSION} STREQUAL NONE))
(NOT ${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_CONSIDERED_VERSIONS} STREQUAL NONE))

# No toolchain was specified, so inform user that we will be searching.
if ((NOT DEFINED ZEPHYR_SDK_INSTALL_DIR) AND
(NOT DEFINED ZEPHYR_TOOLCHAIN_VARIANT) AND
(NOT CMAKE_SCRIPT_MODE_FILE))
(NOT DEFINED ZEPHYR_TOOLCHAIN_VARIANT))
message(STATUS "Bridle is trying to locate Zephyr SDK "
"${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_REQUIRED_VERSION}.")
"${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_CONSIDERED_VERSIONS}.")
endif()

# This ensure packages are sorted in natural ascending order.
set(CMAKE_FIND_PACKAGE_SORT_DIRECTION_CURRENT ${CMAKE_FIND_PACKAGE_SORT_DIRECTION})
set(CMAKE_FIND_PACKAGE_SORT_ORDER_CURRENT ${CMAKE_FIND_PACKAGE_SORT_ORDER})
set(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)

find_package(Zephyr-sdk ${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_REQUIRED_VERSION}
${EXACT} REQUIRED QUIET CONFIG
HINTS ${ZEPHYR_SDK_INSTALL_DIR}
PATHS /usr
/usr/local
/opt
$ENV{HOME}
$ENV{HOME}/.local
$ENV{HOME}/.local/opt
$ENV{HOME}/bin)

set(CMAKE_FIND_PACKAGE_SORT_DIRECTION ${CMAKE_FIND_PACKAGE_SORT_DIRECTION_CURRENT})
set(CMAKE_FIND_PACKAGE_SORT_ORDER ${CMAKE_FIND_PACKAGE_SORT_ORDER_CURRENT})
list(APPEND CMAKE_MESSAGE_INDENT " [✓] ")
find_package(Zephyr-sdk ${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_CONSIDERED_VERSIONS} QUIET REQUIRED)

if((${Zephyr-sdk_FOUND}) AND
(DEFINED ZEPHYR_SDK_INSTALL_DIR) AND
(DEFINED ZEPHYR_TOOLCHAIN_VARIANT))
if(NOT CMAKE_SCRIPT_MODE_FILE)
message(STATUS "Using Zephyr SDK ${Zephyr-sdk_VERSION} "
"for compiling. (${Zephyr-sdk_DIR})")
endif()
(DEFINED ZEPHYR_TOOLCHAIN_VARIANT) AND
(${Zephyr-sdk_VERSION} VERSION_LESS_EQUAL ${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_VERSION}))
message(STATUS "Found toolchain: ${Zephyr-sdk_VERSION} (${Zephyr-sdk_DIR})")
set(Zephyr-sdk_ROOT ${Zephyr-sdk_DIR})
else()
set(error_msg "The required Zephyr SDK version was not found.\n")
set(missing_version "You need SDK version "
"${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_REQUIRED_VERSION} "
"or newer.")
"${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_VERSION}")
string(APPEND error_msg ${missing_version})
message(FATAL_ERROR
"${error_msg}\n"
"The Zephyr SDK can be downloaded from: "
"https://github.com/zephyrproject-rtos/sdk-ng/releases/download"
"/v${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_REQUIRED_VERSION}"
"/zephyr-sdk-${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_REQUIRED_VERSION}"
"-setup.run\n")
"https://github.com/zephyrproject-rtos/sdk-ng/releases/tag"
"/v${BRIDLE_TOOLCHAIN_ZEPHYR_SDK_VERSION}\n")
endif()
endif()

if(CMAKE_SCRIPT_MODE_FILE)
if("${FORMAT}" STREQUAL "json")
set(json "{\"ZEPHYR_TOOLCHAIN_VARIANT\" : \"${ZEPHYR_TOOLCHAIN_VARIANT}\", ")
string(APPEND json "\"SDK_VERSION\": \"${SDK_VERSION}\", ")
string(APPEND json "\"ZEPHYR_SDK_INSTALL_DIR\" : \"${ZEPHYR_SDK_INSTALL_DIR}\"}")
message("${json}")
else()
message(STATUS "ZEPHYR_TOOLCHAIN_VARIANT: ${ZEPHYR_TOOLCHAIN_VARIANT}")
if(DEFINED SDK_VERSION)
message(STATUS "SDK_VERSION: ${SDK_VERSION}")
endif()

if(DEFINED ZEPHYR_SDK_INSTALL_DIR)
message(STATUS "ZEPHYR_SDK_INSTALL_DIR : ${ZEPHYR_SDK_INSTALL_DIR}")
endif()
endif()
endif()
# Clean up temp variables
set(CMAKE_MESSAGE_INDENT ${CMAKE_CURRENT_MESSAGE_INDENT})
set(BRIDLE_TOOLCHAIN_ZEPHYR_SDK_CONSIDERED_VERSIONS)
set(missing_version)
set(error_msg)
Loading
Loading