Skip to content

Commit 2739e06

Browse files
committed
Use the versioned triple outside of Darwin.
Some platforms require the normal, versioned triple to be supplied for the target flag, as Swift modules use this versioned triple as a subdirectory. If the unversioned triple is used instead, the standard library won't be found on these platforms. Instead, use the unversioned triple only on Darwin. This also should be a noop on Linux. This behavior matches swiftlang/swift-package-manager#3576 and swiftlang/swift-tools-support-core#229 which contain additional context.
1 parent e50332a commit 2739e06

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Utilities/build-script-helper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,10 @@ def get_build_target(swiftc_path, args):
601601
stderr=subprocess.PIPE,
602602
universal_newlines=True).strip()
603603
args.target_info = json.loads(target_info_json)
604-
return args.target_info['target']['unversionedTriple']
604+
triple = args.target_info['target']['triple']
605+
if platform.system() == 'Darwin':
606+
triple = args.target_info['target']['unversionedTriple']
607+
return triple
605608
except Exception as e:
606609
error(str(e))
607610

0 commit comments

Comments
 (0)