diff --git a/HISTORY.rst b/HISTORY.rst index c9e03460..5c84e5fa 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,7 @@ Release Notes ============= .. |PIOCONF| replace:: `"platformio.ini" `__ configuration file +.. |LIBRARYJSON| replace:: `library.json `__ .. |LDF| replace:: `LDF `__ .. |INTERPOLATION| replace:: `Interpolation of Values `__ .. |UNITTESTING| replace:: `Unit Testing `__ @@ -23,7 +24,8 @@ PlatformIO Core 6 * Removed dependency on the "zeroconf" package and install it only when a user lists mDNS devices (issue with zeroconf's LGPL license) * Show the real error message instead of "Can not remove temporary directory" when |PIOCONF| is broken (`issue #4480 `_) * Fixed an issue with an incorrect test summary when a testcase name includes a colon (`issue #4508 `_) -* Fixed an issue when `extends `__ does not override options in the right order (`issue #4462 `_) +* Fixed an issue when `extends `__ did not override options in the right order (`issue #4462 `_) +* Fixed an issue when `pio pkg list `__ and `pio pkg uninstall `__ commands fail if there are circular dependencies in the |LIBRARYJSON| manifests (`issue #4475 `_) 6.1.5 (2022-11-01) ~~~~~~~~~~~~~~~~~~ @@ -58,7 +60,7 @@ PlatformIO Core 6 * Export a ``PIO_UNIT_TESTING`` macro to the project source files and dependent libraries in the |UNITTESTING| mode * Improved detection of Windows architecture (`issue #4353 `_) * Warn about unknown `device monitor filters `__ (`issue #4362 `_) -* Fixed a regression bug when `libArchive `__ option declared in the `library.json `__ manifest was ignored (`issue #4351 `_) +* Fixed a regression bug when `libArchive `__ option declared in the |LIBRARYJSON| manifest was ignored (`issue #4351 `_) * Fixed an issue when the `pio pkg publish `__ command didn't work with Python 3.6 (`issue #4352 `_) 6.1.1 (2022-07-11) diff --git a/platformio/package/commands/list.py b/platformio/package/commands/list.py index c92cc1b4..9d538b7d 100644 --- a/platformio/package/commands/list.py +++ b/platformio/package/commands/list.py @@ -84,10 +84,16 @@ def print_dependency_tree(pm, specs=None, filter_specs=None, level=0, verbose=Fa if not candidates: return candidates = sorted(candidates.values(), key=lambda item: item[0].metadata.name) + for index, (pkg, spec) in enumerate(candidates): if filtered_pkgs and not _pkg_tree_contains(pm, pkg, filtered_pkgs): continue - dependencies = pm.get_pkg_dependencies(pkg) + printed_pkgs = pm.memcache_get("__printed_pkgs", []) + if printed_pkgs and pkg.path in printed_pkgs: + continue + printed_pkgs.append(pkg.path) + pm.memcache_set("__printed_pkgs", printed_pkgs) + click.echo( "%s%s %s" % ( @@ -100,6 +106,8 @@ def print_dependency_tree(pm, specs=None, filter_specs=None, level=0, verbose=Fa ), ) ) + + dependencies = pm.get_pkg_dependencies(pkg) if dependencies: print_dependency_tree( pm, diff --git a/platformio/package/manager/_uninstall.py b/platformio/package/manager/_uninstall.py index c845145a..b374fd01 100644 --- a/platformio/package/manager/_uninstall.py +++ b/platformio/package/manager/_uninstall.py @@ -35,6 +35,12 @@ class PackageManagerUninstallMixin: if not pkg or not pkg.metadata: raise UnknownPackageError(spec) + uninstalled_pkgs = self.memcache_get("__uninstalled_pkgs", []) + if uninstalled_pkgs and pkg.path in uninstalled_pkgs: + return pkg + uninstalled_pkgs.append(pkg.path) + self.memcache_set("__uninstalled_pkgs", uninstalled_pkgs) + self.log.info( "Removing %s @ %s" % (click.style(pkg.metadata.name, fg="cyan"), pkg.metadata.version)