Skip to content

CLI provides insufficient BoardDetails#build_properties info when the platform is installed via Git #2197

@dankeboy36

Description

@dankeboy36
Contributor

Describe the problem

I have noticed when a platform is installed from git, instead of the Boards Manager (./arduino-cli core install id), then the BoardDetails#build_properties fails to provide sufficient information to calculate required tool paths. See arduino/arduino-ide#2071 (comment).

To reproduce

Install the esp32 platform manually via Git, and run the get board details command for esp32:esp32:esp32 (the FQBN can be espressif:esp32:esp32 if you strictly follow the steps).

The missing runtime.tools.* is the real problem for the Git-installed platform:

341,381c340,355
<     "runtime.platform.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/hardware/esp32/2.0.9",
<     "runtime.hardware.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/hardware/esp32",
<     "build.core.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/hardware/esp32/2.0.9/cores/esp32",
<     "build.system.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/hardware/esp32/2.0.9/system",
<     "build.variant.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/hardware/esp32/2.0.9/variants/esp32",
<     "runtime.tools.mkspiffs-3.1.0-gcc10.3-e5f9fec.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp8266/tools/mkspiffs/3.1.0-gcc10.3-e5f9fec",
<     "runtime.tools.mklittlefs-3.1.0-gcc10.3-e5f9fec.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp8266/tools/mklittlefs/3.1.0-gcc10.3-e5f9fec",
<     "runtime.tools.esptool_py.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/esptool_py/4.5.1",
<     "runtime.tools.esptool_py-4.5.1.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/esptool_py/4.5.1",
<     "runtime.tools.mklittlefs.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/mklittlefs/3.0.0-gnu12-dc7f933",
<     "runtime.tools.mklittlefs-3.0.0-gnu12-dc7f933.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/mklittlefs/3.0.0-gnu12-dc7f933",
<     "runtime.tools.mkspiffs.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/mkspiffs/0.2.3",
<     "runtime.tools.mkspiffs-0.2.3.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/mkspiffs/0.2.3",
<     "runtime.tools.openocd-esp32.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/openocd-esp32/v0.11.0-esp32-20221026",
<     "runtime.tools.openocd-esp32-v0.11.0-esp32-20221026.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/openocd-esp32/v0.11.0-esp32-20221026",
<     "runtime.tools.riscv32-esp-elf-gcc.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0",
<     "runtime.tools.riscv32-esp-elf-gcc-esp-2021r2-patch5-8.4.0.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0",
<     "runtime.tools.riscv32-esp-elf-gdb.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/riscv32-esp-elf-gdb/11.2_20220823",
<     "runtime.tools.riscv32-esp-elf-gdb-11.2_20220823.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/riscv32-esp-elf-gdb/11.2_20220823",
<     "runtime.tools.xtensa-esp-elf-gdb.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/xtensa-esp-elf-gdb/11.2_20220823",
<     "runtime.tools.xtensa-esp-elf-gdb-11.2_20220823.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/xtensa-esp-elf-gdb/11.2_20220823",
<     "runtime.tools.xtensa-esp32-elf-gcc.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0",
<     "runtime.tools.xtensa-esp32-elf-gcc-esp-2021r2-patch5-8.4.0.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0",
<     "runtime.tools.xtensa-esp32s2-elf-gcc.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/xtensa-esp32s2-elf-gcc/esp-2021r2-patch5-8.4.0",
<     "runtime.tools.xtensa-esp32s2-elf-gcc-esp-2021r2-patch5-8.4.0.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/xtensa-esp32s2-elf-gcc/esp-2021r2-patch5-8.4.0",
<     "runtime.tools.xtensa-esp32s3-elf-gcc.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0",
<     "runtime.tools.xtensa-esp32s3-elf-gcc-esp-2021r2-patch5-8.4.0.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0",
<     "runtime.tools.serial-monitor.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/builtin/tools/serial-monitor/0.13.0",
<     "runtime.tools.serial-monitor-0.13.0.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/builtin/tools/serial-monitor/0.13.0",
<     "runtime.tools.ctags.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/builtin/tools/ctags/5.8-arduino11",
<     "runtime.tools.ctags-5.8-arduino11.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/builtin/tools/ctags/5.8-arduino11",
<     "runtime.tools.mdns-discovery.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/builtin/tools/mdns-discovery/1.0.9",
<     "runtime.tools.mdns-discovery-1.0.9.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/builtin/tools/mdns-discovery/1.0.9",
<     "runtime.tools.xtensa-lx106-elf-gcc.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec",
<     "runtime.tools.xtensa-lx106-elf-gcc-3.1.0-gcc10.3-e5f9fec.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec",
<     "runtime.tools.serial-discovery.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/builtin/tools/serial-discovery/1.4.0",
<     "runtime.tools.serial-discovery-1.4.0.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/builtin/tools/serial-discovery/1.4.0",
<     "runtime.tools.python3.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp8266/tools/python3/3.7.2-post1",
<     "runtime.tools.python3-3.7.2-post1.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp8266/tools/python3/3.7.2-post1",
<     "extra.time.utc": "1685646630",
<     "extra.time.local": "1685653830",
---
>     "build.copy_jtag_files": "0",
>     "runtime.platform.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino/hardware/esp32/esp32",
>     "runtime.hardware.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino/hardware/esp32",
>     "build.core.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino/hardware/esp32/esp32/cores/esp32",
>     "build.system.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino/hardware/esp32/esp32/system",
>     "build.variant.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino/hardware/esp32/esp32/variants/esp32",
>     "runtime.tools.serial-monitor.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino15/packages/builtin/tools/serial-monitor/0.13.0",
>     "runtime.tools.serial-monitor-0.13.0.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino15/packages/builtin/tools/serial-monitor/0.13.0",
>     "runtime.tools.ctags.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino15/packages/builtin/tools/ctags/5.8-arduino11",
>     "runtime.tools.ctags-5.8-arduino11.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino15/packages/builtin/tools/ctags/5.8-arduino11",
>     "runtime.tools.serial-discovery.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino15/packages/builtin/tools/serial-discovery/1.4.0",
>     "runtime.tools.serial-discovery-1.4.0.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino15/packages/builtin/tools/serial-discovery/1.4.0",
>     "runtime.tools.mdns-discovery.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino15/packages/builtin/tools/mdns-discovery/1.0.9",
>     "runtime.tools.mdns-discovery-1.0.9.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino15/packages/builtin/tools/mdns-discovery/1.0.9",
>     "extra.time.utc": "1685646185",
>     "extra.time.local": "1685653385",

diff.json.txt
installed_from_boards_manager.json.txt
installed_from_git.json.txt

If you have npm, node, python, jq installed, you can clone my repository and run the tests. It will create the test environment. It takes a few minutes.

git clone https://github.com/dankeboy36/arduino-ide-esp-exception-decoder.git cli-2197 \
&& cd cli-2197 \
&& git checkout e140fa90c88a785b766d1935156f0f1feab167ac \
&& npm i  \
&& npm run test-slow

To get the complete build_proepties from the CLI (boards manager) installation:

./test-resources/cli-releases/install/0.33.0/arduino-cli board details -b esp32:esp32:esp32 --config-file ./cli/arduino-cli.yaml --format json | jq .build_properties

To get the bogus build_proepties from the Git installation:

./test-resources/cli-releases/install/0.33.0/arduino-cli board details -b esp32:esp32:esp32 --config-file ./git/arduino-cli.yaml --format json | jq .build_properties

Expected behavior

The BoardDetails#build_proeprties keys are the same when the platform is installed via the boards manager and Git.

Arduino CLI version

0.33.0

Operating system

macOS

Operating system version

11.7.7

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
    I verified the problem still occurs when using the nightly build
    My report contains all necessary details

Activity

changed the title [-]CLI provides insufficient BoardDetails#build_properties info when the platform is installed via Git[/-] [+]CLI provides insufficient `BoardDetails#build_properties` info when the platform is installed via Git[/+] on Jun 1, 2023
per1234

per1234 commented on Jun 1, 2023

@per1234
Contributor

@dankeboy36 is this about the missing tools.xtensa-esp-elf-gdb.path and tools.riscv32-esp-elf-gdb.path properties? If so, this is because for some reason the master branch of the espressif/arduino-esp32 repo is significantly outdated. It is missing this commit that is in the 2.0.9 release version you get from Boards Manager:

espressif/arduino-esp32@8fca365

Check out the release/v2.x branch in your espressif/arduino-esp32 clone and then run the tools/get.py script again to update the toolchain. After you do that the tools.xtensa-esp-elf-gdb.path and tools.riscv32-esp-elf-gdb.path properties will be defined when using the manually installed ESP32 platform.

me-no-dev

me-no-dev commented on Jun 1, 2023

@me-no-dev

runtime.tools.* is defined by Arduino CLI and because it was causing clashes between core installed through the board manager and through git, we have recently removed those definitions in the git variant of platform.txt. What you actually need is tools.* which in both cases (git/board manager) will show the correct path to tools.

dankeboy36

dankeboy36 commented on Jun 2, 2023

@dankeboy36
ContributorAuthor

Thank you!

is this about the missing tools.xtensa-esp-elf-gdb.path and tools.riscv32-esp-elf-gdb.path properties?

It's about all missing runtime.tools.* properties.

Check out the release/v2.x

My tests check out the 2.0.9 branch from espressif/arduino-esp32 repo. See the CI logs here. It is 3670e2b.

What you actually need is tools.*

That is a super helpful remark. I made some progress, but somewhere, there is a bug. I will reuse snippets from the attached files to #2197 (comment) to describe the situation. The FQBN is esp32:esp32:esp32. (I used the esp32 folder name instead of espressif described in the manual installation. esp32:esp32:esp32 is OK.)

For esp32:esp32:esp32, the tool lookup logic should look for tools.xtensa-esp-elf-gdb.path and
tools.xtensa-esp32-elf-gcc.path, and the GDB executable name is xtensa-esp32-elf-gdb. (Let's ignore the runtime.tools.* case for now.)

Relevant build_properties content when installed via CLI:

"tools.xtensa-esp-elf-gdb.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/xtensa-esp-elf-gdb/11.2_20220823",
"tools.xtensa-esp32-elf-gcc.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/cli/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0",

The expected path is cli/Arduino15/packages/esp32/tools/xtensa-esp-elf-gdb/11.2_20220823/bin/xtensa-esp32-elf-gdb. It exists ✅

Screen Shot 2023-06-02 at 09 31 33

Relevant build_properties content when installed via Git:

"tools.xtensa-esp-elf-gdb.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino/hardware/esp32/esp32/tools/xtensa-esp-elf-gdb",
"tools.xtensa-esp32-elf-gcc.path": "/Users/dankeboy36/Desktop/dev/arduino-ide-esp-exception-decoder/test-resources/envs/git/Arduino/hardware/esp32/esp32/tools/xtensa-esp32-elf",

When installed from Git, the CLI's board properties response expands the tools.xtensa-esp-elf-gdb.path to ./Arduino/hardware/esp32/esp32/tools/xtensa-esp-elf-gdb, but this folder does not exist. ❌ It should be ./Arduino/hardware/esp32/xtensa-esp-elf-gdb. The same problem is with tools.xtensa-esp32-elf-gcc.path. This extra esp32/tools/ segment gets into the expanded paths.

Screen Shot 2023-06-02 at 09 37 47

I do not know the details of the property expansion, but I think this is either a bug in the CLI or my tool lookup logic should handle corner cases which I wanted to avoid and rely solely on the CLI.

me-no-dev

me-no-dev commented on Jun 2, 2023

@me-no-dev

When installed from Git, the CLI's board properties response expands the tools.xtensa-esp-elf-gdb.path to ./Arduino/hardware/esp32/esp32/tools/xtensa-esp-elf-gdb

Your hardware folder has wrong structure. It should be Arduino/hardware/[vendor]/[core], where we recommend vendor folder to be espressif for git builds and core folder must be esp32. Then you run Arduino/hardware/espressif/esp32/tools/get.py to download all necessary tools (they will end up in the same tools folder)

dankeboy36

dankeboy36 commented on Jun 2, 2023

@dankeboy36
ContributorAuthor

Then you run Arduino/hardware/espressif/esp32/tools/get.py

This was the problem. When executing the python script, the cwd must be Arduino/hardware/espressif/esp32/tools/. I incorrectly set it to Arduino/hardware/espressif/ in my tests. Everything is working great now.

Thank you!

It's not a CLI bug.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @per1234@me-no-dev@dankeboy36

        Issue actions

          CLI provides insufficient `BoardDetails#build_properties` info when the platform is installed via Git · Issue #2197 · arduino/arduino-cli