Skip to content

fix compat mode when no framework#4346

Merged
ivankravets merged 1 commit intoplatformio:developfrom
smarq8:develop
Jul 9, 2022
Merged

fix compat mode when no framework#4346
ivankravets merged 1 commit intoplatformio:developfrom
smarq8:develop

Conversation

@smarq8
Copy link
Copy Markdown
Contributor

@smarq8 smarq8 commented Jul 9, 2022

In some situation when using 'native' platform then pio might treat some libraries as compatible even if lib_compat_mode=strict is used and it will then fail to compile arduino library under native platform.
As native does not contain any 'framework' then 'is_frameworks_compatible()' might treat library as compatible even if library.json says its for 'arduino' only for example
Untill now i used lib_ignore to overcome this issue but in long term its hassle to keep it updated

platformio.ini

[env:main_dev_SDL]
platform = native
; framework = none
; board = non
lib_compat_mode = strict ; do nothing in this case as is_frameworks_compatible() will be false positive when no framework defined

[env:main_dev]
platform = espressif32
framework = arduino
board = esp32dev
library.json

{
	"name": "spiDev",
	"frameworks": "arduino",
	"platforms": "*"
}

PS. im not very familiar with python but 'is_frameworks_compatible' look very strange with its 'frameworks=["arduino", "energia"]' especially compared to 'platforms=self._manifest.get("platforms")' for 'is_platforms_compatible'

    def is_frameworks_compatible(self, frameworks):
        return PackageCompatibility(frameworks=frameworks).is_compatible(
            PackageCompatibility(frameworks=["arduino", "energia"])
        )

    def is_platforms_compatible(self, platforms):
        return PackageCompatibility(platforms=platforms).is_compatible(
            PackageCompatibility(platforms=self._manifest.get("platforms"))
        )

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jul 9, 2022

CLA assistant check
All committers have signed the CLA.

@ivankravets ivankravets added this to the 6.1.1 milestone Jul 9, 2022
@ivankravets ivankravets added enhancement LDF Library Dependency Finder build system labels Jul 9, 2022
@ivankravets ivankravets merged commit 6627fd5 into platformio:develop Jul 9, 2022
@ivankravets
Copy link
Copy Markdown
Member

Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build system enhancement LDF Library Dependency Finder

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants