diff --git a/linux-bin/xcodebuild b/linux-bin/xcodebuild index c1f30c22..3995d2f0 100755 --- a/linux-bin/xcodebuild +++ b/linux-bin/xcodebuild @@ -1674,9 +1674,9 @@ def package_test(a, argv): def package_engine(): - """how a package builds: "swiftbuild" (as Xcode: SwiftPM's package PIF built by Swift Build, swiftbuild/pkgbuild.py) - or "swiftpm" (x86sim test --spm: SwiftPM's own build); $XCODEBUILD_PACKAGE_ENGINE""" - return os.environ.get("XCODEBUILD_PACKAGE_ENGINE", "swiftpm") + """how a package builds: "swiftbuild" (default: as Xcode, SwiftPM's package PIF built by Swift Build, + swiftbuild/pkgbuild.py) or "swiftpm" (x86sim test --spm: SwiftPM's own build); $XCODEBUILD_PACKAGE_ENGINE""" + return os.environ.get("XCODEBUILD_PACKAGE_ENGINE", "swiftbuild") def package_swiftbuild(a, name, x, phones): diff --git a/swiftbuild/swbuild-events b/swiftbuild/swbuild-events index 6827b19f..1a4a8dc0 100755 --- a/swiftbuild/swbuild-events +++ b/swiftbuild/swbuild-events @@ -22,6 +22,10 @@ import sys import time +# x86Sim's own variables that change from run to run and that Swift Build and its tools do not read +PER_RUN = ("X86SIM_SWBUILD_EVENTS", "X86SIM_SWBUILD_REAL", "X86SIM_XCODEBUILD_NOTES", "XCODEBUILD_SWBUILD_EVENTS") + + def main(): real = os.environ.get("X86SIM_SWBUILD_REAL") or os.path.join( os.environ.get("XDG_DATA_HOME") or os.path.expanduser("~/.local/share"), @@ -48,6 +52,11 @@ def main(): os.environ["X86SIM_PROVISIONING_REAL"] = os.environ["SWEETPAD_PROVISIONING"] os.environ["SWEETPAD_PROVISIONING"] = prov out = os.environ.get("X86SIM_SWBUILD_EVENTS") + # Swift Build's build description is keyed by its environment, too: a path that differs on every run (this + # wrapper's events file, the stand-in's notes) made every build a new description, with the tasks it reruns + # (Info.plist, CopySwiftLibs, CodeSign of each product) where Xcode's next build reuses its description + for k in PER_RUN: + os.environ.pop(k, None) if not out: os.execv(real, [real] + sys.argv[1:]) p = subprocess.Popen([real] + sys.argv[1:], stdout=subprocess.PIPE)