ARMmbed / mbed-tools

⚠️ Beta Status: New command line tooling for Mbed OS
Apache License 2.0
45 stars 30 forks source link

config: Ensure duplicate config file paths are discarded #285

Closed rwalton-arm closed 3 years ago

rwalton-arm commented 3 years ago

Description

When mbed-os-path was given on the command line, and it happened to be a subdirectory of the project path it would be searched twice for mbed_lib.json files. This would cause duplicate config parameter exceptions to be raised.

Ensure duplicated config file paths are discarded by resolving the absolute paths. This is so Path.__eq__ can detect duplicate entries and they are filtered when building the final set. Also ensure we handle the case where a subdirectory of the search path is a symlink.

Fixes #234

Test Coverage

codecov[bot] commented 3 years ago

Codecov Report

Merging #285 (7f947d7) into master (ff2da40) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #285   +/-   ##
=======================================
  Coverage   97.07%   97.08%           
=======================================
  Files          92       92           
  Lines        2773     2775    +2     
=======================================
+ Hits         2692     2694    +2     
  Misses         81       81           
Impacted Files Coverage Δ
...ls/build/_internal/config/assemble_build_config.py 100.00% <ø> (ø)
src/mbed_tools/build/_internal/find_files.py 100.00% <100.00%> (ø)