Skip to content

Commit 71e262b

Browse files
authored
Run tvOS configuration in sequence (#794)
* Run tvOS configuration in sequence * Update build_zips.py * Remove unnecessary repo add
1 parent f094a2a commit 71e262b

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

.github/workflows/build_tvos.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ jobs:
104104
run: |
105105
pip install -r scripts/gha/requirements.txt
106106
107-
- name: Pod repo add
108-
shell: bash
109-
# The pod install fails during the cmake build, so preinstall it.
110-
run: |
111-
rm -rf ~/Library/Caches/CocoaPods/* || true
112-
pod repo add cocoapods https://github.com/CocoaPods/Specs.git
113-
pod repo update
114-
115107
- id: unity_setup
116108
uses: ./gha/unity
117109
timeout-minutes: 30

scripts/build_scripts/build_zips.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,13 +551,17 @@ def make_macos_multi_arch_build(cmake_args):
551551
",".join(g_target_architectures), final_zip_path)
552552

553553

554-
def make_tvos_target(device, arch, cmake_args):
555-
"""Make the tvos build for the given device and architecture.
554+
def configure_tvos_target(device, arch, cmake_args):
555+
"""Configure the tvos build for the given device and architecture.
556556
Assumed to be called from the build directory.
557557
558558
Args:
559+
device: Building for device or simulator.
559560
arch: The architecture to build for.
560561
cmake_args: Additional cmake arguments to use.
562+
563+
Returns:
564+
The directory that the project is configured in.
561565
"""
562566
build_args = cmake_args.copy()
563567
build_args.append("-DCMAKE_OSX_ARCHITECTURES=" + arch)
@@ -574,6 +578,14 @@ def make_tvos_target(device, arch, cmake_args):
574578
os.makedirs(arch)
575579
build_dir = os.path.join(os.getcwd(), arch)
576580
subprocess.call(build_args, cwd=build_dir)
581+
return build_dir
582+
583+
def make_tvos_target(build_dir):
584+
"""Builds the previously configured cmake project in the given directory.
585+
586+
Args:
587+
The full path to the directory to perform the build in.
588+
"""
577589
subprocess.call('make', cwd=build_dir)
578590
subprocess.call(['cpack', '.'], cwd=build_dir)
579591

@@ -594,10 +606,14 @@ def make_tvos_multi_arch_build(cmake_args):
594606
for device in g_target_devices:
595607
for arch in TVOS_CONFIG_DICT[device]["architecture"]:
596608
target_architectures.append(arch)
597-
t = threading.Thread(target=make_tvos_target, args=(device, arch, cmake_args))
609+
# Run the configure step sequentially, since they can clobber the shared Cocoapod cache
610+
build_dir = configure_tvos_target(device, arch, cmake_args)
611+
# Run the builds in parallel, since they can be
612+
t = threading.Thread(target=make_tvos_target, args=(build_dir,))
598613
t.start()
599614
threads.append(t)
600615

616+
# Wait for the builds to be finished
601617
for t in threads:
602618
t.join()
603619

0 commit comments

Comments
 (0)