Skip to content

Commit 638be9d

Browse files
committed
Refactor ci_build_mac-amd64/arm64 to use build.py
1 parent f451ea5 commit 638be9d

File tree

5 files changed

+20
-130
lines changed

5 files changed

+20
-130
lines changed

scripts/build.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import subprocess
1212
import time
1313

14+
_dry_run = False
15+
1416
def _envvar_as_tristate(key : str, default=None):
1517
value = os.getenv(key, default)
1618
if value is None:
@@ -23,7 +25,9 @@ def _run(args, extra_env_vars=None):
2325
extra_env_vars = {}
2426

2527
logging.info(f"running: {' '.join(args)}")
26-
subprocess.run(args, check=True, env={**os.environ, **extra_env_vars})
28+
29+
if not _dry_run:
30+
subprocess.run(args, check=True, env={**os.environ, **extra_env_vars})
2731

2832
def _log_dir_contents(path: str):
2933
logging.info(f"listing {path}")
@@ -41,7 +45,7 @@ def _generator_requires_architecture_flag(generator):
4145
def _is_multi_configuration_generator(generator):
4246
return generator is not None and ("Visual Studio" in generator or "Xcode" in generator or "Multi-Config" in generator)
4347

44-
def _run_cmake_configure(source_dir, binary_dir, generator, architecture, cache_variables, extra_env_vars):
48+
def _run_cmake_configure(source_dir, binary_dir, generator, architecture, cache_variables, extra_env_vars=None):
4549
if extra_env_vars is None:
4650
extra_env_vars ={}
4751

@@ -266,6 +270,7 @@ def build_osc(conf: BuildConfiguration):
266270
concurrency=conf.concurrency,
267271
target=conf.build_target
268272
)
273+
break
269274
except Exception as e:
270275
if i+1 == conf.allowed_final_target_build_attempts:
271276
raise

scripts/build_mac.sh

Lines changed: 0 additions & 92 deletions
This file was deleted.

scripts/ci_build_mac-amd64.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@
66

77
set -xeuo pipefail
88

9-
OSC_OSX_ARCHITECTURES=x86_64 ./scripts/ci_build_mac.sh
9+
OSCDEPS_BUILD_ALWAYS=ON ./scripts/build.py \
10+
--osx-architectures=x86_64 \
11+
--osx-deployment-target=14.5 \
12+
--allowed-final-target-build-attempts=8 \
13+
--seconds-between-final-target-build-attempts=2
14+

scripts/ci_build_mac-arm64.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
#!/usr/bin/env bash
22
#
33
# Performs an end-to-end CI build of OpenSim Creator. This is what build
4-
# agents should run if they want to build release arm64 binaries of OpenSim
4+
# agents should run if they want to build release amd64 binaries of OpenSim
55
# Creator on MacOS.
66

77
set -xeuo pipefail
88

9-
OSC_OSX_ARCHITECTURES=arm64 ./scripts/ci_build_mac.sh
9+
OSCDEPS_BUILD_ALWAYS=ON ./scripts/build.py \
10+
--osx-architectures=arm64 \
11+
--osx-deployment-target=14.5 \
12+
--allowed-final-target-build-attempts=8 \
13+
--seconds-between-final-target-build-attempts=2
14+

scripts/ci_build_mac.sh

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)