Skip to content

Fix Release builds compiling at -Onone - #1252

Merged
untoldengine merged 1 commit into
developfrom
patch/build_system_release_opt
Sep 26, 2026
Merged

untoldengine merged 1 commit into
developfrom
patch/build_system_release_opt

Conversation

@untoldengine

Copy link
Copy Markdown
Owner

Summary

  • Generated project.yml's Release configuration inherited optimizationLevel from BuildSettings, which defaults to .none. Any project generated without explicitly overriding that default shipped a "Release" build that was never actually optimized.
  • XcodeGenProjectSpec.swift now hardcodes SWIFT_OPTIMIZATION_LEVEL: -O for every Release config it emits (single-platform + macOS/iOS/iOS AR/visionOS multi-platform targets). BuildSettings.optimizationLevel is kept only for source compatibility with existing callers and documented as unused by project generation.

Fixes #1251

Test plan

  • swift build succeeds
  • swift test --filter BuildSystemTests — 40/40 pass, including new testReleaseConfigurationAlwaysOptimizesRegardlessOfOptimizationLevel, which reproduces the exact regression (optimizationLevel: .none) and asserts every Release block compiles at -O
  • Verified against a real generated project (UntoldXRTest): re-generated project.yml/.xcodeproj and confirmed xcodebuild -showBuildSettings -configuration Release reports SWIFT_OPTIMIZATION_LEVEL = -O

The generated project.yml's Release configuration inherited
optimizationLevel from BuildSettings, which defaults to .none. Any
project generated without explicitly overriding that default shipped
a "Release" build that was never actually optimized.

Release now always compiles at -O regardless of optimizationLevel,
which is kept only for source compatibility with existing callers.

Fixes #1251
@untoldengine
untoldengine merged commit dc1d8e9 into develop Sep 26, 2026
4 checks passed
@untoldengine
untoldengine deleted the patch/build_system_release_opt branch September 26, 2026 13:19
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.

Generated Xcode projects can ship a Release config that isn't optimized (-Onone)

1 participant