scripts: size_report: Fix reporting on Windows

Certain symbols do not contain a valid path, instead showing
`<built-in>` in the filename attribute. This leads to the resolve() call
failing on Windows, since the `<>` characters are not allowed in
filenames there. Fix this by catching the exception and skipping the
call in that case.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2020-09-02 19:30:33 +02:00 committed by Anas Nashif
commit cf2b3596f7

View file

@ -221,7 +221,13 @@ def get_die_filename(die, lineprog):
path = output.joinpath(path)
# Change path to relative to Zephyr base
path = path.resolve()
try:
path = path.resolve()
except OSError as e:
if '<built-in>' in str(path):
# This is expected, built-ins can't be resolved
return path
raise e
try:
new_path = path.relative_to(zephyrbase)
path = new_path