-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Zephyr Build info file #79118
Merged
+269
−25
Merged
Zephyr Build info file #79118
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2204dca
cmake: define ZEPHYR_TOOLCHAIN_PATH
tejlmand ffa017e
cmake: move script mode handling from package helper to extensions.cmake
tejlmand 3510046
cmake: introduce build_info function
tejlmand 9fc81f9
west: support build info file for west build
tejlmand 47c5b7f
cmake: support build info in Zephyr
tejlmand 93866cb
cmake: nordic: save build information regarding SVD file used.
tejlmand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Copyright (c) 2024, Nordic Semiconductor ASA | ||
|
||
# A pykwalify schema for basic validation of the Zephyr build info YAML file. | ||
|
||
type: map | ||
mapping: | ||
version: | ||
required: true | ||
type: str | ||
cmake: | ||
type: map | ||
mapping: | ||
application: | ||
type: map | ||
mapping: | ||
source-dir: | ||
type: str | ||
configuration-dir: | ||
type: str | ||
board: | ||
type: map | ||
mapping: | ||
name: | ||
required: true | ||
type: str | ||
qualifiers: | ||
type: str | ||
revision: | ||
type: str | ||
path: | ||
type: seq | ||
sequence: | ||
- type: str | ||
devicetree: | ||
type: map | ||
mapping: | ||
files: | ||
type: seq | ||
sequence: | ||
- type: str | ||
user-files: | ||
type: seq | ||
sequence: | ||
- type: str | ||
extra-user-files: | ||
type: seq | ||
sequence: | ||
- type: str | ||
include-dirs: | ||
type: seq | ||
sequence: | ||
- type: str | ||
bindings-dirs: | ||
type: seq | ||
sequence: | ||
- type: str | ||
kconfig: | ||
type: map | ||
mapping: | ||
files: | ||
type: seq | ||
sequence: | ||
- type: str | ||
user-files: | ||
type: seq | ||
sequence: | ||
- type: str | ||
extra-user-files: | ||
type: seq | ||
sequence: | ||
- type: str | ||
sysbuild: | ||
type: bool | ||
toolchain: | ||
type: map | ||
mapping: | ||
name: | ||
type: str | ||
version: | ||
type: str | ||
path: | ||
type: str | ||
zephyr: | ||
type: map | ||
mapping: | ||
zephyr-base: | ||
type: str | ||
version: | ||
type: str | ||
vendor-specific: | ||
type: map | ||
mapping: | ||
regex;(.*): | ||
type: map | ||
mapping: | ||
regex;(.*): | ||
type: str | ||
west: | ||
type: map | ||
mapping: | ||
command: | ||
type: str | ||
topdir: | ||
type: str | ||
version: | ||
type: str |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Causing old compilation errors as ???_TOOLCHAIN_PATH is invalid.
I changed it to:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @WilliamGFish, could you open a pull request with the fix? This is the contribution guideline documentation. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, found out its a Linux / Windows path issue.
I'll raise a 'fix' via a PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple of comments regarding this, first related to the issue itself.
Please note that a CMake path officially is with forward slashes
/
, and that windows path separator in principle should be escaped.This info seems to be a bit hidden in various places of the docs, like here:
https://cmake.org/cmake/help/latest/command/cmake_path.html#modification
or in CMake questions:
https://discourse.cmake.org/t/window-env-variable-and-cmake-path/5410
So the use of a single back-slash in general with CMake is not guaranteed to work.
That said, it seems like the
find_program()
supports the use of single\
. The<toolchain>_TOOLCHAIN_PATH
is generally used together withfind_program()
and therefore working with single\
.Other CMake settings / paths may not work with single
\
separator.Regarding the
build_info()
/ yaml feature, which uses CMake's json support under the hood, then path should of course be properly sanitized in case they contain single\
.Note that
TOOLCHAIN_ROOT
!=<toolchain>_TOOLCHAIN_PATH
.One is the toolchain itself, the other points to the location of the toolchain CMake integration code.
Those two variables points to very different things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed here: #79647
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right they are two different things just needed stop compile failures. I have addressed this by replacing the \ with / in the CMake script like this:
As on windows machines they will continue to use backslashes in config files the will need to be replaced.