`mbed-tools configure` fails due to multiple mbed-os paths being searched
- Dominant language
- Python
- Stars
- 49
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
**Issue**
The same error as #234 (see error message below), possibly caused by using a shared instance of mbed-os.
Error
`ValueError: Setting already defined. You cannot duplicate config settings!`
(_The setting name changes every time the command is executed_)
Details
I believe this issue is caused when `assemble_config()` finds the `mbed-os/` path within `program.root`, and then the `mbed-os/` path is also passed in via `program.mbed_os.root`.
https://github.com/ARMmbed/mbed-tools/blob/519d3ecb5b362e31f3329ce8e4a2186bbb4b8cb7/src/mbed_tools/build/config.py#L36-L38
In the above snipped, if I remove `program.mbed_os.root` everything works correctly.
**To Reproduce**
1. Navigate to `mbed-os-example-blinky`
2. Use shared instance of mbed-os
3. Enter `mbed-tools configure -m NRF52_DK -t GCC_ARM`
**Expected behavior**
The `mbed-tools configure -m NRF52_DK -t GCC_ARM` command should configure the `mbed-os-example-blinky` project for CMake.
**Desktop (please complete the following information):**
- OS: Windows
- Version: 21H1
**Mbed (please complete the following information):**
- Device: NRF52_DK
- Mbed OS Version: [e.g. 6.8.0]
- Mbed CLI 2 Version: 7.50.0
Contributor guide
Research direction
Start in src/mbed_tools/build/config.py around lines 36-38 and inspect how assemble_config() searches program.root and program.mbed_os.root. Reproduce with mbed-tools configure -m NRF52_DK -t GCC_ARM in mbed-os-example-blinky using a shared mbed-os instance. Done means the command configures the project for CMake without duplicate configuration-setting errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, python
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100