Skip to content

Commit

Permalink
fix: east install nrfutil-toolchain manager now does extra checks
Browse files Browse the repository at this point in the history
It now checks if both nrfutil binary is present and also if it has the
toolchain-manager package installed.
  • Loading branch information
MarkoSagadin committed Aug 21, 2024
1 parent bb962cc commit a82ee8f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 12 additions & 5 deletions src/east/system_commands/tooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"],
Expand Down

0 comments on commit a82ee8f

Please sign in to comment.