Skip to content

Commit 21d57e8

Browse files
[lit] Repair tests for stdlib-only build
`config.host_triple` can be None when no host tools are built
1 parent 1cf20fb commit 21d57e8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/lit.cfg

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,13 +548,14 @@ else:
548548
"env SDKROOT=%s %r -toolchain-stdlib-rpath -Xlinker -rpath -Xlinker /usr/lib/swift %s %s %s"
549549
% (shell_quote(config.host_sdkroot), config.swiftc, mcp_opt, config.swift_test_options, config.swift_driver_test_options))
550550

551-
# Parse the host triple.
552-
(host_cpu, host_vendor, host_os, host_vers) = re.match('([^-]+)-([^-]+)-([^0-9-]+)(.*)', config.host_triple).groups()
553-
554551
if platform.system() == 'Darwin':
555552
host_build_extra_rpath=""
556-
else:
553+
elif config.host_triple:
554+
# Parse the host triple.
555+
(host_cpu, host_vendor, host_os, host_vers) = re.match('([^-]+)-([^-]+)-([^0-9-]+)(.*)', config.host_triple).groups()
557556
host_build_extra_rpath="-Xlinker -rpath -Xlinker %s" % (make_path(config.swift_lib_dir, 'swift', host_os))
557+
else:
558+
host_build_extra_rpath=""
558559

559560
config.host_build_swift = (
560561
"%s -sdk %s -target %s -I %s -L %s %s" % (config.swiftc_driver, config.host_sdkroot, config.host_triple, config.swift_host_lib_dir, config.swift_host_lib_dir, host_build_extra_rpath))

0 commit comments

Comments
 (0)