Revert "lib_compat_mode" changes // Resolve #3811 Resolve #3806

This commit is contained in:
Ivan Kravets
2021-01-24 15:49:56 +02:00
parent 59b02120b6
commit bd4d3b914b
2 changed files with 3 additions and 12 deletions

View File

@ -15,7 +15,6 @@ PlatformIO Core 5
- Upgraded build engine to the SCons 4.1 (`release notes <https://scons.org/scons-410-is-available.html>`_)
- Fixed an issue with Python 3.8+ on Windows when a network drive is used (`issue #3417 <https://github.com/platformio/platformio-core/issues/3417>`_)
- Fixed an issue when "strict" compatibility mode was not used for a library with custom "platforms" field in `library.json <https://docs.platformio.org/page/librarymanager/config.html>`__ manifest (`issue #3806 <https://github.com/platformio/platformio-core/issues/3806>`_)
* **Package Management System**

View File

@ -773,19 +773,11 @@ class PlatformIOLibBuilder(LibBuilderBase):
@property
def lib_compat_mode(self):
missing = object()
mode = self.env.GetProjectConfig().getraw(
"env:" + self.env["PIOENV"], "lib_compat_mode", missing
)
if mode == missing:
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(
mode or LibBuilderBase.lib_compat_mode.fget(self)
self._manifest.get("build", {}).get(
"libCompatMode", LibBuilderBase.lib_compat_mode.fget(self)
)
)
def is_platforms_compatible(self, platforms):