Skip to content

Commit eae8e68

Browse files
authored
Use the versioned triple outside of Darwin. (#1209)
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 689c608 commit eae8e68

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Utilities/build-script-helper.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,11 @@ 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+
# Windows also wants unversionedTriple, but does not use this.
606+
if platform.system() == 'Darwin':
607+
triple = args.target_info['target']['unversionedTriple']
608+
return triple
605609
except Exception as e:
606610
error(str(e))
607611

0 commit comments

Comments
 (0)