From 6690496ac5e932e6d80d83b08aed951816de873f Mon Sep 17 00:00:00 2001 From: Alastair Houghton Date: Wed, 10 Sep 2025 11:13:28 +0100 Subject: [PATCH 1/4] [Bootstrap] Add an extra argument to set a library path. During Swift PR testing, we run the SwiftPM tests. Unfortunately, the SwiftPM tests always try to link with the system version of the Swift runtime libraries. This would be fine, except that Swift Testing has been built against the *new* runtimes and as a result has ended up referencing symbols from them that might not be present in the system runtime libraries. To fix this, add an extra argument to allow us to add to the `DYLD_LIBRARY_PATH` setting SwiftPM uses to run its tests. rdar://160273124 --- Utilities/bootstrap | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Utilities/bootstrap b/Utilities/bootstrap index d6bdd3d2f2f..b35f028b297 100755 --- a/Utilities/bootstrap +++ b/Utilities/bootstrap @@ -167,6 +167,9 @@ def add_build_args(parser): "--llbuild-link-framework", action="store_true", help="whether to link to the llbuild framework") + parser.add_argument( + "--extra-dynamic-library-path", + help="path to add to DYLD/LD_LIBRARY_PATH", parser.add_argument( "--release", action="store_true", @@ -891,6 +894,9 @@ def get_swiftpm_env_cmd(args): os.path.join(args.build_dirs["swift-build"], "lib"), ] + if args.extra_dynamic_library_path: + libs.append(args.extra_dynamic_library_path) + if platform.system() == 'Darwin': env_cmd.append("DYLD_LIBRARY_PATH=%s" % ":".join(libs)) else: From d1c7fe1ef35b11c0c520cf87e57f1349386f6856 Mon Sep 17 00:00:00 2001 From: Alastair Houghton Date: Wed, 10 Sep 2025 13:48:54 +0100 Subject: [PATCH 2/4] [Bootstrap] Fix typo. Fixed a typo in the script. rdar://160273124 --- Utilities/bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/bootstrap b/Utilities/bootstrap index b35f028b297..a3523e1ac40 100755 --- a/Utilities/bootstrap +++ b/Utilities/bootstrap @@ -169,7 +169,7 @@ def add_build_args(parser): help="whether to link to the llbuild framework") parser.add_argument( "--extra-dynamic-library-path", - help="path to add to DYLD/LD_LIBRARY_PATH", + help="path to add to DYLD/LD_LIBRARY_PATH") parser.add_argument( "--release", action="store_true", From 75de050c8408c08bf879ef75e82421a6601d7260 Mon Sep 17 00:00:00 2001 From: Alastair Houghton Date: Mon, 29 Sep 2025 10:44:58 +0100 Subject: [PATCH 3/4] [Bootstrap] Force-enable the backtracer. This *might* break things, but I need it to debug a test. rdar://160273124 --- Utilities/bootstrap | 1 + 1 file changed, 1 insertion(+) diff --git a/Utilities/bootstrap b/Utilities/bootstrap index a3523e1ac40..59c83ef1abb 100755 --- a/Utilities/bootstrap +++ b/Utilities/bootstrap @@ -907,6 +907,7 @@ def get_swiftpm_env_cmd(args): env_cmd.append("SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS=YES") env_cmd += [ + "SWIFT_BACKTRACE=enable=yes,warnings=suppressed", "SWIFT_EXEC=" + args.swiftc_path, "SWIFT_DRIVER_SWIFT_EXEC=" + args.swiftc_path, "CC=" + args.clang_path, From ca612ef5439abb870314408b0e6cded1a211ee10 Mon Sep 17 00:00:00 2001 From: Alastair Houghton Date: Wed, 1 Oct 2025 09:57:57 +0100 Subject: [PATCH 4/4] [Bootstrap] Set `(DY)LD_LIBRARY_PATH` even if not bootstrapping. We should set `(DY)LD_LIBRARY_PATH` if we need to, even if we aren't bootstrapping. rdar://160273124 --- Utilities/bootstrap | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Utilities/bootstrap b/Utilities/bootstrap index 59c83ef1abb..a36bdce901d 100755 --- a/Utilities/bootstrap +++ b/Utilities/bootstrap @@ -879,8 +879,9 @@ def get_swiftpm_env_cmd(args): if not '-macosx' in args.build_target and args.command == 'install': env_cmd.append("SWIFTCI_INSTALL_RPATH_OS=%s" % args.platform_path.group(2)) + libs = [] if args.bootstrap: - libs = [ + libs += [ os.path.join(args.bootstrap_dir, "lib"), os.path.join(args.build_dirs["tsc"], "lib"), os.path.join(args.build_dirs["llbuild"], "lib"), @@ -894,9 +895,10 @@ def get_swiftpm_env_cmd(args): os.path.join(args.build_dirs["swift-build"], "lib"), ] - if args.extra_dynamic_library_path: - libs.append(args.extra_dynamic_library_path) + if args.extra_dynamic_library_path: + libs.append(args.extra_dynamic_library_path) + if libs: if platform.system() == 'Darwin': env_cmd.append("DYLD_LIBRARY_PATH=%s" % ":".join(libs)) else: