Skip to content

[MacOS] Fix non-deterministic framework linking order on macOS for incremental builds - #114327

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
LanzaSchneider:fix-non-deterministic-framework-macos
Mar 19, 2026
Merged

[MacOS] Fix non-deterministic framework linking order on macOS for incremental builds#114327
Repiteo merged 1 commit into
godotengine:masterfrom
LanzaSchneider:fix-non-deterministic-framework-macos

Conversation

@LanzaSchneider

@LanzaSchneider LanzaSchneider commented Dec 24, 2025

Copy link
Copy Markdown
Contributor

Issue

On macOS, the order of -framework flags in LINKFLAGS can vary between builds due to the use of unordered data structures for extra_frameworks. This causes the flags string generated from the SCons environment to change on every build invocation, even when there are no actual configuration changes.

For module developers using external build systems (like Rake) that consume these flags, this results in:

  • Unnecessary regeneration of external build configuration files
  • Loss of incremental build capabilities for the external system
图片 图片

Solution

Sort the extra_frameworks list before generating the framework linker flags to ensure a deterministic order.

# Before
frameworks = [item for key in extra_frameworks for item in ["-framework", key]]

# After
frameworks = [item for key in sorted(extra_frameworks) for item in ["-framework", key]]

@stuartcarnie stuartcarnie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems reasonable to me!

@Repiteo
Repiteo merged commit 2995751 into godotengine:master Mar 19, 2026
20 checks passed
@Repiteo

Repiteo commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Thanks!

@LanzaSchneider
LanzaSchneider deleted the fix-non-deterministic-framework-macos branch March 20, 2026 02:05
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
…erministic-framework-macos

[MacOS] Fix non-deterministic framework linking order on macOS for incremental builds
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