Skip to content

Commit ed6bd90

Browse files
kateinoigakukunAnka
authored and
Anka
committed
[lit] Repair tests for stdlib-only build
`config.host_triple` can be None when no host tools are built This is based on 21d57e8 in main branch
1 parent 457e3a3 commit ed6bd90

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/lit.cfg

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,16 +573,18 @@ else:
573573
)
574574
)
575575
# Parse the host triple.
576-
(host_cpu, host_vendor, host_os, host_vers) = re.match('([^-]+)-([^-]+)-([^0-9-]+)(.*)', config.host_triple).groups()
577-
toolchain_lib_dir = make_path(config.swift_lib_dir, 'swift', host_os)
576+
toolchain_lib_dir = None
577+
if config.host_triple:
578+
(host_cpu, host_vendor, host_os, host_vers) = re.match('([^-]+)-([^-]+)-([^0-9-]+)(.*)', config.host_triple).groups()
579+
toolchain_lib_dir = make_path(config.swift_lib_dir, 'swift', host_os)
578580
config.host_build_swift = (
579581
"%s -target %s -g %s -I %s -L %s %s" % (
580582
config.swiftc_driver,
581583
config.host_triple,
582584
'' if kIsWindows else '-no-toolchain-stdlib-rpath',
583585
config.swift_build_lib_dir,
584586
config.swift_build_lib_dir,
585-
'' if kIsWindows else '-Xlinker -rpath -Xlinker {}'.format(toolchain_lib_dir)
587+
'' if kIsWindows or toolchain_lib_dir is None else '-Xlinker -rpath -Xlinker {}'.format(toolchain_lib_dir)
586588
)
587589
)
588590

0 commit comments

Comments
 (0)