Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compat mode when no framework #4346

Merged
merged 1 commit into from
Jul 9, 2022
Merged

Conversation

smarq8
Copy link
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

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
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.

None yet

3 participants