From a82ee8fff2538cbe464787d3244d6f0664b07c22 Mon Sep 17 00:00:00 2001 From: MarkoSagadin Date: Wed, 21 Aug 2024 16:21:32 +0200 Subject: [PATCH] fix: east install nrfutil-toolchain manager now does extra checks It now checks if both nrfutil binary is present and also if it has the toolchain-manager package installed. --- CHANGELOG.md | 9 +++++++++ src/east/system_commands/tooling.py | 17 ++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dd325c..abf7e11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] +### Fixed + +- `east install nrfutil-toolchain-manager` until now only checked if the `nrfutil` + binary is present, but not also if the `toolchain-manager` package is installed + inside it. That resulted in situations where the install command would report + success, however any other east command after it would fail. Now the install + command checks if the `nrfutil` binary is present and if the `toolchain-manager` + package is installed inside it. + ## [0.21.3] - 2024-08-21 ### Fixed diff --git a/src/east/system_commands/tooling.py b/src/east/system_commands/tooling.py index 420bea2..2b8882c 100644 --- a/src/east/system_commands/tooling.py +++ b/src/east/system_commands/tooling.py @@ -256,7 +256,7 @@ def tool_installer(east, tool_names): supported_tools = [ { "name": "toolchain-manager", - "exe": east.consts["nrfutil_path"], + "cmd": east.consts["nrfutil_path"] + " toolchain-manager", "url": _get_nrfutil_download_link(), "install_method": _install_nrfutil, "installed_msg": toolchain_installed_msg, @@ -301,17 +301,24 @@ def tool_installer(east, tool_names): } for tool in tools: - tool["installed"] = east.check_exe(tool["exe"]) + if "exe" in tool: + tool["installed"] = east.check_exe(tool["exe"]) + tool_path = tool["exe"] + else: + ret = east.run(tool["cmd"], exit_on_error=False, silent=True) + tool["installed"] = ret["returncode"] == 0 + tool_path = tool["cmd"] + if tool["installed"]: - east.print(f"{tool['exe']} [green]found", **print_args) + east.print(f"{tool_path} [green]found", **print_args) elif tool["name"] in downloaded_files: east.print( - f"{tool['exe']} [red]not installed[/], but downloaded file is " + f"{tool_path} [red]not installed[/], but downloaded file is " f"present in the {east.consts['cache_dir']}", **print_args, ) else: - east.print(f"{tool['exe']} [red]not found", **print_args) + east.print(f"{tool_path} [red]not found", **print_args) files_to_download.append( { "url": tool["url"],