Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't build universal binaries for macOS / iOS when dev_build=yes, to save on dev build time #1613

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ivorforce
Copy link
Contributor

@Ivorforce Ivorforce commented Oct 4, 2024

This change just about halves my build time (godot-cpp as an example):

  • 8:30 building universal
  • 4:30 building x86_64

Unsurprisingly, it also halves my build size:

  • 772mb universal
  • 388mb x86_64

While I agree that macOS export default should be universal, in dev mode it would be better to default to single arch.

@Ivorforce Ivorforce requested a review from a team as a code owner October 4, 2024 19:10
Copy link
Collaborator

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

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

Does this match what Godot's build system does?

If not, I'd be reluctant to do that in godot-cpp. It's really just saving you from having to additionally specify arch=arm64, which doesn't seem too onerous.

@Ivorforce
Copy link
Contributor Author

Ivorforce commented Oct 5, 2024

As far as I can see, godot is not capable of building universal at all. I think they must build the two arches separately and join them together after the build.

Edit: Confirmed, at least the GitHub runner runs them separately and then:

https://github.com/godotengine/godot/blob/a3080477ac0421aef24ca0916c40559abbf4846b/.github/workflows/macos_builds.yml#L79

@dsnopek
Copy link
Collaborator

dsnopek commented Oct 5, 2024

Ah, ok, so we're doing something totally different than Godot. :-/ I guess we'll need to decide if we want to switch to matching Godot, update Godot to match godot-cpp, or decide if we have a compelling argument to differ from Godot. This is probably worth discussing at an upcoming GDExtension meeting.

@Ivorforce
Copy link
Contributor Author

Switching to a built-twice-then-join approach may actually be better in more ways than just feature parity. I've run into the problem already that passing arch-specific flags (like -mavx) stops the build entirely. There may be a way to detect these kinds of args in the CCFlags, and split them for the two different compiles, but that seems fruitless long term.

@Ivorforce
Copy link
Contributor Author

Making this a draft because it may be superseded by #1633.

@Ivorforce Ivorforce marked this pull request as draft October 29, 2024 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants