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

Decouple partition CSV location from project directory (IDFGH-11092) #12264

Closed
3 tasks done
brianredbeard opened this issue Sep 18, 2023 · 3 comments
Closed
3 tasks done
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally

Comments

@brianredbeard
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Presently the specification of a CSV file for the partition_table component gets serialized to an absolute path relative to the derived project location:

get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}"
ABSOLUTE BASE_DIR "${project_dir}")

This results in a problematic composition of the path when there is more than a single level of component composition within an ESP-IDF project.

For example, I cam currently extending the MicroPython project. Within their build system, it's expected that a user will execute idf.py build from the path ports/esp32 within the project. This will then set ports/esp32/partitions.csv as the required file path.

When consuming MicroPython as a submodule and referencing the CMake scripts from another project while utilizing the same sdkconfig definition (e.g. ext/micropython/ports/esp32) due to the change in the location of the project call the definition loses portability between projects.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Sep 18, 2023
@github-actions github-actions bot changed the title Decouple partition CSV location from project directory Decouple partition CSV location from project directory (IDFGH-11092) Sep 18, 2023
@brianredbeard
Copy link
Author

One resolution would be to allow the user to set a property on the build. A different idea would be to use the find_file() CMake function (https://cmake.org/cmake/help/latest/command/find_file.html) with the ENV var sub-option allowing a user to specify an additional search path as a part of the build environment.

@brianredbeard
Copy link
Author

E.g. If I populate my sdkconfig with the following:

CONFIG_PARTITION_TABLE_FILENAME="boards/sampleboard/sampleboard-partitions.csv"
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="boards/sampleboard/sampleboard-partitions.csv"
CONFIG_MICROPY_FROZEN_MANIFEST="boards/sampleboard/manifest.py"

And then attempt to run a build I am met with the following error:

Loading defaults file /Users/bharrington/Projects/hardware/badgePython/build/sdkconfig.combined...
CMake Warning at esp-idf/components/partition_table/project_include.cmake:18 (message):
  Partition table CSV file
  /Users/bharrington/Projects/hardware/badgePython/sampleboard-partitions.csv
  not found.  Change custom partition CSV path in menuconfig.
Call Stack (most recent call first):
  esp-idf/tools/cmake/build.cmake:380 (include)
  esp-idf/tools/cmake/build.cmake:599 (__build_process_project_includes)
  esp-idf/tools/cmake/project.cmake:530 (idf_build_process)
  CMakeLists.txt:88 (project)

@sudeep-mohanty
Copy link
Collaborator

@brianredbeard Thanks for reporting the problem to us. Seems like the solution could be to have an absolute path configuration for the csv file irrespective of the project path. We shall take a look!

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Dec 4, 2023
@espressif-bot espressif-bot added Status: Reviewing Issue is being reviewed and removed Status: In Progress Work is in progress labels Dec 20, 2023
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Reviewing Issue is being reviewed labels Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants