Skip to content

Commit c3f7692

Browse files
committed
Do not test inferior Swift libraries on Darwin
On platforms with ABI-stable Swift runtime libraries (currently only Darwin), we should not set `DYLD_LIBRARY_PATHS` to include the inferior Swift libs in `bootstrap` because compatibility issues can arise from SwiftPM's use of Foundation (which itself is a client of the stdlib) and from using dyld4 (which is used on macOS 12+). rdar://88475529
1 parent 33e05c7 commit c3f7692

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Utilities/bootstrap

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ def get_swiftpm_env_cmd(args):
684684
env_cmd.append("SWIFTPM_MACOS_DEPLOYMENT_TARGET=%s" % g_macos_deployment_target)
685685

686686
if args.bootstrap:
687-
libs_joined = ":".join([
687+
library_paths = [
688688
os.path.join(args.bootstrap_dir, "lib"),
689689
os.path.join(args.build_dirs["tsc"], "lib"),
690690
os.path.join(args.build_dirs["llbuild"], "lib"),
@@ -694,11 +694,17 @@ def get_swiftpm_env_cmd(args):
694694
os.path.join(args.build_dirs["swift-crypto"], "lib"),
695695
os.path.join(args.build_dirs["swift-system"], "lib"),
696696
os.path.join(args.build_dirs["swift-collections"], "lib"),
697-
] + args.target_info["paths"]["runtimeLibraryPaths"])
697+
]
698698

699699
if platform.system() == 'Darwin':
700+
# Need to include backwards compatibility libraries for Concurrency
701+
# FIXME: Would be nice if we could get this from `swiftc -print-target-info`
702+
back_compat = args.target_info["paths"]["runtimeLibraryPaths"][0] + '../../swift-5.5/macosx'
703+
# Does not include Swift runtime library paths because of rdar://75752698
704+
libs_joined = ":".join(library_paths + [back_compat])
700705
env_cmd.append("DYLD_LIBRARY_PATH=%s" % libs_joined)
701706
else:
707+
libs_joined = ":".join(library_paths + args.target_info["paths"]["runtimeLibraryPaths"])
702708
env_cmd.append("LD_LIBRARY_PATH=%s" % libs_joined)
703709

704710
return env_cmd

0 commit comments

Comments
 (0)