|
12 | 12 | import subprocess |
13 | 13 | import sys |
14 | 14 | import traceback |
| 15 | +from shutil import copyfile |
15 | 16 |
|
16 | 17 | BARE_INTERFACE_SEARCH_PATHS = [ |
17 | 18 | "usr/lib/swift", |
@@ -362,6 +363,16 @@ def getSDKVersion(sdkroot): |
362 | 363 | fatal("Failed to get SDK version from: " + settingPath) |
363 | 364 |
|
364 | 365 |
|
| 366 | +def copySystemVersionFile(sdkroot, output): |
| 367 | + sysInfoPath = os.path.join(sdkroot, |
| 368 | + 'System/Library/CoreServices/SystemVersion.plist') |
| 369 | + destInfoPath = os.path.join(output, 'SystemVersion.plist') |
| 370 | + try: |
| 371 | + copyfile(sysInfoPath, destInfoPath) |
| 372 | + except BaseException as e: |
| 373 | + print("cannot copy from " + sysInfoPath + " to " + destInfoPath + ": " + str(e)) |
| 374 | + |
| 375 | + |
365 | 376 | def main(): |
366 | 377 | global args, shared_output_lock |
367 | 378 | parser = create_parser() |
@@ -398,6 +409,10 @@ def main(): |
398 | 409 | xfails = json.load(xfails_file) |
399 | 410 |
|
400 | 411 | make_dirs_if_needed(args.output_dir, args.dry_run) |
| 412 | + |
| 413 | + # Copy a file containing SDK build version into the prebuilt module dir, |
| 414 | + # so we can keep track of the SDK version we built from. |
| 415 | + copySystemVersionFile(args.sdk, args.output_dir) |
401 | 416 | if 'ANDROID_DATA' not in os.environ: |
402 | 417 | shared_output_lock = multiprocessing.Lock() |
403 | 418 | pool = multiprocessing.Pool(args.jobs, set_up_child, |
|
0 commit comments