Skip to content

Commit 4585821

Browse files
kateinoigakukunrunner
authored andcommitted
[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 6f0b46c commit 4585821

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
@@ -566,16 +566,18 @@ else:
566566
)
567567
)
568568
# Parse the host triple.
569-
(host_cpu, host_vendor, host_os, host_vers) = re.match('([^-]+)-([^-]+)-([^0-9-]+)(.*)', config.host_triple).groups()
570-
toolchain_lib_dir = make_path(config.swift_lib_dir, 'swift', host_os)
569+
toolchain_lib_dir = None
570+
if config.host_triple:
571+
(host_cpu, host_vendor, host_os, host_vers) = re.match('([^-]+)-([^-]+)-([^0-9-]+)(.*)', config.host_triple).groups()
572+
toolchain_lib_dir = make_path(config.swift_lib_dir, 'swift', host_os)
571573
config.host_build_swift = (
572574
"%s -target %s -g %s -I %s -L %s %s" % (
573575
config.swiftc_driver,
574576
config.host_triple,
575577
'' if kIsWindows else '-no-toolchain-stdlib-rpath',
576578
config.swift_build_lib_dir,
577579
config.swift_build_lib_dir,
578-
'' if kIsWindows else '-Xlinker -rpath -Xlinker {}'.format(toolchain_lib_dir)
580+
'' if kIsWindows or toolchain_lib_dir is None else '-Xlinker -rpath -Xlinker {}'.format(toolchain_lib_dir)
579581
)
580582
)
581583

0 commit comments

Comments
 (0)