Skip to content

Commit 6ae005e

Browse files
authored
Unify env vars for Utilities/bootstrap commands (#8154)
This is a prerequisite for enabling incremental builds when running `./Utillities/bootstrap build --release` and `./Utilities/bootstrap test --release` in a sequence. ### Motivation: Environment variables passed to `swift-bootstrap` from `./Utilities/bootstrap build` and `./Utilities/bootstrap test` commands unnecessarily differed slightly, which caused generated build manifests to be different. This precluded incremental builds when running these commands in a sequence one after each other, slowing down our CI jobs. ### Modifications: Moved env var computation logic to the existing `get_swiftpm_env_cmd` function in `Utilities/bootstrap`. ### Result: `swift-bootstrap` is consistently called with the same environment variables, ensuring that generated build manifests can be the same, eventually enabling incremental builds.
1 parent c26c12f commit 6ae005e

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

Utilities/bootstrap

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -359,16 +359,9 @@ def test(args):
359359
"""Builds SwiftPM, then tests itself."""
360360
build(args)
361361

362-
if '-macosx' in args.build_target:
363-
extra_env = ["SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS=YES"]
364-
else:
365-
extra_env = []
366-
367362
note("Testing")
368363
parse_test_args(args)
369-
cmd = extra_env + [
370-
"SWIFT_EXEC=" + args.swiftc_path,
371-
"SWIFT_DRIVER_SWIFT_EXEC=" + args.swiftc_path,
364+
cmd = [
372365
os.path.join(args.bin_dir, "swift-test")
373366
]
374367
if args.parallel:
@@ -646,11 +639,7 @@ def build_swiftpm_with_cmake(args):
646639
def build_swiftpm_with_swiftpm(args, integrated_swift_driver):
647640
"""Builds SwiftPM using the version of SwiftPM built with CMake."""
648641

649-
swiftpm_args = [
650-
"SWIFT_EXEC=" + args.swiftc_path,
651-
"SWIFT_DRIVER_SWIFT_EXEC=" + args.swiftc_path,
652-
"CC=" + args.clang_path
653-
]
642+
swiftpm_args = []
654643

655644
if args.bootstrap:
656645
note("Building SwiftPM (with a freshly built swift-bootstrap)")
@@ -777,6 +766,14 @@ def get_swiftpm_env_cmd(args):
777766
libs_joined = ":".join(libs + args.target_info["paths"]["runtimeLibraryPaths"])
778767
env_cmd.append("LD_LIBRARY_PATH=%s" % libs_joined)
779768

769+
if '-macosx' in args.build_target:
770+
env_cmd.append("SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS=YES")
771+
772+
env_cmd += [
773+
"SWIFT_EXEC=" + args.swiftc_path,
774+
"SWIFT_DRIVER_SWIFT_EXEC=" + args.swiftc_path,
775+
"CC=" + args.clang_path,
776+
]
780777
return env_cmd
781778

782779
def get_swiftpm_flags(args):

0 commit comments

Comments
 (0)