From 3557826c6021371572344eeee50a78f568f9ec80 Mon Sep 17 00:00:00 2001 From: Eric Salituro Date: Wed, 8 Apr 2026 15:17:23 -0700 Subject: [PATCH 1/2] fix(builder): pin docker-bake to linux/amd64 on macOS Docker Desktop on Apple Silicon defaults to linux/arm64; set bake platforms so local builds match CI (linux/amd64). - Apply black formatting to builder. - Tests: mock sys.platform for platform key and full bake dict equality on macOS. Signed-off-by: Eric Salituro Made-with: Cursor --- python/aswfdocker/builder.py | 11 +++++-- python/aswfdocker/tests/test_builder.py | 40 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/python/aswfdocker/builder.py b/python/aswfdocker/builder.py index 5445064e..f05ff458 100644 --- a/python/aswfdocker/builder.py +++ b/python/aswfdocker/builder.py @@ -3,10 +3,12 @@ """ CI Image and Package Builder """ + import logging import subprocess import json import os +import sys import tempfile import typing @@ -109,9 +111,9 @@ def make_bake_dict( + "_VERSION" ), "ASWF_CONAN_HOME": constants.ASWF_CONAN_HOME, - "ASWF_CONAN_BUILD_MISSING": "--build=missing" - if build_missing - else "", + "ASWF_CONAN_BUILD_MISSING": ( + "--build=missing" if build_missing else "" + ), "ASWF_CONAN_NO_REMOTE": "--no-remote" if no_remote else "", "ASWF_CONAN_PUSH": "TRUE" if self.push else "", } @@ -132,6 +134,9 @@ def make_bake_dict( "id=conan_password,env=CONAN_PASSWORD", ], } + # Docker Desktop on Apple Silicon defaults to linux/arm64; pin amd64 to match CI. + if sys.platform == "darwin": + target_dict["platforms"] = ["linux/amd64"] if self.group_info.type == constants.ImageType.PACKAGE: if not use_conan: target_dict["target"] = image diff --git a/python/aswfdocker/tests/test_builder.py b/python/aswfdocker/tests/test_builder.py index 962d7688..7a75a107 100644 --- a/python/aswfdocker/tests/test_builder.py +++ b/python/aswfdocker/tests/test_builder.py @@ -8,6 +8,7 @@ import unittest import logging import tempfile +from unittest.mock import patch from click.testing import CliRunner @@ -22,6 +23,43 @@ def setUp(self): repo_uri="notauri", source_branch="testing", aswf_version="2024.123" ) + @patch.object(builder.sys, "platform", "darwin") + def test_bake_dict_sets_linux_amd64_platform_on_macos(self): + """Match CI arch on Docker Desktop (Apple Silicon defaults to linux/arm64).""" + b = builder.Builder( + self.build_info, + groupinfo.GroupInfo( + names=["base"], + versions=["2019"], + type_=constants.ImageType.IMAGE, + targets=[], + ), + ) + baked = b.make_bake_dict(False, False) + self.assertEqual( + baked["target"]["ci-base-2019"]["platforms"], + ["linux/amd64"], + ) + + def test_bake_dict_omits_platforms_when_not_darwin(self): + b = builder.Builder( + self.build_info, + groupinfo.GroupInfo( + names=["base"], + versions=["2019"], + type_=constants.ImageType.IMAGE, + targets=[], + ), + ) + for plat in ("linux", "win32"): + with patch.object(builder.sys, "platform", plat): + baked = b.make_bake_dict(False, False) + self.assertNotIn( + "platforms", + baked["target"]["ci-base-2019"], + msg=f"host sys.platform={plat!r}", + ) + def test_package_otio_2024_dict(self): b = builder.Builder( self.build_info, @@ -115,6 +153,7 @@ def test_image_base_2019_dict(self): baked["target"]["ci-base-2019"]["args"]["ASWF_VERSION"], base_version ) + @patch.object(builder.sys, "platform", "linux") def test_image_base_2019clang_dict(self): b = builder.Builder( self.build_info, @@ -207,6 +246,7 @@ def test_image_base_2019clang_dict(self): }, ) + @patch.object(builder.sys, "platform", "linux") def test_image_base_2019_2020_dict(self): b = builder.Builder( self.build_info, From aa572609e51414fc804be0a72fe3ef4eeacf97cb Mon Sep 17 00:00:00 2001 From: Eric Salituro Date: Wed, 8 Apr 2026 15:37:21 -0700 Subject: [PATCH 2/2] docs: macOS build notes - README: Linux artifacts on macOS, Docker 8c/16GB, buildx on Docker VMM vs Rosetta Signed-off-by: Eric Salituro Made-with: Cursor --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 1d7b9103..e7c8bb4b 100644 --- a/README.md +++ b/README.md @@ -254,6 +254,17 @@ aswfdocker --verbose build --ci-image-type IMAGE --group vfx1 --version 2026 --t aswfdocker build --ci-image-type aswftesting/ci-openexr:2026 ``` +### Building on macOS + +Native macOS support is our goal, but due to limited resources, active development is intermittent. In the meantime, our existing build workflows only build Linux artifacts on macOS: `aswfdocker` drives Linux containers (for example `linux/amd64` images and Conan packages for Linux), not native macOS toolchains. + +Configure Docker with a minimum of: + +- 8 CPU cores allocated to Docker +- 16 GB of memory allocated to Docker + +Due to conflicts with Rosetta, [buildx](https://docs.docker.com/buildx/working-with-buildx/) should be run on the Docker VMM. + ## Use Cases ### GitHub Actions