From f9384ded27de2ce0342a479a8ae314931cd78009 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 22 Jan 2021 22:45:36 +0200 Subject: [PATCH] =?UTF-8?q?Fixed=20an=20issue=20when=20=E2=80=9Cstrict?= =?UTF-8?q?=E2=80=9D=20compatibility=20mode=20was=20not=20used=20for=20a?= =?UTF-8?q?=20library=20with=20custom=20=E2=80=9Cplatforms=E2=80=9D=20fiel?= =?UTF-8?q?d=20in=20library.json=20manifest=20//=20Resolve=20#3806?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HISTORY.rst | 11 ++++++----- platformio/builder/tools/piolib.py | 9 ++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 9addc2bf..e9b4990f 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -13,10 +13,11 @@ PlatformIO Core 5 * Significantly speedup PlatformIO Home loading time by migrating to native Python 3 Asynchronous I/O * Improved listing of `multicast DNS services `_ -* Check for debug server's "ready_pattern" in "stderr" +* Check for debugging server's "ready_pattern" in "stderr" * Upgraded build engine to the SCons 4.1 (`release notes `_) -* Fixed a "UnicodeDecodeError: 'utf-8' codec can't decode byte" when using J-Link for a firmware uploading on Linux (`issue #3804 `_) -* Fixed an issue with Python 3.8+ on Windows when network drive is used (`issue #3417 `_) +* Fixed a "UnicodeDecodeError: 'utf-8' codec can't decode byte" when using J-Link for firmware uploading on Linux (`issue #3804 `_) +* Fixed an issue with Python 3.8+ on Windows when a network drive is used (`issue #3417 `_) +* Fixed an issue when "strict" compatibility mode was not used for a library with custom "platforms" field in `library.json `__ manifest (`issue #3806 `_) 5.0.4 (2020-12-30) ~~~~~~~~~~~~~~~~~~ @@ -25,8 +26,8 @@ PlatformIO Core 5 - Improved ``.ccls`` configuration file for Emacs, Vim, and Sublime Text integrations - Updated analysis tools: - * `Cppcheck `__ v2.3 with improved C++ parser and several new MISRA rules - * `PVS-Studio `__ v7.11 with new diagnostics and updated mass suppression mechanism + * `Cppcheck `__ v2.3 with improved C++ parser and several new MISRA rules + * `PVS-Studio `__ v7.11 with new diagnostics and updated mass suppression mechanism - Show a warning message about deprecated support for Python 2 and Python 3.5 - Do not provide "intelliSenseMode" option when generating configuration for VSCode C/C++ extension diff --git a/platformio/builder/tools/piolib.py b/platformio/builder/tools/piolib.py index f6b9824b..97e2637a 100644 --- a/platformio/builder/tools/piolib.py +++ b/platformio/builder/tools/piolib.py @@ -773,11 +773,14 @@ class PlatformIOLibBuilder(LibBuilderBase): @property def lib_compat_mode(self): + mode = self._manifest.get("build", {}).get( + "libCompatMode", + ) + if not mode and self._manifest.get("platforms"): + mode = "strict" # pylint: disable=no-member return self.validate_compat_mode( - self._manifest.get("build", {}).get( - "libCompatMode", LibBuilderBase.lib_compat_mode.fget(self) - ) + mode or LibBuilderBase.lib_compat_mode.fget(self) ) def is_platforms_compatible(self, platforms):