Bug 1632950 - Avoid failing the build when rustlib/etc is missing r=glandium

This was the case with my local rustc build today. We only use this directory for natvis files, it's fine to not have those.

Differential Revision: https://phabricator.services.mozilla.com/D72440
This commit is contained in:
David Major 2020-04-28 07:28:19 +00:00
Родитель 1265aecea0
Коммит 1a4ad7b34a
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -453,9 +453,10 @@ def rustc_natvis_ldflags(target, compiler_info, rustc):
sysroot = check_cmd_output(rustc, '--print', 'sysroot').strip()
etc = os.path.join(sysroot, 'lib/rustlib/etc')
ldflags = []
for f in os.listdir(etc):
if f.endswith('.natvis'):
ldflags.append('-NATVIS:' + normsep(os.path.join(etc, f)))
if os.path.isdir(etc):
for f in os.listdir(etc):
if f.endswith('.natvis'):
ldflags.append('-NATVIS:' + normsep(os.path.join(etc, f)))
return ldflags