Skip to content

Apple: simplified build system for all platforms - #163

Merged
akien-mga merged 10 commits into
godotengine:mainfrom
stuartcarnie:apple-build-container
Jul 15, 2026
Merged

Apple: simplified build system for all platforms#163
akien-mga merged 10 commits into
godotengine:mainfrom
stuartcarnie:apple-build-container

Conversation

@stuartcarnie

@stuartcarnie stuartcarnie commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Important

We should use the 6.4.x-snapshot-2025-06-11 for all builds, as those are still official releases from Apple

  • single build container, godot-apple:<image version> for all Apple platforms
  • Gated by APPLE_LLVM_CROSS=1
  • visionOS+tvOS support
  • SDK 26.5
  • Swift 6.3.2 (via ENV variable)
  • Swift 6.4.x-snapshot
    • via --build-arg swift_version=6.4.x-snapshot-2026-06-11
  • uses clang from Swift install
  • uses llvm-lipo to create Universal binaries
  • uses xtool-darwin-tools-llvm release for lld
  • no longer requires custom MoltenVK build for -fno-objc-msgsend-selector-stubs -Wno-unused-command-line-argument
  • no longer depends on osxcross

As a win, building a single container for all Apple platforms is significantly faster 🚀

Depends on:

* single build container for all platforms
* visionOS+tvOS support
* SDK 26.4

Container is smaller and builds significantly faster
* single build container for all platforms
* visionOS+tvOS support
* SDK 26.5
* Latest Swift 6.3.2

Container is smaller and builds significantly faster
Apple: tvOS,visionOS support; use unified apple container
@raulsntos

Copy link
Copy Markdown
Member

I have tested this (and the related PR on godot-build-scripts) to build the Godot .NET prerelease.

Before this PR, I was having issues building the iOS export templates, but it seems to work now although I haven't actually tested using the templates. This could just be a environment issue on my side, not related to this change at all.

I did get some warnings in the logs. I'm not sure if this is my setup's fault so I'll post the full logs here just in case. The warnings mention something about not finding clang intrinsic headers and that it should be reported to the OSXCross project.

logs.zip

I also had to comment out the part about notarization because it seems the sign.sh script is missing in godot-build-scripts.

@stuartcarnie

stuartcarnie commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@raulsntos those warnings are currently expected, but don't affect the compiled output.

Thanks for testing!

@Calinou Calinou added the enhancement New feature or request label Jun 3, 2026
> [!NOTE]
>
> Once 6.4 is released, I'll remove the < 6.4 hacks
@stuartcarnie
stuartcarnie force-pushed the apple-build-container branch from ed6ccd3 to 36137c5 Compare June 17, 2026 07:58
Changes variable from `SWIFT_FRONTEND` to `SWIFT_COMPILER`

Requires rsanchezsaez/godot#15
NOTE: The Xcode 26.6 .xip file wasn't readable by xar 1.8, so
`xip_extract_content.py` was introduced to extract the `Content` that is
passed into `pbzx`.
Comment thread Dockerfile.apple Outdated
Comment thread files/patches/osxcross-add-sdk-26.patch Outdated
swiftly installs a dispatcher for all the toolchain binaries, clang++,
swiftc, etc. This dispatcher spawns ~17 threads just to resolve the
real clang++, swiftc in the toolchain binary path, resulting in
an excessive number of threads on the build box (with 64 cores), causing
it to hit the default 2048 limit and failing.
stuartcarnie added a commit to stuartcarnie/godot that referenced this pull request Jul 13, 2026
@Repiteo
Repiteo requested a review from akien-mga July 14, 2026 16:38

@akien-mga akien-mga left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested successfully, it seems to work great!

I haven't reviewed everything in depth in the shell scripts and Dockerfile.apple, but it seems relatively straightforward and confirmed to work well.

@akien-mga
akien-mga merged commit 434bb3c into godotengine:main Jul 15, 2026
@akien-mga

Copy link
Copy Markdown
Member

Thanks for the amazing work on this BTW, it's a major improvement to our build pipeline! ❤️

@akien-mga akien-mga left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found some time, so belated review of the new container.

Comment thread Dockerfile.apple
Comment thread Dockerfile.apple
Comment thread Dockerfile.apple
Comment thread Dockerfile.apple
Comment thread Dockerfile.apple
Comment thread Dockerfile.apple
# * dsymutil — dSYM generation
# * libtool — llvm-libtool-darwin (Darwin-format static archiver)
#
# Pinned to v1.0.1 (Dec 2024, LLD 20 from swiftlang/llvm-project).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not super clear here, but I guess it's only pinned to that old version because it's the last one on https://github.com/xtool-org/darwin-tools-linux-llvm, not because newer version wouldn't work.

Comment thread Dockerfile.apple
Comment thread Dockerfile.apple
Comment on lines +207 to +212
# Godot's platform/{ios,tvos,visionos}/detect.py composes compiler and
# archiver paths as `${APPLE_TOOLCHAIN_PATH}/usr/bin/${apple_target_triple}<tool>`.
# The existing build-{ios,tvos,visionos}/build.sh scripts set
# APPLE_TOOLCHAIN_PATH=/root/ioscross/<arch>
# apple_target_triple=<prefix>-apple-darwin11-
# inherited from the old cctools-port wrapper layout.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like we could simplify things here and just not use the old darwin11 triple in build scripts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, those are gone now from the upgrades scripts

@stuartcarnie
stuartcarnie deleted the apple-build-container branch July 17, 2026 01:59
Paperzlel pushed a commit to Paperzlel/godot that referenced this pull request Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants