Skip to content

Apple: tvOS, visionOS support; use unified build container#159

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

Apple: tvOS, visionOS support; use unified build container#159
akien-mga merged 5 commits into
godotengine:mainfrom
stuartcarnie:apple-build-container

Conversation

@stuartcarnie

@stuartcarnie stuartcarnie commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Depends on:

Testing

  • Built the macOS editor App
  • Build the templates for iOS and visionOS
  • Generated the tpz export archive
  • Ran the editor on macOS and exported the Platformer 2D to iOS and visionOS and successfully compiled the binaries under Xcode.

* 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
Changes variable from `SWIFT_FRONTEND` to `SWIFT_COMPILER`

Requires rsanchezsaez/godot#15
Comment thread build-macos/build.sh Outdated
Comment on lines +18 to +36
# Link config for macOS:
# -fuse-ld=lld — use LLD (not cctools-port ld, which our
# image doesn't install and whose `.tbd`
# parsing pulls in the libtapi dependency).
# -B /opt/darwin-tools/bin — prepend darwin-tools to clang's program
# search so `-fuse-ld=lld` resolves to the
# Apple-platforms-enabled ld64.lld there
# (swiftly's bundled lld has Apple platforms
# disabled at build time).
# -L .../XcodeDefault.xctoolchain/usr/lib/clang/21/lib/darwin -lclang_rt.osx
# — Apple's compiler-rt from Xcode, providing
# __isPlatformVersionAtLeast for
# `if (@available(...))` / `__builtin_available`.
# Apple's clang driver auto-links this on
# macOS; osxcross-style cross-builds have to
# wire it up explicitly.
XCODE_CLANG_RT="/root/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21/lib/darwin"
EXTRA_LINKFLAGS="linkflags=-fuse-ld=lld -B /opt/darwin-tools/bin -L${XCODE_CLANG_RT} -lclang_rt.osx"

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.

Can this be added in upstream Godot's platform/macos/detect.py in some way?

Those build scripts aren't meant to have a lot of custom code compared to just configuring the build with standard SCons options we provide.

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.

I'd argue these flags are internal details specific to this build container version, so I'd rather not leak them out to the scons script. Otherwise every time I change / improve this container, I'd also have to change the scons scripts in Godot. There is already some leakage, but at least today it is fairly minimal.

My longer-term goal is to keep chipping away at these internal hacks so they aren't necessary.

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.

You can put these in the actual container as pre-set environments. That would be far preferable over having it in the build scripts. The build scripts themselves shouldn't depend on very specific versions of stuff in the containers.

For mono we also used to do that. Just add these to the environment in the container that actually has these versions installed!

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.

Good call, thanks @hpvb – will do that

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.

Done!

Comment thread build-macos/build.sh Outdated
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
Comment thread build-ios/build.sh
Comment thread build-ios/build.sh
Comment thread build-macos/build.sh
Comment thread build-visionos/build.sh
@akien-mga
akien-mga merged commit 3b77301 into godotengine:main Jul 15, 2026
@akien-mga

Copy link
Copy Markdown
Member

I'll merge this now to match godotengine/build-containers#163 which I merged earlier, but I'd like to see the outstanding review comments handled in a follow-up pair of PRs to build-containers and godot-build-scripts, so we can clean up further and prepare new build containers for 4.8-dev2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants