espressif / esp-idf-ci-action

GitHub Action for ESP32 CI
MIT License
67 stars 24 forks source link

Issue resolving IDF dependencies (RDT-532) #33

Closed stephendpmurphy closed 1 year ago

stephendpmurphy commented 1 year ago

Hi :wave: I am attempting to setup CI for my project and it keeps failing when I get to the step of resolving dependencies. It appears to work just fine on my local machine but it fails to resolve the dependencies on the runner.

idf_components.yml

## IDF Component Manager Manifest File
dependencies:
  espressif/esp_tinyusb: "~1.3.1"
  ## Required IDF version
  idf:
    version: ">=4.1.0"
  # # Put list of dependencies here
  # # For components maintained by Espressif:
  # component: "~1.0.0"
  # # For 3rd party components:
  # username/component: ">=1.0.0,<2.0.0"
  # username2/component2:
  #   version: "~1.0.0"
  #   # For transient dependencies `public` flag can be set.
  #   # `public` flag doesn't have an effect dependencies of the `main` component.
  #   # All dependencies of `main` are public by default.
  #   public: true

github workflow file

- name: ESP-IDF build
        uses: espressif/esp-idf-ci-action@v1
        with:
            esp_idf_version: v4.4
            target: esp32s3
            command: idf.py @profiles/debug build && idf.py @profiles/release build && idf.py @profiles/factory_test build

CI Build error

Solving dependencies requirements
CMake Error at /opt/esp/idf/tools/cmake/build.cmake:455 (message):
  Traceback (most recent call last):
    File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
      exec(code, run_globals)
    File "/opt/esp/python_env/idf4.4_py3.8_env/lib/python3.8/site-packages/idf_component_manager/prepare_components/__main__.py", line 3, in <module>
      main()
    File "/opt/esp/python_env/idf4.4_py3.8_env/lib/python3.8/site-packages/idf_component_manager/prepare_components/prepare.py", line 110, in main
      args.func(args)
    File "/opt/esp/python_env/idf4.4_py3.8_env/lib/python3.8/site-packages/idf_component_manager/prepare_components/prepare.py", line 37, in prepare_dep_dirs
      ComponentManager(args.project_dir).prepare_dep_dirs(
    File "/opt/esp/python_env/idf4.4_py3.8_env/lib/python3.8/site-packages/idf_component_manager/core.py", line 325, in prepare_dep_dirs
      downloaded_component_paths = download_project_dependencies(
    File "/opt/esp/python_env/idf4.4_py3.8_env/lib/python3.8/site-packages/idf_component_manager/dependencies.py", line 36, in download_project_dependencies
      solution = solver.solve()
    File "/opt/esp/python_env/idf4.4_py3.8_env/lib/python3.8/site-packages/idf_component_manager/version_solver/version_solver.py", line 28, in solve
      self.solve_manifest(manifest)
    File "/opt/esp/python_env/idf4.4_py3.8_env/lib/python3.8/site-packages/idf_component_manager/version_solver/version_solver.py", line 47, in solve_manifest
      self.solve_component(requirement)
    File "/opt/esp/python_env/idf4.4_py3.8_env/lib/python3.8/site-packages/idf_component_manager/version_solver/version_solver.py", line 62, in solve_component
      self.solve_component(dep)
    File "/opt/esp/python_env/idf4.4_py3.8_env/lib/python3.8/site-packages/idf_component_manager/version_solver/version_solver.py", line 50, in solve_component
      cmp_with_versions = requirement.source.versions(
    File "/opt/esp/python_env/idf4.4_py3.8_env/lib/python3.8/site-packages/idf_component_tools/sources/web_service.py", line 96, in versions
      cmp_with_versions = self.api_client.versions(name, spec, target)
    File "/opt/esp/python_env/idf4.4_py3.8_env/lib/python3.8/site-packages/idf_component_tools/api_client.py", line 193, in versions
      if semantic_spec.match(Version(version['version'])):
    File "/opt/esp/python_env/idf4.4_py3.8_env/lib/python3.8/site-packages/semantic_version/base.py", line [105](https://github.com/astrohaus/alpha-prod-firmware/actions/runs/5954267780/job/16150434384#step:4:107), in __init__
      major, minor, patch, prerelease, build = self.parse(version_string, partial)
    File "/opt/esp/python_env/idf4.4_py3.8_env/lib/python3.8/site-packages/semantic_version/base.py", line 311, in parse
      raise ValueError('Invalid version string: %r' % version_string)
  ValueError: Invalid version string: '0.15.0~2'
Call Stack (most recent call first):
  /opt/esp/idf/tools/cmake/project.cmake:378 (idf_build_process)
  CMakeLists.txt:5 (project)
-- Configuring incomplete, errors occurred!
kumekay commented 1 year ago

Hello @stephendpmurphy

Probably the docker image with tag v4.4, uses too old version of the component manager, that doesn't support versions with revisions, could you please try a more recent bug-fix tag esp_idf_version: v4.4.5?

stephendpmurphy commented 1 year ago

I'll be completely honest and say I don't know why I'm using such an old version for the container. My local machine appears to be at 5.2. I'll get that updated and give it another try. While I have your attention - Is chaining the build commands via && acceptable? I'm wanting to build multiple variants and then I have a .sh script that I am running after the build to combine images (i.e. the factory_test binary is being placed along side the debug or release images as a test type partition.) @kumekay

stephendpmurphy commented 1 year ago

I've answered my own question. I hadn't realized the usage of @profiles is a brand new feature. I set the runner version to latest and it appears to be working now. I instead just handed the command option my build script which builds and generates combined images. Thanks for the quick help!