Skip to content
This repository was archived by the owner on Dec 4, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions linux-bin/xcodebuild
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
9 changes: 9 additions & 0 deletions swiftbuild/swbuild-events
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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)
Expand Down
Loading