Build failed with shared mbed-os using Windows junction
- Dominant language
- Python
- Stars
- 49
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
On Windows, when `mbed-os` is shared using WIndows junction, build failed with:
```
Configuring project and generating build system...
Traceback (most recent call last):
File "c:\python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\python38\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Python38\Scripts\mbed-tools.exe\__main__.py", line 7, in
File "c:\python38\lib\site-packages\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "c:\python38\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "c:\python38\lib\site-packages\mbed_tools\cli\main.py", line 38, in invoke
super().invoke(context)
File "c:\python38\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\python38\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\python38\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "c:\python38\lib\site-packages\mbed_tools\cli\build.py", line 105, in build
config, _ = generate_config(mbed_target.upper(), toolchain, program)
File "c:\python38\lib\site-packages\mbed_tools\build\config.py", line 36, in generate_config
config = assemble_config(
File "c:\python38\lib\site-packages\mbed_tools\build\_internal\config\assemble_build_config.py", line 42, in assemble_config
return _assemble_config_from_sources(target_attributes, mbed_lib_files, mbed_app_file)
File "c:\python38\lib\site-packages\mbed_tools\build\_internal\config\assemble_build_config.py", line 64, in _assemble_config_from_sources
config.update(source.from_file(config_file, target_filters=current_filter_data.labels))
File "c:\python38\lib\_collections_abc.py", line 832, in update
self[key] = other[key]
File "c:\python38\lib\site-packages\mbed_tools\build\_internal\config\config.py", line 27, in __setitem__
self._update_config_section(item)
File "c:\python38\lib\site-packages\mbed_tools\build\_internal\config\config.py", line 66, in _update_config_section
raise ValueError(
ValueError: Setting fat_chan.ffs_dbg already defined. You cannot duplicate config settings!
```
**To Reproduce**
1. On Windows, clone `mbed-os-example-blinky` and `mbed-os` to different directories:
```
$ git clone https://github.com/ARMmbed/mbed-os-example-blinky -b mbed-os-6.15.0
$ git clone https://github.com/ARMmbed/mbed-os -b mbed-os-6.15.0
```
1. Under `mbed-os-example-blinky`, run `mklink /J` to link `mbed-os` to just downloaded path
1. Under `mbed-os-example-blinky`, build with:
```
mbed-tools -vvv compile -m -t
```
**Expected behavior**
Build OK
**Screenshots**
N/A
**Desktop (please complete the following information):**
- OS: Windows
- Version: 10
**Mbed (please complete the following information):**
- Device: All
- Mbed OS Version: 6.15.0
- Mbed CLI 2 Version: 7.44.0
If Mbed CLI 2 changes back to 7.16.0, build OK.
**Additional context**
N/A
Contributor guide
Research direction
Reproduce the Windows junction setup with the mbed-tools compile command, then start by reading mbed_tools/build/_internal/config/assemble_build_config.py and config.py from the traceback. Trace why the shared mbed-os sources make fat_chan.ffs_dbg appear twice; done means the same example build completes successfully without the duplicate-setting error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, cli, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100