-
Notifications
You must be signed in to change notification settings - Fork 366
[SKIP CI] Use west manifest in SOF #6005
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
Changes from all commits
cae62af
9c1ae3e
ea169a2
a85bdd1
78964de
6e34ff5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,12 +17,15 @@ | |||||||
| import warnings | ||||||||
| # anytree module is defined in Zephyr build requirements | ||||||||
| from anytree import AnyNode, RenderTree | ||||||||
| from packaging import version | ||||||||
|
|
||||||||
| # Version of this script matching Major.Minor.Patch style. | ||||||||
| VERSION = version.Version("2.0.0") | ||||||||
|
|
||||||||
| # Constant value resolves SOF_TOP directory as: "this script directory/.." | ||||||||
| SOF_TOP = pathlib.Path(__file__).parents[1].resolve() | ||||||||
| # Default value may be overriten by -p arg | ||||||||
| west_top = pathlib.Path(SOF_TOP, "zephyrproject") | ||||||||
| default_rimage_key = pathlib.Path("modules", "audio", "sof", "keys", "otc_private_key.pem") | ||||||||
| west_top = pathlib.Path(SOF_TOP, "..").resolve() | ||||||||
| default_rimage_key = pathlib.Path(SOF_TOP, "keys", "otc_private_key.pem") | ||||||||
|
|
||||||||
| sof_version = None | ||||||||
|
|
||||||||
|
|
@@ -67,7 +70,7 @@ | |||||||
| "IPC4_RIMAGE_DESC": "tgl-cavs.toml", | ||||||||
| "XTENSA_CORE": "cavs2x_LX6HiFi3_2017_8", | ||||||||
| "XTENSA_TOOLS_VERSION": f"RG-2017.8{xtensa_tools_version_postfix}", | ||||||||
| "RIMAGE_KEY": pathlib.Path("modules", "audio", "sof", "keys", "otc_private_key_3k.pem") | ||||||||
| "RIMAGE_KEY": pathlib.Path(SOF_TOP, "keys", "otc_private_key_3k.pem") | ||||||||
| }, | ||||||||
| { | ||||||||
| "name": "tgl-h", | ||||||||
|
|
@@ -76,7 +79,7 @@ | |||||||
| "IPC4_RIMAGE_DESC": "tgl-h-cavs.toml", | ||||||||
| "XTENSA_CORE": "cavs2x_LX6HiFi3_2017_8", | ||||||||
| "XTENSA_TOOLS_VERSION": f"RG-2017.8{xtensa_tools_version_postfix}", | ||||||||
| "RIMAGE_KEY": pathlib.Path("modules", "audio", "sof", "keys", "otc_private_key_3k.pem") | ||||||||
| "RIMAGE_KEY": pathlib.Path(SOF_TOP, "keys", "otc_private_key_3k.pem") | ||||||||
| }, | ||||||||
| # NXP platforms | ||||||||
| { | ||||||||
|
|
@@ -173,34 +176,13 @@ def parse_args(): | |||||||
| help="Path to a non-default rimage signing key.") | ||||||||
| parser.add_argument("-o", "--overlay", type=pathlib.Path, required=False, action='append', | ||||||||
| default=[], help="Paths to overlays") | ||||||||
| parser.add_argument("-z", "--zephyr-ref", required=False, | ||||||||
| help="Initial Zephyr git ref for the -c option." | ||||||||
| " Can be a branch, tag, full SHA1 in a fork") | ||||||||
| parser.add_argument("-u", "--url", required=False, | ||||||||
| default="https://github.com/zephyrproject-rtos/zephyr/", | ||||||||
| help="URL to clone Zephyr from") | ||||||||
| mode_group = parser.add_mutually_exclusive_group() | ||||||||
| mode_group.add_argument("-p", "--west_path", required=False, type=pathlib.Path, | ||||||||
| help="""Points to existing Zephyr project directory. Incompatible with -c. | ||||||||
| Uses by default path used by -c mode: SOF_TOP/zephyrproject. | ||||||||
| If zephyr-project/modules/audio/sof is missing then a | ||||||||
| symbolic link pointing to SOF_TOP directory will automatically be | ||||||||
| created and west will recognize it as its new sof module. | ||||||||
| If zephyr-project/modules/audio/sof already exists and is a | ||||||||
| different copy than where this script is run from, then the | ||||||||
| behavior is undefined. | ||||||||
| This -p option is always required_if the real (not symbolic) | ||||||||
| sof/ and zephyr-project/ directories are not nested in one | ||||||||
| another.""", | ||||||||
| ) | ||||||||
| mode_group.add_argument("-c", "--clone_mode", required=False, action="store_true", | ||||||||
| help="""Using west, downloads inside this sof clone a new Zephyr | ||||||||
| project with the required git repos. Creates a | ||||||||
| sof/zephyrproject/modules/audio/sof symbolic link pointing | ||||||||
| back at this sof clone. | ||||||||
| Incompatible with -p. To stop after downloading Zephyr, do not | ||||||||
| pass any platform or cmake argument.""", | ||||||||
| ) | ||||||||
| parser.add_argument("-p", "--pristine", required=False, action="store_true", | ||||||||
| help="Perform pristine build removing build directory.") | ||||||||
| parser.add_argument("-u", "--update", required=False, action="store_true", | ||||||||
| help="""Runs west update command - clones SOF dependencies. Downloads next to this sof clone a new Zephyr | ||||||||
| project with its required dependencies. Creates a modules/audio/sof symbolic link pointing | ||||||||
| back at this sof clone. All projects are checkout out to | ||||||||
| revision defined in manifests of SOF and Zephyr.""") | ||||||||
| parser.add_argument('-v', '--verbose', default=0, action='count', | ||||||||
| help="""Verbosity level. Repetition of the flag increases verbosity. | ||||||||
| The same number of '-v' is passed to "west". | ||||||||
|
|
@@ -228,6 +210,13 @@ def parse_args(): | |||||||
| help="""Use an output subdirectory for each platform. | ||||||||
| Otherwise, all firmware files are installed in the same staging directory by default.""") | ||||||||
|
|
||||||||
| parser.add_argument("--no-interactive", default=False, action="store_true", | ||||||||
| help="""Run script in non-interactive mode when user input can not be provided. | ||||||||
| This should be used with programmatic script invocations (eg. Continuous Integration). | ||||||||
| """) | ||||||||
| parser.add_argument("--version", required=False, action="store_true", | ||||||||
| help="Prints version of this script.") | ||||||||
|
|
||||||||
| args = parser.parse_args() | ||||||||
|
|
||||||||
| if args.all: | ||||||||
|
|
@@ -245,15 +234,7 @@ def parse_args(): | |||||||
| if args.ipc != "IPC4": | ||||||||
| args.ipc="IPC4" | ||||||||
| warnings.warn(f"The option '--fw-naming AVS' has to be used with '-i IPC4'. Enable '-i IPC4' automatically.") | ||||||||
| if args.zephyr_ref and not args.clone_mode: | ||||||||
| raise RuntimeError(f"Argument -z without -c makes no sense") | ||||||||
| if args.clone_mode and not args.zephyr_ref: | ||||||||
| args.zephyr_ref = "main" # set default name for -z if -c specified | ||||||||
|
|
||||||||
| if args.west_path: # let the user provide an already existing zephyrproject/ anywhere | ||||||||
| west_top = pathlib.Path(args.west_path) | ||||||||
| elif not args.clone_mode: # if neather -p nor -c provided, use -p | ||||||||
| args.west_path = west_top | ||||||||
|
|
||||||||
| def execute_command(*run_args, **run_kwargs): | ||||||||
| """[summary] Provides wrapper for subprocess.run that prints | ||||||||
|
|
@@ -302,22 +283,60 @@ def check_west_installation(): | |||||||
| "https://docs.zephyrproject.org/latest/getting_started/index.html") | ||||||||
| print(f"Found west: {west_path}") | ||||||||
|
|
||||||||
| def find_west_workspace(): | ||||||||
| """[summary] Scans for west workspaces using west topdir command by checking script execution | ||||||||
| west_top and SOF_TOP directories. | ||||||||
| def west_reinitialize(west_root_dir: pathlib.Path, west_manifest_path: pathlib.Path): | ||||||||
| """[summary] Performs west reinitialization to SOF manifest file asking user for permission. | ||||||||
| Prints error message if script is running in non-interactive mode. | ||||||||
|
|
||||||||
| :return: [description] Returns path when west workspace had been found, otherwise None | ||||||||
| :rtype: [type] bool, pathlib.Path | ||||||||
| :param west_root_dir: directory where is initialized. | ||||||||
| :type west_root_dir: pathlib.Path | ||||||||
| :param west_manifest_path: manifest file to which west is initialized. | ||||||||
| :type west_manifest_path: pathlib.Path | ||||||||
| :raises RuntimeError: Raised when west is initialized to wrong manifest file | ||||||||
| (not SOFs manifest) and script is running in non-interactive mode. | ||||||||
| """ | ||||||||
| global west_top | ||||||||
| message = "West is initialized to manifest other than SOFs!\n" | ||||||||
| message += f"Initialized to manifest: {west_manifest_path}." + "\n" | ||||||||
| dot_west_directory = pathlib.Path(west_root_dir.resolve(), ".west") | ||||||||
| if args.no_interactive: | ||||||||
| message += f"Try deleting {dot_west_directory } directory and rerun this script." | ||||||||
| raise RuntimeError(message) | ||||||||
| question = message + "Reinitialize west to SOF manifest? [Y/n] " | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is really overkill. Just print the two Also don't forget this script is heavily used in non-interactive CI
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @marc-hb I'm sorry but we are starting to run circles with this code review.
@marc-hb are you reading my patch notes? I wrote there:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's stop for a while and think this trough.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I initially did not realize that you were concerned about "de-initializing" the west workspace, something which seems unfortunately missing from the west documentation :-( In that case then yes I'm afraid that deleting the |
||||||||
| print(f"{question}") | ||||||||
| while True: | ||||||||
| reinitialize_answer = input().lower() | ||||||||
| if reinitialize_answer == "y" or reinitialize_answer == "n": | ||||||||
| break | ||||||||
| sys.stdout.write('Please respond with \'Y\' or \'n\'.\n') | ||||||||
|
|
||||||||
| if reinitialize_answer != 'y': | ||||||||
| sys.exit("Can not proceed. Reinitialize your west manifest to SOF and rerun this script.") | ||||||||
| shutil.rmtree(dot_west_directory) | ||||||||
| execute_command(["west", "init", "-l", f"{SOF_TOP}"], cwd=west_top) | ||||||||
|
|
||||||||
| def west_init_if_needed(): | ||||||||
| """[summary] Validates whether west workspace had been initialized and points to SOF manifest. | ||||||||
| Peforms west initialization if needed. | ||||||||
| """ | ||||||||
| global west_top, SOF_TOP | ||||||||
| paths = [ pathlib.Path(os.getcwd()), SOF_TOP, west_top] | ||||||||
| for path in paths: | ||||||||
| if path.is_dir(): | ||||||||
| result = execute_command(["west", "topdir"], capture_output=True, | ||||||||
| text=True, check=False, cwd=path) | ||||||||
| if result.returncode == 0: | ||||||||
| return pathlib.Path(result.stdout.rstrip(os.linesep)) | ||||||||
| return None | ||||||||
| west_manifest_path = pathlib.Path(SOF_TOP, "west.yml") | ||||||||
| result_rootdir = execute_command(["west", "topdir"], capture_output=True, cwd=west_top, | ||||||||
| timeout=10, check=False) | ||||||||
| if result_rootdir.returncode != 0: | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "more pythonic" way is to drop except subprocess.CalledProcessError:
return None, None
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, generally yes but not in this specific case.
So it's not like we catch an exception from subprocess directly but python command subprocess.run generates that exception and raises it if you set
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The operating system only provides error codes, so all My suggestion to catch Nevermind, no real issue here. |
||||||||
| execute_command(["west", "init", "-l", f"{SOF_TOP}"], cwd=west_top) | ||||||||
| return | ||||||||
| west_root_dir = pathlib.Path(result_rootdir.stdout.decode().strip('\n')).resolve() | ||||||||
| result_manifest_dir = execute_command(["west", "config", "manifest.path"], capture_output=True, | ||||||||
| cwd=west_top, timeout=10, check=True) | ||||||||
| west_manifest_dir = pathlib.Path(west_root_dir, result_manifest_dir.stdout.decode().strip('\n')).resolve() | ||||||||
| manifest_file_result = execute_command(["west", "config", "manifest.file"], capture_output=True, | ||||||||
| cwd=west_top, timeout=10, check=True) | ||||||||
| returned_manifest_path = pathlib.Path(west_manifest_dir, manifest_file_result.stdout.decode().strip('\n')) | ||||||||
| if not returned_manifest_path.samefile(west_manifest_path): | ||||||||
| west_reinitialize(west_root_dir, returned_manifest_path) | ||||||||
|
marc-hb marked this conversation as resolved.
|
||||||||
| else: | ||||||||
| print(f"West workspace: {west_root_dir}") | ||||||||
| print(f"West manifest path: {west_manifest_path}") | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would print these in any case...
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||
|
|
||||||||
| def create_zephyr_directory(): | ||||||||
| global west_top | ||||||||
|
|
@@ -356,38 +375,11 @@ def create_zephyr_sof_symlink(): | |||||||
| "security-policy-settings/create-symbolic-links") | ||||||||
| raise | ||||||||
|
|
||||||||
| def west_init_update(): | ||||||||
| """[summary] Downloads zephyrproject inside sof/ and create a ../../.. symbolic | ||||||||
| link back to sof/""" | ||||||||
| global west_top, SOF_TOP | ||||||||
| zephyr_dir = pathlib.Path(west_top, "zephyr") | ||||||||
|
|
||||||||
| z_remote = "origin" | ||||||||
| z_ref = args.zephyr_ref | ||||||||
|
|
||||||||
| # Example of how to override SOF CI and point it at any Zephyr | ||||||||
| # commit from anywhere and to run all tests on it. Simply | ||||||||
| # uncomment and edit these lines and submit as an SOF Pull | ||||||||
| # Request. Note: unlike many git servers, github allows direct | ||||||||
| # fetching of (full 40-digits) SHAs; even SHAs not in origin but | ||||||||
| # in forks! See the end of "git help fetch-pack". | ||||||||
| # | ||||||||
| # z_remote = "https://somewhere.else" | ||||||||
| # z_ref = "pull/38374/head" | ||||||||
| # z_ref = "cb9a279050c4e8ad4663ee78688d8e7de1cac953" | ||||||||
|
|
||||||||
| # SECURITY WARNING for reviewers: never allow unknown code from | ||||||||
| # unknown submitters on any CI system. | ||||||||
|
|
||||||||
| execute_command(["git", "clone", "--depth", "5", args.url, str(zephyr_dir)], timeout=1200) | ||||||||
| execute_command(["git", "fetch", "--depth", "5", z_remote, z_ref], timeout=300, cwd=zephyr_dir) | ||||||||
| execute_command(["git", "checkout", "FETCH_HEAD"], cwd=zephyr_dir) | ||||||||
| execute_command(["git", "-C", str(zephyr_dir), "--no-pager", "log", "--oneline", "--graph", | ||||||||
| "--decorate", "--max-count=20"]) | ||||||||
| execute_command(["west", "init", "-l", str(zephyr_dir)]) | ||||||||
| create_zephyr_sof_symlink() | ||||||||
| # Do NOT "west update sof"!! | ||||||||
| execute_command(["west", "update", "zephyr", "hal_xtensa"], timeout=300, cwd=west_top) | ||||||||
| def west_update(): | ||||||||
| """[summary] Clones all west manifest projects to specified revisions""" | ||||||||
| global west_top | ||||||||
| execute_command(["west", "update"], check=True, timeout=3000, cwd=west_top) | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see the value of adding a bare layer of indirection on a mere
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That is a very bold statement. I do not agree with it.
This is much longer than:
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good points, this script will still be used a lot. OK, now I see this function is used as part of
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unresolving to keep @aborisovich's good summary visible. At least two more things the script do:
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For local testing I had to change this, otherwise any dry-run was incredibly time-consuming
Suggested change
Not urgent but we'll need to restore this optimization somehow after this PR gets merged, it makes a lot of difference for CI (and for testing changes to this script)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added fetch depth flag for now
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, that's what
Github allows fetching full SHA1s directly (try it from git), I'm surprised Sorry for the distraction, we can try to optimize again after this is merged. |
||||||||
|
|
||||||||
|
|
||||||||
| def get_sof_version(abs_build_dir): | ||||||||
| """[summary] Get version string major.minor.micro of SOF firmware | ||||||||
|
|
@@ -416,16 +408,6 @@ def build_platforms(): | |||||||
| print(f"SOF_TOP={SOF_TOP}") | ||||||||
| print(f"west_top={west_top}") | ||||||||
|
|
||||||||
| # Verify that zephyrproject is initialized and that it has a | ||||||||
| # correct pointer back to us SOF. create_zephyr_sof_symlink() | ||||||||
| # takes care of that but it's optional; maybe cloning was done | ||||||||
| # outside this script. The link can also fail when hopping in | ||||||||
| # and out of a container. Without this check, a not found SOF | ||||||||
| # would fail later with surprisingly cryptic Kconfig errors. | ||||||||
| execute_command(["west", "status", "hal_xtensa", "sof"], cwd=west_top, | ||||||||
| stdout=subprocess.DEVNULL) | ||||||||
|
|
||||||||
| assert(west_top.exists()) | ||||||||
| global STAGING_DIR | ||||||||
| STAGING_DIR = pathlib.Path(west_top, "build-sof-staging") | ||||||||
| # smex does not use 'install -D' | ||||||||
|
|
@@ -485,6 +467,8 @@ def build_platforms(): | |||||||
| build_cmd += ["build", "--build-dir", platform_build_dir_name] | ||||||||
| source_dir = pathlib.Path(SOF_TOP, "app") | ||||||||
| build_cmd += ["--board", PLAT_CONFIG, str(source_dir)] | ||||||||
| if args.pristine: | ||||||||
| build_cmd += ["-p", "always"] | ||||||||
|
|
||||||||
| build_cmd.append('--') | ||||||||
| if args.cmake_args: | ||||||||
|
|
@@ -507,7 +491,12 @@ def build_platforms(): | |||||||
| build_cmd.append(f"-DOVERLAY_CONFIG={overlays}") | ||||||||
|
|
||||||||
| # Build | ||||||||
| execute_command(build_cmd, cwd=west_top) | ||||||||
| try: | ||||||||
| execute_command(build_cmd, cwd=west_top) | ||||||||
| except: | ||||||||
| zephyr_path = pathlib.Path(west_top, "zephyr") | ||||||||
| if not os.path.exists(zephyr_path): | ||||||||
| sys.exit("Zephyr project not found. Please run this script with -c flag or clone manually.") | ||||||||
| smex_executable = pathlib.Path(west_top, platform_build_dir_name, "zephyr", "smex_ep", | ||||||||
| "build", "smex") | ||||||||
| fw_ldc_file = pathlib.Path(sof_platform_output_dir, f"sof-{platform}.ldc") | ||||||||
|
|
@@ -516,16 +505,15 @@ def build_platforms(): | |||||||
| execute_command([str(smex_executable), "-l", str(fw_ldc_file), str(input_elf_file)]) | ||||||||
| # CMake - configure rimage module | ||||||||
| rimage_dir_name="build-rimage" | ||||||||
| sof_mirror_dir = pathlib.Path("modules", "audio", "sof") | ||||||||
| rimage_source_dir = pathlib.Path(sof_mirror_dir, "rimage") | ||||||||
| rimage_source_dir = pathlib.Path(SOF_TOP, "rimage") | ||||||||
| execute_command(["cmake", "-B", rimage_dir_name, "-S", str(rimage_source_dir)], | ||||||||
| cwd=west_top) | ||||||||
| # CMake build rimage module | ||||||||
| execute_command(["cmake", "--build", rimage_dir_name, "-j", str(args.jobs)], | ||||||||
| cwd=west_top) | ||||||||
| # Sign firmware | ||||||||
| rimage_executable = shutil.which("rimage", path=pathlib.Path(west_top, rimage_dir_name)) | ||||||||
| rimage_config = pathlib.Path(sof_mirror_dir, "rimage", "config") | ||||||||
| rimage_config = pathlib.Path(SOF_TOP, "rimage", "config") | ||||||||
| sign_cmd = ["west"] | ||||||||
| sign_cmd += ["-v"] * args.verbose | ||||||||
| sign_cmd += ["sign", "--build-dir", platform_build_dir_name, "--tool", "rimage"] | ||||||||
|
|
@@ -588,40 +576,23 @@ def build_platforms(): | |||||||
| tools_output_dir, | ||||||||
| symlinks=True, ignore_dangling_symlinks=True, dirs_exist_ok=True) | ||||||||
|
|
||||||||
|
|
||||||||
| def run_clone_mode(): | ||||||||
| if find_west_workspace(): | ||||||||
| raise RuntimeError("Zephyr found already! Not downloading it again") | ||||||||
| create_zephyr_directory() | ||||||||
| west_init_update() | ||||||||
|
|
||||||||
| def run_point_mode(): | ||||||||
| global west_top, SOF_TOP | ||||||||
| west_workspace_path = find_west_workspace() | ||||||||
| if not west_workspace_path: | ||||||||
| raise RuntimeError("Failed to find west workspace.\nScanned directories:\n{}\n{}\n{}" | ||||||||
| .format(os.getcwd(), SOF_TOP, west_top)) | ||||||||
| if not west_workspace_path.exists(): | ||||||||
| raise FileNotFoundError("West topdir returned {} as workspace but it" | ||||||||
| " does not exist".format(west_workspace_path)) | ||||||||
| west_top = west_workspace_path | ||||||||
| create_zephyr_sof_symlink() | ||||||||
|
|
||||||||
| def main(): | ||||||||
| parse_args() | ||||||||
| if args.version: | ||||||||
| print(VERSION) | ||||||||
| sys.exit(0) | ||||||||
| check_west_installation() | ||||||||
| if len(args.platforms) == 0: | ||||||||
| print("No platform build requested") | ||||||||
| else: | ||||||||
| print("Building platforms: {}".format(" ".join(args.platforms))) | ||||||||
|
|
||||||||
| # we made two modes mutually exclusive with argparse | ||||||||
| if args.west_path: | ||||||||
| # check west_path input + create symlink if needed | ||||||||
| run_point_mode() | ||||||||
| if args.clone_mode: | ||||||||
| west_init_if_needed() | ||||||||
|
|
||||||||
| if args.update: | ||||||||
| # Initialize zephyr project with west | ||||||||
| run_clone_mode() | ||||||||
| west_update() | ||||||||
| create_zephyr_sof_symlink() | ||||||||
|
|
||||||||
| if args.platforms: | ||||||||
| build_platforms() | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| This directory can contain additional west manifest files. Any files | ||
| in this directory will be included in the main west.yml file sorted by | ||
| filename. | ||
|
|
||
| For more details about how this works, see this part of the west | ||
| documentation: | ||
|
|
||
| https://docs.zephyrproject.org/latest/guides/west/manifest.html#example-2-2-downstream-with-directory-of-manifest-files | ||
|
|
||
| Note: do not delete this file if there is no other content in submanifests directory. | ||
| Submanifests directory must exist for west update command to work (even if does not contain any actual manifests). | ||
| This is a known bug, see: https://github.com/zephyrproject-rtos/west/issues/594 |



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.
More like
--init-and-updateThere 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.
No, because init can be done also when we do not update. Check my reply to
It seems weird to call it "init_and_update". It implicitly suggest that when you do not use this flag you do not perform
west initwhat is not true.