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

Bring library.json up to date #475

Merged
merged 2 commits into from
Dec 2, 2024
Merged

Conversation

OrhanYigitDurmaz
Copy link
Contributor

Brings libraryçjson up to date to todays standards.

Without the platforms field, platformio pioarduino esp32 core fails with:

Testing platformio.ini:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[platformio]
build_cache_dir = .cache

[env:esp32-s3-devkitc-1]
platform = https://github.com/pioarduino/platform-espressif32.git#develop
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
upload_speed = 921600
build_flags = 
	-D ARDUINO_USB_MODE=1
	-D ARDUINO_USB_CDC_ON_BOOT=1
lib_deps = 
	adafruit/Adafruit TinyUSB Library@^3.4.1

The error i got:

Removing unused dependencies...
Library Manager: Installing adafruit/Adafruit TinyUSB Library @ ^3.4.1
Unpacking  [####################################]  100%
Library Manager: Adafruit TinyUSB Library@3.4.1 has been installed!
Library Manager: Resolving dependencies...
AttributeError: Traceback (most recent call last):
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\__main__.py", line 103, in main
    cli()  # pylint: disable=no-value-for-parameter
    ^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\click\core.py", line 1157, in __call__    
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\click\core.py", line 1078, in main        
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\cli.py", line 85, in invoke
    return super().invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\click\decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\run\cli.py", line 145, in cli
    process_env(
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\run\cli.py", line 208, in process_env
    ).process()
      ^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\run\processor.py", line 81, in process
    install_project_env_dependencies(
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\package\commands\install.py", line 133, in install_project_env_dependencies
    _install_project_env_libraries(project_env, options),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\package\commands\install.py", line 252, in _install_project_env_libraries    env_lm.install(
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\package\manager\_install.py", line 47, in install
    pkg = self._install(spec, skip_dependencies=skip_dependencies, force=force)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\package\manager\_install.py", line 130, in _install
    self.install_dependencies(pkg)
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\package\manager\_install.py", line 143, in install_dependencies
    self.install_dependency(dependency)
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\package\manager\library.py", line 89, in install_dependency
    not_builtin_conds.append(not self.is_builtin_lib(spec.name))
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\package\manager\library.py", line 120, in is_builtin_lib
    for storage in cls.get_builtin_libs():
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\util.py", line 57, in wrapper
    self.cache[key] = (time.time(), func(*args, **kwargs))
                                    ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\package\manager\library.py", line 104, in get_builtin_libs
    p = PlatformFactory.new(pkg)
        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\orhan\.platformio\penv\Lib\site-packages\platformio\platform\factory.py", line 79, in new
    platform_cls = getattr(
                   ^^^^^^^^
AttributeError: module 'platformio.platform.platform' has no attribute 'PlatformPlatform'

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `python -m pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq/index.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================

This happens because the library json doesnt have the platforms key.

Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look good, thank you

@hathach hathach merged commit 85476dc into adafruit:master Dec 2, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants